Skip to content

feat: support JavaScript custom fields - #20494

Open
danharrin wants to merge 7 commits into
4.xfrom
feat/javascript-custom-fields
Open

danharrin wants to merge 7 commits into
4.xfrom
feat/javascript-custom-fields

Conversation

@danharrin

Copy link
Copy Markdown
Member

Description

Add JsField and the reusable HasJsRenderer concern for custom fields rendered by JavaScript modules. Filament and Livewire continue to own form state, validation, and HTTP responses. React, Vue, and Svelte are development-only dependencies for the test fixtures, not dependencies of the distributed Forms package.

Renderers load lazily by URL and receive typed props and schema utilities. The integration supports two-way state binding, PHP-driven props, deferred/live/blur/debounced updates, cleanup, and remounting. Exposed schema methods are available as named utilities in both Alpine and JavaScript fields; server-side attribute checks remain enforced.

Document application and plugin implementations, including framework examples, TypeScript, Vite/esbuild bundling, asset publication, and cross-links to the existing custom-field and plugin guides.

Visual changes

Custom JavaScript fields use the existing field wrapper, including labels, helper text, and validation messages. React, Vue, and Svelte browser fixtures render equivalent HTML and cover light and dark accessibility checks.

Liberated schemas now retain their Alpine scope in a display: contents wrapper. Custom CSS that relies on their former direct-child DOM structure may need adjustment.

Functional changes

  • Code style has been fixed by running the composer cs command.
  • Changes have been tested to not break existing functionality.
  • Documentation is up-to-date.

Co-authored-by: Amp <amp@ampcode.com>
@danharrin danharrin added this to the v4 milestone Sep 11, 2026
@danharrin danharrin added the enhancement New feature or request label Sep 11, 2026
danharrin and others added 6 commits September 12, 2026 11:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant