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.

Advanced Forms

WildflowerJS supports complex form patterns including dynamic fields, form arrays, intrinsic handling with data-model-trim and data-model-number, and input modifiers.

Form Arrays and Dynamic Fields

Handle variable-length form data with complex nested arrays and dynamic field management:

<div data-component="form-arrays">
    <form data-action="handleSubmit">
        <div class="d-flex justify-content-between align-items-center mb-3">
            <h6 class="mb-0">Contacts <span class="badge bg-primary" data-bind="contacts.length"></span></h6>
            <button type="button" data-action="addContact" class="btn btn-primary btn-sm">Add Contact</button>
        </div>

        <div data-list="contacts">
            <template>
                <div class="mb-3 p-3 border rounded">
                    <div class="d-flex gap-2 mb-2">
                        <input type="text" data-model="name" class="form-control" placeholder="Name">
                        <input type="email" data-model="email" class="form-control" placeholder="Email">
                        <button type="button" data-action="removeContact" class="btn btn-danger btn-sm">&times;</button>
                    </div>
                </div>
            </template>
        </div>

        <div data-show="contacts.length === 0" class="text-muted text-center p-3">
            No contacts yet. Click "Add Contact" to start.
        </div>

        <div data-show="contacts.length > 0" class="mt-3">
            <button type="submit" class="btn btn-primary me-2">Submit</button>
            <button type="button" data-action="resetForm" class="btn btn-secondary">Reset</button>
        </div>
    </form>

    <div class="mt-3" data-show="result">
        <div class="alert alert-success">
            Submitted: <code data-bind="result"></code>
        </div>
    </div>
</div>
<option value="">Select type...</option> <option value="web">Web Application</option> <option value="mobile">Mobile App</option> <option value="desktop">Desktop Software</option> <option value="api">API/Backend</option> <option value="game">Game Development</option> </select> </div> </div> <div class="mb-3"> <label class="form-label">Project Description:</label> <textarea data-model="form.description" class="form-control" rows="3" placeholder="Describe your project goals and requirements..."></textarea> </div> </div> <div class="mb-4"> <div class="d-flex justify-content-between align-items-center mb-3"> <h5>👥 Team Members <span class="badge bg-primary"><span data-bind="form.teamMembers.length"></span></span></h5> <div> <button type="button" data-action="addMember" class="btn btn-primary btn-sm me-2"> ➕ Add Member </button> <button type="button" data-action="addSampleTeam" class="btn btn-info btn-sm"> 🎯 Sample Team </button> </div> </div> <div data-list="form.teamMembers"> <template> <div class="card mb-3 team-member-card"> <div class="card-header"> <div class="d-flex justify-content-between align-items-center"> <h6 class="mb-0"> <span class="badge bg-secondary me-2">#<span data-bind="number"></span></span> <span data-bind="name || 'New Team Member'"></span> </h6> <div> <button type="button" data-action="duplicateMember" class="btn btn-secondary btn-sm me-1" title="Duplicate this member"> 📋 </button> <button type="button" data-action="removeMember" class="btn btn-danger btn-sm" title="Remove this member"> 🗑️ </button> </div> </div> </div> <div class="card-body"> <div class="row"> <div class="col-md-6 mb-3"> <label class="form-label">Full Name: *</label> <input type="text" data-model="name" class="form-control" placeholder="Enter full name"> </div> <div class="col-md-6 mb-3"> <label class="form-label">Email Address: *</label> <input type="email" data-model="email" class="form-control" placeholder="name@example.com"> </div> </div> <div class="row"> <div class="col-md-4 mb-3"> <label class="form-label">Primary Role: *</label> <select data-model="role" class="form-select"> <option value="">Select role...</option> <option value="frontend">Frontend Developer</option> <option value="backend">Backend Developer</option> <option value="fullstack">Full Stack Developer</option> <option value="designer">UI/UX Designer</option> <option value="manager">Project Manager</option> <option value="qa">QA Engineer</option> <option value="devops">DevOps Engineer</option> <option value="analyst">Business Analyst</option> </select> </div> <div class="col-md-4 mb-3"> <label class="form-label">Experience Level:</label> <select data-model="level" class="form-select"> <option value="">Select level...</option> <option value="junior">Junior (0-2 years)</option> <option value="mid">Mid-level (3-5 years)</option> <option value="senior">Senior (6-10 years)</option> <option value="lead">Lead (10+ years)</option> </select> </div> <div class="col-md-4 mb-3"> <label class="form-label">Hourly Rate ($):</label> <input type="number" data-model="hourlyRate" class="form-control" min="0" max="500" step="5" placeholder="50"> </div> </div> <div class="mb-3"> <label class="form-label">Skills & Technologies:</label> <div class="input-group mb-2"> <input type="text" data-model="newSkill" class="form-control" placeholder="Add a skill or technology..." data-action="keydown:handleSkillKeydown"> <button type="button" data-action="addSkill" class="btn btn-primary"> Add Skill </button> </div> <div class="skills-container" data-show="skills.length > 0"> <div data-list="skills"> <template> <span class="badge bg-info me-1 mb-1 skill-badge"> <span data-bind="$item"></span> <button type="button" data-action="removeSkill" class="btn-close btn-close-white ms-1" style="font-size: 0.6em;" title="Remove skill"></button> </span> </template> </div> </div> <div data-show="skills.length === 0" class="text-muted small"> No skills added yet. Type a skill above and click "Add Skill". </div> </div> <div class="row"> <div class="col-md-6 mb-3"> <label class="form-label">Availability:</label> <select data-model="availability" class="form-select"> <option value="">Select availability...</option> <option value="full-time">Full-time (40h/week)</option> <option value="part-time">Part-time (20h/week)</option> <option value="contract">Contract/Project-based</option> <option value="consulting">Consulting (As needed)</option> </select> </div> <div class="col-md-6 mb-3"> <label class="form-label">Start Date:</label> <input type="date" data-model="startDate" class="form-control"> </div> </div> </div> </div> </template> </div> <div data-show="form.teamMembers.length === 0" class="alert alert-info text-center"> <h6>👥 No team members added yet</h6> <p class="mb-2">Every great project starts with a great team. Click "Add Member" to get started!</p> <button type="button" data-action="addMember" class="btn btn-primary"> Add First Team Member </button> </div> </div> <!-- Team Summary --> <div class="mb-4" data-show="form.teamMembers.length > 0"> <h6>Team Summary</h6> <div class="row text-center"> <div class="col-md-3 mb-2"> <div class="card"> <div class="card-body p-2"> <div class="h5 mb-1" data-bind="form.teamMembers.length"></div> <small class="text-muted">Team Members</small> </div> </div> </div> <div class="col-md-3 mb-2"> <div class="card"> <div class="card-body p-2"> <div class="h5 mb-1" data-bind="totalSkills"></div> <small class="text-muted">Total Skills</small> </div> </div> </div> <div class="col-md-3 mb-2"> <div class="card"> <div class="card-body p-2"> <div class="h5 mb-1">$<span data-bind="estimatedCost"></span></div> <small class="text-muted">Est. Weekly Cost</small> </div> </div> </div> <div class="col-md-3 mb-2"> <div class="card"> <div class="card-body p-2"> <div class="h5 mb-1" data-bind="completionRate"></div>% <small class="text-muted">Profile Complete</small> </div> </div> </div> </div> </div> <div class="form-actions"> <button type="submit" class="btn btn-primary me-2" data-bind-attr="{ disabled: form.teamMembers.length === 0 }"> 🚀 Submit Project </button> <button type="button" data-action="resetForm" class="btn btn-secondary me-2"> 🔄 Reset Form </button> <button type="button" data-action="exportTeam" class="btn btn-info"> 📊 Export Team Data </button> </div> </form> <div class="mt-4" data-show="submissionResult"> <div class="alert alert-success"> <h6>✅ Project Team Submitted Successfully!</h6> <p>Your project "<strong><span data-bind="form.projectName"></span></strong>" has been submitted with <strong><span data-bind="form.teamMembers.length"></span></strong> team member(s).</p> <details> <summary>View submitted data</summary> <pre class="mt-2"><code data-bind="submissionResult"></code></pre> </details> </div> </div> <div class="mt-3" data-show="exportData"> <div class="alert alert-info"> <h6>📊 Team Export Data</h6> <p>Copy this data to use in other systems:</p> <textarea id="export-textarea" class="form-control" rows="10" readonly data-bind="exportData"></textarea> <button type="button" data-action="copyExportData" class="btn btn-primary btn-sm mt-2"> Copy to Clipboard </button> </div> </div> </div> <style> .team-member-card { transition: all 0.3s ease; border-left: 4px solid #007bff; } .team-member-card:hover { box-shadow: 0 4px 8px rgba(0,0,0,0.1); transform: translateY(-2px); } .skills-container { max-height: 100px; overflow-y: auto; padding: 0.5rem; background: #f8f9fa; border-radius: 0.25rem; } .skill-badge { transition: all 0.2s ease; } .skill-badge:hover { transform: scale(1.05); } .form-actions { background: #f8f9fa; padding: 1rem; border-radius: 0.375rem; border: 1px solid #dee2e6; } </style>
wildflower.component('form-arrays', {
    state: {
        contacts: [],
        result: '',
        nextId: 1
    },

    addContact() {
        this.contacts.push({ id: this.nextId++, name: '', email: '' })
    },

    removeContact(e, el, detail) {
        this.contacts.splice(detail.index, 1)
    },

    handleSubmit(event) {
        event.preventDefault()
        this.result = JSON.stringify(this.contacts.map(c => ({ name: c.name, email: c.email })))
    },

    resetForm() {
        this.contacts = []
        this.result = ''
    }
})
Live Preview

Intrinsic Form Handling

WildflowerJS provides built-in form handling with automatic synchronization, debouncing, and advanced performance optimizations:

🚀 Automatic Features:
  • Form data is synchronized to state before action methods are called
  • Built-in debouncing prevents excessive updates during typing
  • Automatic form validation when data-validate is present
  • No need for explicit event.preventDefault() calls
  • Advanced event modifiers for fine-grained control
  • Automatic cleanup and memory management

Input Modifiers

Add attributes to data-model inputs to control how values are processed:

<div data-component="modifier-demo">
    <div class="mb-3">
        <label class="form-label">Without modifiers:</label>
        <input type="text" data-model="raw" class="form-control"
               placeholder="Try '  hello  ' with spaces">
        <div class="mt-1 p-2 border rounded bg-light">
            Stored: "<strong data-bind="raw"></strong>"
            &mdash; length: <strong data-bind="rawLen"></strong>
        </div>
    </div>

    <div class="mb-3">
        <label class="form-label">With data-model-trim:</label>
        <input type="text" data-model="trimmed" data-model-trim
               class="form-control" placeholder="Try '  hello  ' with spaces">
        <div class="mt-1 p-2 border rounded bg-light">
            Stored: "<strong data-bind="trimmed"></strong>"
            &mdash; length: <strong data-bind="trimLen"></strong>
        </div>
    </div>

    <div class="mb-3">
        <label class="form-label">With data-model-number:</label>
        <input type="number" data-model="price" data-model-number
               class="form-control" placeholder="Enter a number">
        <div class="mt-1 p-2 border rounded bg-light">
            typeof: <strong data-bind="priceType"></strong>
            &mdash; doubled: <strong data-bind="doubled"></strong>
        </div>
    </div>
</div>
wildflower.component('modifier-demo', {
    state: { raw: '', trimmed: '', price: 0 },
    computed: {
        rawLen() { return this.raw.length },
        trimLen() { return this.trimmed.length },
        priceType() { return typeof this.price },
        doubled() { return this.price * 2 }
    }
})
Live Preview

To reduce expensive work during fast typing, debounce the action handler rather than the state update:

<!-- State updates immediately; onSearch runs 300ms after the last keystroke -->
<input data-model="search" data-action="input:onSearch" data-event-debounce="300">

<!-- Model modifiers still apply to state sync -->
<input data-model="query" data-model-trim data-action="input:onSearch" data-event-debounce="500">

Automatic Form Submission

When a form has data-action, WildflowerJS automatically prevents the default submit and syncs all data-model fields to state before calling your method:

<form data-action="handleSubmit">
    <input data-model="email" type="email">
    <input data-model="message" data-model-trim>
    <button type="submit">Send</button>
</form>
handleSubmit() {
    // No event.preventDefault() needed
    // this.email and this.message are already synced
    console.log('Sending:', this.email, this.message)
}

Advanced Event Modifiers

WildflowerJS provides additional event modifiers for complex interactions:

<div data-component="modal-demo">
    <h3>Advanced Event Modifiers</h3>
    
    <!-- Self-only events: Only trigger when clicking the element itself -->
    <div data-action="handleContainerClick" data-event-self 
         style="padding: 20px; border: 2px solid #007bff; background: #f8f9fa;">
        <h5>Self-Only Container (data-event-self)</h5>
        <p>Click this container background (not the text) to trigger the action.</p>
        <button data-action="handleButtonClick">Button inside container</button>
        <p>Clicking the button above won't trigger the container's action.</p>
    </div>
    
    <div class="mt-3">
        <button data-action="openModal">Open Modal (with outside click)</button>
    </div>
    
    <!-- Modal that closes when clicking outside -->
    <div data-show="modalOpen" 
         data-action="closeModal" 
         data-event-outside
         style="position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); z-index: 1000; display: flex; align-items: center; justify-content: center;">
        <div style="background: white; padding: 30px; border-radius: 8px; max-width: 400px; margin: 20px;">
            <p>Click anywhere outside this modal to close it, or use the button below.</p>
            <button data-action="closeModal" class="btn btn-secondary">Close Modal</button>
        </div>
    </div>
    
    <div class="mt-3">
        <p><strong>Last Action:</strong> <span data-bind="lastAction"></span></p>
    </div>
</div>

Component Definition

wildflower.component('modal-demo', {
    state: {
        modalOpen: false,
        lastAction: 'None'
    },
    
    handleContainerClick() {
        this.lastAction = 'Container clicked (self-only)'
    },
    
    handleButtonClick() {
        this.lastAction = 'Button inside container clicked'
    },
    
    openModal() {
        this.modalOpen = true
        this.lastAction = 'Modal opened'
    },
    
    closeModal() {
        this.modalOpen = false
        this.lastAction = 'Modal closed (outside click or button)'
    }
})

Event Modifier Reference

Modifier Purpose Example Use Case
data-event-self Only trigger when event target is the element itself Prevent child element clicks from bubbling
data-event-outside Trigger when clicking outside the element Close modals, dropdowns, and menus
data-event-stop Call event.stopPropagation() Prevent event bubbling to parent elements
data-event-prevent Call event.preventDefault() Prevent default browser behavior
data-event-once Event listener triggers only once One-time initialization actions
data-event-passive Use passive event listener Better performance for scroll/touch events
data-event-capture Use capture phase event listener Handle events during capture phase

Early Submit Edge Case

This is narrow but worth knowing if you build forms that depend on event.preventDefault() to stop a submit.

Action handlers fire on click immediately, even if the component's init() hook hasn't completed yet. The framework queues those calls and replays them after init. For typical handlers this is invisible. For form submits it has one wrinkle: the captured event object is the original DOM event, and by the time the queued call replays, the browser has already processed the event's default action. Calling event.preventDefault() at that point is a no-op.

In practice this affects:

  • A user submitting a form during the brief window between mount and init() completing.
  • Components that subscribe to slow stores (init() waits for store readiness, widening the window).
  • Tests that synchronously dispatch a submit immediately after _scanForComponents().

Workaround if your form handler must reliably prevent submission: defer the prevent into init() using a one-shot guard, or use data-event-prevent on the form element itself (the framework intercepts the submit before user-code timing matters):

<!-- ✅ Right: framework prevents the default before any handler runs -->
<form data-action="submit" data-event-prevent>
    ...
</form>

Most apps will never hit this; the window between mount and init is sub-frame for components without store subscriptions, and natural form submits during that window are rare. But it's worth knowing the mechanism if you ever see "form submitted even though I called preventDefault."

Form Best Practices

✅ Do
  • Use data-model for two-way binding
  • Use simple data-action="methodName" on forms
  • Leverage built-in debouncing with data-event-debounce on action handlers
  • Add data-validate for automatic validation
  • Use appropriate input types with validation attributes
  • Trust framework's intrinsic form handling
❌ Don't
  • Use overcomplicated data-action="submit:method" syntax
  • Manually call event.preventDefault() in form actions
  • Validate on every keystroke without debouncing
  • Show errors before user finishes typing
  • Forget to sanitize form data before submission
  • Use generic error messages