Advanced

Migrating from Formie Plugin

This page is for projects moving from the JavaScript bundled with older Formie plugin releases to @verbb/formie-browser. The package is new for Formie 4, but it still includes a compatibility bridge so older browser integrations can move over in stages instead of rewriting every listener at once.

Use the bridge only as a migration step. The long-term target is Formie 4's canonical formie:* event surface.

What changed

The main browser changes from the old bundled Formie plugin JavaScript are:

  • lifecycle and submit hooks now use canonical formie:* DOM events
  • validator lifecycle hooks now use canonical formie:validator:* events
  • the public browser API is now either the formie() helper or a client created with createFormieClient()

If your old code only listens for legacy event names, turn on compatibility while you migrate each listener to the new event surface.

Turn on compatibility

Managed or rendered forms

If you are mounting from rendered HTML, enable compatibility on the root:

html
<form data-formie data-formie-form data-formie-compatibility="true">
  ...
</form>

Your own bundle

If you mount with the package directly, pass compatibility in the mount options:

ts
import { createFormieClient } from '@verbb/formie-browser';

const formie = createFormieClient();
const root = document.querySelector('[data-formie-form]');

if (root instanceof HTMLElement) {
  await formie.mount(root, {
    mode: 'server-rendered',
    compatibility: true,
  });
}

You can also opt into only part of the bridge:

ts
await formie.mount(root, {
  mode: 'server-rendered',
  compatibility: {
    legacyDomEvents: true,
    legacyValidatorEvents: false,
  },
});

Event mapping

These legacy DOM events can be bridged during migration:

Legacy eventCanonical eventNotes
onFormieLoadedformie:mount:afterApproximate mapping
onFormieInitformie:mount:afterApproximate mapping
onFormieReadyformie:mount:afterSafe mapping
onAfterFormieSubmitformie:submit:resultSafe mapping
onFormieSubmitErrorformie:submit:resultSafe mapping
onFormiePageToggleformie:page:navigate:afterSafe mapping
onBeforeFormieSubmitformie:submit:beforeApproximate mapping
onFormieValidateformie:stage:validate:beforeApproximate mapping
onAfterFormieValidateformie:stage:validate:afterApproximate mapping
onFormieSubmitformie:submit:afterApproximate mapping

These validator events can be bridged too:

Legacy eventCanonical event
formieValidatorInitializedformie:validator:ready
formieValidatorDestroyedformie:validator:destroy
formieValidatorShowErrorformie:validator:show-error
formieValidatorClearErrorformie:validator:clear-error

Approximate mappings exist to keep older integrations alive, not to guarantee identical timing in every edge case.

  1. Turn on compatibility.
  2. Replace old event listeners with the canonical formie:* or formie:validator:* names.
  3. Test any submit-flow logic that relied on older event timing.
  4. Remove compatibility once the old listeners are gone.
Last updated: May 6, 2026, 3:46 PM