feat(core): support formaction=${action} on submitters (#1207) - #1210
Open
vivek7405 wants to merge 6 commits into
Open
feat(core): support formaction=${action} on submitters (#1207)#1210vivek7405 wants to merge 6 commits into
vivek7405 wants to merge 6 commits into
Conversation
…) on submitters (#1207)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #1207
Overview
This PR adds support for
formaction=${action}on submitters (<button>and<input type="submit">) inside bound forms (<form action=${formAction}>).Key Changes
Core Runtime (
form-action.js,render-server.js,render-client.js):formaction=${action}on<button>and<input>submitters.nameattribute,input type="image",formmethod="get",formenctype="text/plain", or submitter outside a bound<form action=${...}>.renderTemplate&streamTemplate), deferred submitter validation to tag-end close (>) to inspect author-written attributes followingformaction=${action}.<button name="__webjs_action" value="<hash>/<fn>">directly into rendered HTML.buildFormActionRecord,reconcileFormActions,reconcileSubmitterAction) for CSR.Server Action Dispatch (
form-dispatch.js):formData.getAll(FORM_ACTION_FIELD)and selectedactions[actions.length - 1], matching standard WHATWG DOM order last-wins submitter precedence with JS OFF.Auditor (
check.js):form-action-not-a-get-actionto check submitters (<button>and<input>).Testing & Docs:
form-action-binding.test.js,form-action-binding-client.test.js,form-action-attr-guard.test.js,form-action-attr-guard-client.test.js), server (form-dispatch.test.js), and Bun parity (test/bun/form-action-submitter-parity.test.mjs,test/bun/form-action-guard.mjs).AGENTS.md,.agents/skills/webjs/references/, andwebsite/app/docs/{server-actions,progressive-enhancement,migrating-from-nextjs,troubleshooting}/page.ts.