WildflowerJS Reactive JS, No BS*

A no-build reactive JavaScript framework, rooted in the web platform.
No build step. No dependencies. No lock-in.

<script src="wildflower.min.js"></script> ...and start building.

Back to Basics

The code you write is 100% web standard code. HTML stays HTML. JavaScript stays JavaScript. CSS stays CSS. No JSX, no templating language, no custom syntax to learn. If you know the web platform, you already know how to use this.

WildflowerJS extends the web platform. It doesn't replace it.

Your Development Simplified

Because you develop with 100% web standards, every tool in your existing chain already understands the code: IDE, browser DevTools, linter, formatter, screen reader, SEO crawler. Nothing to install, no custom file types, no sourcemaps. Save the file, refresh, and your change is live.

Just be a web developer.

Batteries Included: One Mental Model

Router, SSR, stores, computed properties, two-way binding, event modifiers, data pools, and TypeScript types, all built in, all speaking the same language. Learn data-bind once and you know binding everywhere: lists, pools, stores, forms. There's no five-library stack to keep in sync.

One script tag. Everything you need.

<div data-component="counter">
  <span data-bind="count"></span>
  <button data-action="increment">
    +1
  </button>
</div>

<script>
wildflower.component('counter', {
  state: { count: 0 },
  increment() { this.count++ }
})
</script>

How It Works

data-bind connects state to the DOM.

data-action connects events to methods.

this.count++ triggers a precise DOM update.

Mutate state. The DOM updates.

Two Reactivity Modes

data-list for automatic reactivity: mutate state, DOM updates. data-pool for explicit control: plain objects, zero proxy overhead, you say what changed.

Same template syntax. Different performance profile. From interactive forms to per-frame particle systems. You choose the right tradeoff for the job.

Try it. Right-click, inspect this demo. Every dot is a real DOM element.

See full demo →

* Build Step

Zero Toolchain

Modern frameworks ask you to install a compiler, a bundler, a package manager, hundreds of fragile transitive dependencies, and a framework-specific file format, before you write a single line of your application.

WildflowerJS was built starting from a single principle: no build step, no tooling. Ever.

WildflowerJS asks you to add a script tag.

There's no CLI scaffolding step, no config files, no .vue/.jsx/.svelte source format. You don't debug through sourcemaps or wait on a build pipeline. Your project has zero dependencies.

Performance isn't a tradeoff. Build steps optimize bundle delivery, not the runtime work that follows it. WildflowerJS writes directly to the DOM, with no virtual DOM or reconciliation pass between state change and update, so it doesn't need a build step to be fast.

The framework is full-featured without the toolchain: router, SSR, stores, computed properties, transitions, pools. You don't need a toolchain to use any of it.

my-app/
  index.html
  app.js
  style.css
  wildflower.min.js

That's the entire project. No package.json.
No node_modules. No config files. Ship it.

Zero Install. Zero Attack Surface.

Every dependency you install is trust extended to a maintainer you've never met, running scripts on your dev machine and in your CI. A typical React + Vite + UI‑lib setup pulls in 300+ transitive packages before you write a feature.

Each one is a potential intrusion vector. NPM worms, OAuth chains compromising deploy platforms, postinstall hijacking: the supply chain is now where production code gets compromised, not the deploy. And signing isn't a backstop: Mini Shai‑Hulud (May 2026) compromised 170+ packages whose malicious versions carried valid SLSA Build Level 3 provenance, because the attestation came from build infrastructure the worm had already taken over.

WildflowerJS users don't have this attack surface, by construction. There is no npm install, no postinstall script, no transitive package graph. The framework is one file you copy or pin by hash.

As of v1.1, the same holds for building the framework itself. WildflowerJS bundles with a vendored rollup and terser pipeline pulled as three SHA‑512‑pinned tarballs: no npm install, no transitive packages, no postinstall scripts in the build path. The entire toolchain is three files you verify by hash.

Zero dependencies is the absence of a problem the rest of the industry has not properly addressed.

A typical React/Vue project:

  npm install
  ├── hundreds of packages
  ├── from hundreds of maintainers
  ├── postinstall scripts run on install
  └── tens to hundreds of MB of transitive code

WildflowerJS:

  <script src="wildflower.min.js"></script>
  └── 1 file.
      No transitive dependencies.

Zero Lock-in

WildflowerJS works with the DOM, not instead of it. There's no virtual DOM intercepting your code and no compiler rewriting your markup. The render cycle is yours.

That means Leaflet, DataTables, Chart.js, D3, Three.js, any library that touches the DOM, just works. No wrapper packages or framework-specific escape hatches required. Drop in a script tag and use it.

Because your code is standard HTML and JavaScript, you're never locked in. Your skills transfer and your code is more portable. If you outgrow the framework, your knowledge doesn't expire.

This also means your "ecosystem" is all of the world of vanilla JS. Without compromises or hacks.

<!-- Use any library directly -->
<div data-component="map-view">
  <div id="map" style="height: 400px"></div>
</div>
wildflower.component('map-view', {
  state: { lat: 51.505, lng: -0.09 },
  init() {
    // Leaflet works as-is. No wrappers.
    this._map = L.map('map')
      .setView([this.lat, this.lng], 13);
    L.tileLayer('https://{s}.tile.osm.org'
      + '/{z}/{x}/{y}.png').addTo(this._map);
  }
})

Precise Reactivity

When you write this.count++, WildflowerJS updates the single DOM node bound to count. Nothing else is touched. There's no tree diffing or reconciliation pass to figure that out.

This isn't a tradeoff. You get fine-grained updates and a simple mental model. Change a property, the bound element updates. That's the entire reactivity model.

Other frameworks ask you to learn signals, accessors, memos, effects, and subscription lifecycles to achieve what WildflowerJS does with a property assignment.

wildflower.component('dashboard', {
  state: {
    users: 1420,
    status: 'healthy'
  },
  computed: {
    summary() {
      return this.users + ' users, ' + this.status;
    }
  },
  refresh() {
    this.users = 1421;
    // Only the elements bound to 'users'
    // and 'summary' update. Everything
    // else on the page is untouched.
  }
})

One Reactivity Model. Everywhere.

Components, Stores, and Plugins all share the same reactive foundation. State, computed properties, and methods work identically no matter where they live. Learn it once, it works the same way in a UI component, a global store, or a framework plugin.

Other frameworks make you learn a different system for each layer. React components use hooks, but stores need Redux or Zustand, which are completely different APIs. Vue components use reactive data, but Pinia stores have their own patterns. Every layer is a new mental model.

In WildflowerJS, there's one model. A store is a component without a template. A plugin is an entity that extends the framework itself, adding directives, lifecycle hooks, and services. The same this.count++ triggers the same reactivity everywhere.

This unlocks patterns other frameworks can't express. A store can run headless physics simulations with tick(), feeding data into a component that renders it through a pool, all using the same reactive primitives, no glue code required.

// Component: reactive UI
wildflower.component('cart', {
  state: { items: [] },
  computed: {
    total() { return this.items.length; }
  }
})

// Store: global shared state
wildflower.store('user', {
  state: { name: '', role: 'guest' },
  computed: {
    isAdmin() { return this.role === 'admin'; }
  }
})

// Plugin: extends the framework
wildflower.plugin({
  name: 'notifications',
  state: { items: [], unreadCount: 0 },
  computed: {
    hasUnread() { return this.unreadCount > 0; }
  },
  add(msg) { this.items.push(msg); this.unreadCount++; }
})
// Access globally: wildflower.$notifications.add(...)

// Same state. Same computed. Same methods.

Data Pools

Every framework wraps collection items in reactive proxies, whether the item needs it or not. WildflowerJS gives you a choice: data-list for push reactivity (automatic), data-pool for pull reactivity (explicit control, zero proxy overhead).

Pools render plain objects with the same template syntax as lists. Mutate the object, call markDirty(), and only that item updates. Full CRUD, selection, bulk operations, all faster than the push-reactive path.

And because pools use pull-based rendering, they scale to simulations, games, particle systems, and data visualizations at native frame rate. Use cases that would choke a virtual DOM. No other framework has anything like this.

<div data-component="user-table">
  <tbody data-pool="users" data-key="id">
    <template>
      <tr>
        <td data-bind="name"></td>
        <td data-bind="status"
            data-bind-class="status === 'active'
              ? 'badge success'
              : 'badge inactive'"></td>
      </tr>
    </template>
  </tbody>
</div>
wildflower.component('user-table', {
  pools: { users: {} },

  init() {
    // Populate: plain objects, no proxies
    data.forEach(u => this.pools.users.add(u));
  },

  // Optional: add tick() and the same pool
  // renders every frame. Same template, same
  // data, different rendering frequency.
  // That's the only difference between a
  // display table and a particle system.
})

Built for AI-Assisted Development

Because WildflowerJS is standard HTML and JavaScript, AI code assistants already know how to write it. There's no custom syntax to hallucinate or compiler quirks to work around. The code an AI generates runs exactly as written, with no build step between generation and execution.

We go further. WildflowerJS ships an AI-optimized reference page with patterns, anti-patterns, and examples designed for code generation context windows. Our llms.txt file follows the llms.txt convention for machine-readable documentation.

And for structured app generation, our Universal App Manifest lets you describe an entire application as a JSON schema (components, state, computed properties, methods, templates) and have an AI generate the working code from the manifest, mediated through framework-specific idiom files.

You: "Build me a todo app with
WildflowerJS"

AI reads llms.txt or ai-assistant.html
     ↓
Generates standard HTML + JS
     ↓
<div data-component="todo-app">
  <input data-model="newItem">
  <button data-action="addItem">
    Add
  </button>
  <ul data-list="items">
    <template>
      <li data-bind="text"></li>
    </template>
  </ul>
</div>
     ↓
Open in your browser. It works, and you can read and understand the code.

Third-Party Library Integration

WildflowerJS works seamlessly with third-party JavaScript libraries because it has no virtual DOM. Libraries that manipulate the real DOM directly - like Leaflet, FullCalendar, SortableJS, Chart.js, and many others - can be integrated without wrappers, adapters, or special plugins.

Why WildflowerJS integrates well:
  • No Virtual DOM - Libraries can read from and write to the real DOM without conflicts
  • Simple Scanning - Call wildflower.scan() after any library renders new content
  • Data Attributes - Use data-bind-attr to set IDs that libraries need
  • No Framework Lock-in - Use any JavaScript library without "wrapper" packages

The Integration Pattern

Integrating third-party libraries follows a consistent pattern:

  1. Initialize the library - Create the library instance on your DOM element
  2. Scan after rendering - If the library renders content containing WildflowerJS components, call wildflower.scan()
  3. Sync state changes - Use watchers or subscriptions to keep the library in sync with your state
  4. Use data-bind-attr - Set data attributes that the library needs to identify elements

Loading Libraries Securely (Subresource Integrity)

When you pull a library from a CDN, lock it to a known-good hash with Subresource Integrity (SRI). The browser hashes the downloaded file and refuses to run it if the bytes do not match, so a tampered or swapped-out CDN file is blocked instead of executed. This is the runtime equivalent of how WildflowerJS pins its own build tools - rollup and terser are fetched as SHA-512-verified tarballs - so apply the same discipline to the libraries you load at runtime.

<!-- Pin the exact version, then lock the file with its hash -->
<script
  src="https://cdn.jsdelivr.net/npm/sortablejs@1.15.2/Sortable.min.js"
  integrity="sha512-..."
  crossorigin="anonymous"></script>

Generate the hash from the exact file you intend to ship:

curl -s https://cdn.jsdelivr.net/npm/sortablejs@1.15.2/Sortable.min.js \
  | openssl dgst -sha512 -binary | openssl base64 -A
# prefix the result with "sha512-" for the integrity attribute
Three rules for SRI to work:
  • Pin the version. The URL must point at an exact version (sortablejs@1.15.2), never @latest or an unversioned path. The hash is tied to specific bytes, so an auto-updating URL breaks on every release - which is the point: an unexpected change is blocked, not run.
  • Add crossorigin="anonymous". SRI on a cross-origin script requires CORS; without it the browser will not run the script even when the hash matches.
  • Hash the file you actually load. Minified vs unminified, or a different version, yields a different hash. jsDelivr and unpkg also expose a copy-paste SRI hash in their UIs, or use srihash.org.

WildflowerJS itself can be pinned the same way when loaded from a CDN: generate the hash for the exact wildflower.min.js version you reference.

Dynamic Action Binding with rebindActions()

When a component renders content via innerHTML that includes data-action attributes, those actions need to be bound to the component. Use this.rebindActions() after updating the DOM:

// After dynamically adding content with data-action attributes
this.element.querySelector('.container').innerHTML = `
    <button data-action="handleClick">Click Me</button>
    <button data-action="handleSubmit">Submit</button>
`;

// Bind the new action handlers
this.rebindActions();
Note: rebindActions() is safe to call multiple times - already-bound elements are skipped. This is the recommended pattern for dynamic content rendering within components.

Example: SortableJS

SortableJS enables drag-and-drop reordering of lists. Use data-list for declarative rendering and initialize SortableJS in init(). When the user drags, read the new order from the DOM and update your state array.

<style>
.task-list { list-style: none; margin: 0; padding: 0; }
.task-item { display: flex; align-items: center; gap: 12px; padding: 10px 14px; margin-bottom: 4px; background: #888; color: #fff; border-radius: 6px; cursor: grab; }
.task-item .drag-handle { color: #ccc; user-select: none; }
.task-item .task-text { flex: 1; }
.task-item .remove-btn { margin-left: auto; flex-shrink: 0; }
</style>

<div data-component="task-manager">
    <h5>Drag to Reorder</h5>
    <ul class="task-list" data-list="tasks" data-key="id">
        <template>
            <li class="task-item" data-bind-attr="({ 'data-task-id': id })">
                <span class="drag-handle">&#8942;&#8942;</span>
                <span class="task-text" data-bind="text"></span>
                <button class="btn btn-sm btn-danger remove-btn" data-action="removeTask">&times;</button>
            </li>
        </template>
    </ul>
</div>
wildflower.component('task-manager', {
    state: {
        tasks: [
            { id: 1, text: 'Book flights' },
            { id: 2, text: 'Reserve hotel' },
            { id: 3, text: 'Pack bags' },
            { id: 4, text: 'Get travel insurance' },
            { id: 5, text: 'Print boarding passes' }
        ]
    },

    init() {
        const self = this;
        const list = this.element.querySelector('.task-list');

        // Load SortableJS dynamically if not already available
        if (window.Sortable) {
            this.initSortable(list);
        } else {
            const script = document.createElement('script');
            script.src = 'https://cdn.jsdelivr.net/npm/sortablejs@1.15.2/Sortable.min.js';
            script.onload = function() { self.initSortable(list); };
            document.head.appendChild(script);
        }
    },

    initSortable(list) {
        new Sortable(list, {
            animation: 150,
            handle: '.drag-handle',
            ghostClass: 'sortable-ghost',
            onEnd: () => {
                const items = list.querySelectorAll('[data-task-id]');
                const newOrder = Array.from(items).map(
                    el => parseInt(el.dataset.taskId)
                );
                this.tasks = newOrder.map(id =>
                    this.tasks.find(t => t.id === id)
                );
            }
        });
    },

    removeTask(event, element) {
        const id = parseInt(
            element.closest('[data-task-id]').dataset.taskId
        );
        this.tasks = this.tasks.filter(
            t => t.id !== id
        );
    }
});
Live Preview
Key Pattern: Use data-list with data-key for declarative rendering. In the SortableJS onEnd callback, read the reordered data-task-id attributes from the DOM and rebuild the state array to match. WildflowerJS reconciles the rest.

SortableJS with data-list (Cross-List Drag-and-Drop)

For kanban-style interfaces where items move between multiple lists, you can use SortableJS directly with data-list. WildflowerJS automatically detects when SortableJS moves elements between lists and reconciles the DOM correctly.

How it works: When SortableJS physically moves a DOM element from one list to another, WildflowerJS detects that the element's internal context doesn't match its new parent list. It then performs a full re-render to correctly bind the element to its new list context.
<div data-component="kanban-board">
    <div style="display:flex; gap:12px;">
        <div style="flex:1;">
            <h6>To Do</h6>
            <div class="card card-body card-list" data-list="todoCards" data-key="id"
                style="min-height:80px;">
                <template>
                    <div data-bind-attr="({ 'data-card-id': id })"
                        style="padding:8px 12px; margin-bottom:4px; background:#888; color:#fff; border-radius:4px; cursor:grab;">
                        <span data-bind="title"></span>
                    </div>
                </template>
            </div>
        </div>

        <div style="flex:1;">
            <h6>In Progress</h6>
            <div class="card card-body card-list" data-list="inProgressCards" data-key="id"
                style="min-height:80px;">
                <template>
                    <div data-bind-attr="({ 'data-card-id': id })"
                        style="padding:8px 12px; margin-bottom:4px; background:#888; color:#fff; border-radius:4px; cursor:grab;">
                        <span data-bind="title"></span>
                    </div>
                </template>
            </div>
        </div>

        <div style="flex:1;">
            <h6>Done</h6>
            <div class="card card-body card-list" data-list="doneCards" data-key="id"
                style="min-height:80px;">
                <template>
                    <div data-bind-attr="({ 'data-card-id': id })"
                        style="padding:8px 12px; margin-bottom:4px; background:#888; color:#fff; border-radius:4px; cursor:grab;">
                        <span data-bind="title"></span>
                    </div>
                </template>
            </div>
        </div>
    </div>
</div>
wildflower.component('kanban-board', {
    state: {
        todoCards: [
            { id: 1, title: 'Design mockups' },
            { id: 2, title: 'Write specs' }
        ],
        inProgressCards: [
            { id: 3, title: 'Build API' }
        ],
        doneCards: [
            { id: 4, title: 'Setup project' }
        ]
    },

    init() {
        const self = this;

        function setup() {
            self.element.querySelectorAll('.card-list').forEach(
                function(list) {
                    new Sortable(list, {
                        group: 'kanban-cards',
                        animation: 150,
                        ghostClass: 'sortable-ghost',
                        onEnd: function(evt) {
                            const cardId = parseInt(
                                evt.item.dataset.cardId
                            );
                            const fromList = evt.from.dataset.list;
                            const toList = evt.to.dataset.list;

                            if (fromList !== toList) {
                                self.moveCard(
                                    cardId, fromList,
                                    toList, evt.newIndex
                                );
                            }
                        }
                    });
                }
            );
        }

        if (window.Sortable) {
            setup();
        } else {
            const script = document.createElement('script');
            script.src = 'https://cdn.jsdelivr.net/npm/sortablejs@1.15.2/Sortable.min.js';
            script.onload = setup;
            document.head.appendChild(script);
        }
    },

    moveCard(cardId, fromName, toName, newIndex) {
        const fromList = this[fromName];
        const card = fromList.find(c => c.id === cardId);
        const newFrom = fromList.filter(c => c.id !== cardId);
        const newTo = [...this[toName]];
        newTo.splice(newIndex, 0, card);

        this[fromName] = newFrom;
        this[toName] = newTo;
    }
});
Live Preview
Important: The data-bind-attr="({ 'data-card-id': id })" on each card is essential. It sets a data-card-id attribute that we read in onEnd to identify which card was moved.
Why this works: Unlike other reactive frameworks that require you to manually revert SortableJS's DOM changes, WildflowerJS is designed to work alongside DOM-manipulating libraries. When you update the state arrays, WildflowerJS detects that the DOM has been modified externally and automatically reconciles the differences.

Example: Leaflet Maps

Leaflet is a popular mapping library. It manages its own DOM for markers and popups, but you can embed WildflowerJS components inside popups.

Setup

<!-- Include Leaflet -->
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.9.4/dist/leaflet.css">
<script src="https://unpkg.com/leaflet@1.9.4/dist/leaflet.js"></script>

<!-- Map container -->
<div data-component="map-demo">
    <div id="my-map" style="height: 400px;"></div>
</div>

JavaScript

// Popup component - will be initialized inside Leaflet popups
wildflower.component('location-popup', {
    state: {
        location: null
    },

    init() {
        // Get location ID from data attribute
        const locationId = parseInt(this.element.dataset.locationId);
        const store = wildflower.getStore('locations');
        this.location = store.getLocation(locationId);
    },

    remove() {
        const store = wildflower.getStore('locations');
        store.map.closePopup();
        store.removeLocation(this.location.id);
    }
});

// Main map component
wildflower.component('map-demo', {
    state: {
        map: null,
        markers: {}
    },

    init() {
        this.initMap();
        this.syncMarkers();
    },

    initMap() {
        this.map = L.map('my-map').setView([51.505, -0.09], 13);

        L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
            attribution: '© OpenStreetMap contributors'
        }).addTo(this.map);

        // Click to add locations
        this.map.on('click', (e) => {
            this.addLocation(e.latlng.lat, e.latlng.lng);
        });
    },

    syncMarkers() {
        const store = wildflower.getStore('locations');

        store.locations.forEach(loc => {
            const marker = L.marker([loc.lat, loc.lng]).addTo(this.map);

            // Popup contains a WildflowerJS component
            const popupHtml = `
                <div data-component="location-popup" data-location-id="${loc.id}">
                    <h4 data-bind="location.name"></h4>
                    <button data-action="remove">Remove</button>
                </div>
            `;

            marker.bindPopup(popupHtml);

            // KEY: Scan popup content when it opens
            marker.on('popupopen', () => {
                wildflower.scan('.leaflet-popup-content');
            });

            this.markers[loc.id] = marker;
        });
    }
});
Key Pattern: The marker.on('popupopen', () => wildflower.scan('.leaflet-popup-content')) initializes the WildflowerJS component inside the Leaflet popup after Leaflet renders it to the DOM.

Example: FullCalendar

FullCalendar is a full-featured calendar component. State changes in WildflowerJS can drive calendar events.

wildflower.component('calendar-demo', {
    state: {
        calendar: null,
        events: [
            { id: '1', title: 'Meeting', date: '2025-03-15' },
            { id: '2', title: 'Conference', date: '2025-03-18' }
        ]
    },

    init() {
        this.initCalendar();

        // Watch for event changes
        this.watch = {
            events: () => this.syncCalendar()
        };
    },

    initCalendar() {
        this.calendar = new FullCalendar.Calendar(
            document.getElementById('calendar'),
            {
                initialView: 'dayGridMonth',
                events: this.events,
                editable: true,

                // Drag event updates state
                eventDrop: (info) => {
                    this.updateEventDate(info.event.id, info.event.startStr);
                },

                // Click event triggers action
                eventClick: (info) => {
                    this.selectEvent(info.event.id);
                }
            }
        );

        this.calendar.render();
    },

    syncCalendar() {
        if (!this.calendar) return;

        // Remove all events and re-add from state
        this.calendar.removeAllEvents();
        this.events.forEach(evt => {
            this.calendar.addEvent(evt);
        });
    },

    updateEventDate(id, newDate) {
        this.events = this.events.map(e =>
            e.id === id ? { ...e, date: newDate } : e
        );
    },

    addEvent(title, date) {
        const newEvent = {
            id: String(Date.now()),
            title,
            date
        };
        this.events = [...this.events, newEvent];
    }
});

Example: Chart.js

Chart.js renders charts to a canvas element. When your data changes, update the chart.

wildflower.component('chart-demo', {
    state: {
        chart: null,
        data: [12, 19, 3, 5, 2, 3]
    },

    init() {
        this.initChart();
    },

    initChart() {
        const ctx = this.element.querySelector('#myChart').getContext('2d');

        this.chart = new Chart(ctx, {
            type: 'bar',
            data: {
                labels: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun'],
                datasets: [{
                    label: 'Sales',
                    data: this.data,
                    backgroundColor: 'rgba(75, 192, 192, 0.2)',
                    borderColor: 'rgba(75, 192, 192, 1)',
                    borderWidth: 1
                }]
            }
        });
    },

    updateData(newData) {
        this.data = newData;

        // Update chart directly
        this.chart.data.datasets[0].data = newData;
        this.chart.update();
    },

    destroy() {
        if (this.chart) {
            this.chart.destroy();
        }
    }
});

Using Stores for Shared State

When multiple components need to interact with a third-party library, use a store for centralized state:

// Centralized store for map state
wildflower.store('mapData', {
    state: {
        locations: [],
        map: null,
        nextId: 1
    },

    addLocation(lat, lng) {
        const location = {
            id: this.nextId++,
            lat,
            lng,
            name: `Location ${this.nextId - 1}`
        };
        this.locations = [...this.locations, location];
    },

    removeLocation(id) {
        this.locations = this.locations.filter(l => l.id !== id);
    },

    getLocation(id) {
        return this.locations.find(l => l.id === id);
    }
});

// Any component can access the store
wildflower.component('location-popup', {
    remove() {
        const store = wildflower.getStore('mapData');
        store.removeLocation(this.locationId);
    }
});
Benefit: Using stores eliminates fragile parent lookups like wildflower.getComponents('parent')[0]. Any component can access the store directly via wildflower.getStore('storeName').

Common Patterns Summary

Scenario Pattern
Component renders innerHTML with data-action this.rebindActions() after innerHTML update
Library renders content with WF components library.on('render', () => wildflower.scan(container))
Library needs element IDs after manipulation data-bind-attr="{ 'data-id': id }"
State change should update library Use watch or store.subscribe()
Multiple components share library state Use a store: wildflower.store()
Library creates/destroys DOM elements Scan after creation, no action needed on destruction

Libraries Known to Work Well

These libraries have been tested and work well with WildflowerJS:

  • SortableJS - Drag-and-drop sorting
  • Leaflet - Interactive maps
  • FullCalendar - Calendar components
  • Chart.js - Charts and graphs
  • Swiper - Touch sliders
  • Tippy.js - Tooltips and popovers
  • Flatpickr - Date pickers
  • Quill / TinyMCE - Rich text editors
  • Prism.js / Highlight.js - Code syntax highlighting
General Rule: If a library works with vanilla JavaScript by manipulating the DOM directly, it will work with WildflowerJS. No "wrapper" packages needed.

Troubleshooting

Components Not Initializing

If components inside library-rendered content aren't working:

  • Ensure you're calling wildflower.scan() after the library renders
  • Check the selector passed to scan - it should contain the new components
  • Verify the content actually has data-component attributes

State Not Syncing

If library state and WildflowerJS state get out of sync:

  • Use watchers or store subscriptions to react to state changes
  • Call the library's update/refresh method when state changes
  • Consider if the library should be the source of truth for certain data

Memory Leaks

To prevent memory leaks:

  • Destroy library instances in your component's destroy() method
  • Remove event listeners you've added
  • Clear any references stored in state