feat(forms): Datastar transport for the SSR form #36
No reviewers
Labels
No labels
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
iterative-works/support!36
Loading…
Reference in a new issue
No description provided.
Delete branch "forms-datastar"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What
Adds a Datastar variant of the SSR form interpreter, at parity with the HTMX one:
FormTransportseam (forms/jvm): the form-level wiring attributes (change-triggered re-render, submission) move behind a small trait.FormTransport.htmxrenders byte-identical attributes to the previous inline ones; the committed-choice re-render selector list is shared by both transports.forms-datastarmodule (published asiw-support-forms-datastar):DatastarFormTransportemitsdata-on:submitand a selector-filtereddata-on:change, both posting via@post('…', {contentType: 'form'}). Depends onscalatags-datastar/scalatags-datastar-sse0.1.0-SNAPSHOT resolved from the code.iterative.works Forgejo registry.datastarFormscenario: shares the extractedInquiryFormLoopstate machine with thessrFormscenario — parity by construction; only rendering differs. Actions answerdatastar-patch-elementsSSE morphing the form by id, with a plain-HTML no-JS fallback.Why no endpoint/header discrimination
Datastar v1.0.2's
{contentType: 'form'}respectsnovalidateand appends the submitter's name/value like a native submission (verified infetch.tssource), so the existing__submit/named-button protocol works unchanged. The whole variant surface is two form-level attributes plus SSE responses.Proof
datastar-form.featuremirrorsssr-form.featureword for word — 7 browser scenarios, all green on first run (30 e2e scenarios total), including typed text surviving a change-triggered morph.datastar-requestheader branch, and the shared-loop outcome.__.compileclean with zero warnings; full__.testgreen.Notes
🤖 Generated with Claude Code