Harden & extend via across the full surface (adversarial-review pass)#104
Merged
Conversation
Outcome of a multi-area adversarial review (UX/datastar, Go-systems, and
peer-framework lenses) covering h, signals, on, state, sessions, SSE, forms,
middleware, plugins, rendering, the vt harness, config/bootstrap, and
push/broadcast. Every change lands with tests; the suite stays green under
-race. Behavior/security-gate/concurrency changes that need a maintainer
decision are deliberately NOT included here — they are catalogued in
critique-council.md with precise fixes, grouped by theme.
Notable fixes:
- on.Key now filters via an `evt.key===` expression guard — datastar v1 has no
keyboard-key modifier, so `on.Key("Enter")` was firing on every keystroke.
- Multipart text fields are no longer JSON-coerced; values stay strings so
decodeScalarInto coerces per the target type ("007" survives, a Signal[string]
can hold "true").
- via.Files binds every part of a multi-file upload (was dropping all but first).
- Composite SignalSlice/SignalMap now decode inbound (replace, not merge).
- Mount panics on duplicate signal wire keys and duplicate app-signal keys;
New panics on negative option values.
- Capacity gate runs before OnInit; session lastAccess is kept warm by the SSE
heartbeat; SSE responses set X-Accel-Buffering: no; write deadlines re-arm
per write.
New API:
- h: Aria + Alt/Width/Height/Target/Action/Method/AutoComplete/TabIndex/
ColSpan/RowSpan/Pattern/MinLength/MaxLength, AttrNum[T] + numeric siblings.
- signals: Signal.Text() is now an attachable attribute (+ TextSpan()),
ShowUnless, Class; via.Computed/via.Effect; via.Local client-only signals.
- on: Once/Outside/Window/Confirm/Indicator.
- sessions/config: WithSessionCookieName, App.Run() error.
- middleware: via.RouteFrom(r).
- push: App.BroadcastToast.
- vt: TabIDFromHTML; SSE() is leak-safe via t.Cleanup; WithSignal warns on
`_`-prefixed local signals.
Plus godoc/doc corrections across the public API and the docs site, and the
critique-council.md review ledger (applied fixes + the signoff backlog).
CI lint flagged 4 issues in the new tests: 3 missing t.Parallel() calls (paralleltest) and one unchecked ln.Close (errcheck). No production change.
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.
What
A multi-area adversarial review pass (UX/datastar, Go-systems, and peer-framework lenses) across the entire framework surface —
h, signals/reactivity,on, state, sessions/CSRF, SSE, forms, middleware, plugins, rendering, thevtharness, config/bootstrap, and push/broadcast.Every change is test-driven; the suite stays green under
-race. Behavior/security-gate/concurrency changes that need a maintainer decision are deliberately not in this PR — they're catalogued incritique-council.mdwith precise fixes, grouped by theme, with a recommended action order.Notable bug fixes
on.Keynow filters via anevt.key===expression guard — datastar v1 has no keyboard-key modifier, soon.Key("Enter")was firing the action on every keystroke.decodeScalarIntocoerces per the target type ("007"survives; aSignal[string]can hold"true").via.Filesbinds every part of a multi-file upload (was silently dropping all but the first).SignalSlice/SignalMapnow decode inbound values (full replace, not merge).Newpanics on negative option values.OnInit; sessionlastAccesskept warm by the SSE heartbeat; SSE setsX-Accel-Buffering: no; write deadlines re-arm per write.New API
Aria,Alt/Width/Height/Target/Action/Method/AutoComplete/TabIndex/ColSpan/RowSpan/Pattern/MinLength/MaxLength,AttrNum[T]+ numeric siblings.Signal.Text()is now an attachable attribute (+TextSpan()),ShowUnless,Class;via.Computed/via.Effect;via.Localclient-only signals.Once/Outside/Window/Confirm/Indicator.WithSessionCookieName,App.Run() error.via.RouteFrom(r).App.BroadcastToast.TabIDFromHTML;SSE()leak-safe viat.Cleanup;WithSignalwarns on_-prefixed local signals.Plus godoc/doc corrections across the public API and the docs site.
Not included (see
critique-council.mdsignoff backlog)Grouped by theme: concurrency-contract (Signal/resync race), graceful-deploy (SSE re-arm, shutdown deadline), security (sid-on-backplane, session-403 recovery,
__Host-), plugin-CSP nonce, requireAuth-redirect-on-action/SSE, scale/backpressure, and the larger DX roadmap (Region rendering, per-page<title>, formErrors, cluster/topic broadcast).