Installation
Get started with WildflowerJS in minutes, not hours. No build tools, no compilation, no complex setup.
- No build tools or compilation
- No package.json complexity
- Works directly in browsers
- Standards-compliant HTML
Distribution Bundles
WildflowerJS provides pre-built bundles for different use cases:
| Bundle | Includes | Use Case |
|---|---|---|
wildflower.mini.min.js |
Core + Stores (no data-pools, plugins, portals, transitions, modals) | Smallest footprint (standard CRUD UI, forms, dashboards) |
wildflower.lite.min.js |
Core + Stores + data-pools (no plugins, portals, transitions, modals) | Minimal footprint with high-frequency entity rendering |
wildflower.min.js |
Core + Stores + Plugins + Portals + Transitions + Modals | Most applications |
wildflower.spa.min.js |
Core + Stores + All Features + Router | Single-page applications |
wildflower.full.min.js |
Core + Stores + All Features + Router + SSR | SEO/SSR applications |
Development builds (.dev.js) include all console messages. Production builds (.min.js) strip debug logging but keep error messages.
Installation Options
Script Tag
Add one script tag to your HTML:
<!-- Production (minified, no debug logs) -->
<script src="path/to/wildflower.min.js"></script>
<!-- Development (with debug logs) -->
<script src="path/to/wildflower.dev.js"></script>
<!-- Or enable debug via script attribute -->
<script src="path/to/wildflower.min.js" data-debug="true"></script>
Script Tag Configuration
Configure WildflowerJS directly from the script tag without any JavaScript:
| Attribute | Values | Default | Description |
|---|---|---|---|
data-debug |
true, "" |
false |
Enable debug mode and verbose logging |
data-error-handling |
log, throw, silent |
log |
How framework errors are handled |
data-auto-init |
true, false |
true |
Automatically initialize on page load |
data-wf-prefix |
true, false |
false |
Only process data-wf-* attributes |
<!-- Enable debug mode -->
<script src="wildflower.min.js" data-debug="true"></script>
<!-- Throw errors instead of logging (useful in development) -->
<script src="wildflower.min.js" data-debug data-error-handling="throw"></script>
<!-- Manual initialization (disable auto-init) -->
<script src="wildflower.min.js" data-auto-init="false"></script>
CDN
<!-- jsDelivr CDN -->
<script src="https://cdn.jsdelivr.net/npm/wildflowerjs@1/dist/wildflower.min.js"></script>
<!-- With SPA routing -->
<script src="https://cdn.jsdelivr.net/npm/wildflowerjs@1/dist/wildflower.spa.min.js"></script>
Your First Component
Create a simple interactive component in 2 steps:
Step 1: HTML Structure
<div data-component="counter">
<h2>Counter Example</h2>
<p>Count: <span data-bind="count">0</span></p>
<button data-action="increment">+</button>
<button data-action="decrement">-</button>
<button data-action="reset">Reset</button>
</div>
Step 2: Component Definition
// The global 'wildflower' instance is created automatically
wildflower.component('counter', {
state: {
count: 0
},
increment() {
this.count++
},
decrement() {
this.count--
},
reset() {
this.count = 0
}
})
That's it! WildflowerJS auto-initializes and your counter is immediately reactive.
wildflower instance automatically.
You only need to create your own instance if you disable auto-init with data-auto-init="false".
Troubleshooting Common Issues
Component Not Initializing
If your component isn't initializing, make sure:
- The component name in
data-component="name"matcheswildflower.component('name', ...) - Your component definition script runs after WildflowerJS loads
- For dynamically added components, call
wildflower.scan()
<!-- Framework loads and creates global 'wildflower' -->
<script src="wildflower.min.js"></script>
<!-- Then register your components -->
<script>
wildflower.component('my-component', {
state: { message: 'Hello' }
})
</script>
Enable Debug Mode
Enable debug mode during development for helpful console output:
<!-- Option 1: Script tag attribute (recommended) -->
<script src="wildflower.min.js" data-debug="true"></script>
<!-- Option 2: Use development build -->
<script src="wildflower.dev.js"></script>
This provides detailed logging for component initialization, state changes, and binding updates.
Flash of Empty Lists or Content
If you see lists or bound content briefly appear empty before populating, the issue is script placement. Browsers progressively render HTML as it loads, so if your component HTML appears before the framework scripts, it will briefly render unpopulated.
Solution: Place framework scripts at the start of <body>, before your component HTML:
<body>
<!-- 1. Framework scripts FIRST -->
<script src="wildflower.min.js"></script>
<!-- 2. Component HTML AFTER scripts -->
<div data-component="my-app">
<div data-list="items">
<template>...</template>
</div>
</div>
<!-- 3. Component definitions at the end -->
<script src="app.js"></script>
</body>
Why this works: Script tags are blocking - the browser waits for them to load and execute before continuing to parse the HTML. By placing framework scripts first, the framework is ready before the browser even sees your component HTML.