Repository navigation
feat(react): run spec actions and write state from RenderSpec - #1605
Merged
Merged
Conversation
RenderSpec views can now act. A spec names actions in an element's `on` bindings, and a view's `emit` runs them through `handlers` the application supplies, with resolved params (in the view's own repeat row), `confirm`, and `onSuccess`/`onError` follow-ups. A spec naming an action the application did not supply does nothing. A writable `store` (such as `createRenderState`) replaces read-only `state`: RenderSpec reads its snapshot, and views get `set` so bound inputs write back. `onEvent` reports handler, stateChange and result events. Payloads and written values must be plain data, `navigate` follows only http(s) or relative addresses, readiness fallbacks get no emit, and late async work is dropped after unmount. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
blove
enabled auto-merge
November 15, 2026 17:49
The docs catalog pins each guide's frontmatter description, and the React render Events guide now describes actions, the store and onEvent. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Nov 16, 2026
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.
Summary
React
RenderSpeccould only display a spec. Angular's<render-spec>takeshandlers, a writablestoreand aneventsoutput. This closes that gap, and everything stays opt-in.Actions from
onbindingsemit(event, payload?). It runs the element'son[event]bindings, one or several in order, through thehandlersthe application passes toRenderSpec.paramsresolve the same way element props do, inside the view's own repeat row. A view's payload is merged over them and wins on key collisions.confirmasks throughwindow.confirmand skips the action when the user declines.onSuccesscansetstore values, run anotheraction, ornavigate. Navigation only goes to http, https or relative addresses.onErrorcansetstore values ('$error.message'becomes the error's message) or run anotheraction. WithoutonError, a thrown error reaches the view.Writable state
store(structurallycreateRenderState's owner) is an alternative to read-onlystate. Passing both throws, and the types reject it.RenderSpecreads the store throughuseSyncExternalStore, and views getset(path, value). Bound inputs write to the path in theirbindings.set, so the tree stays read-only, as it is today.Observing
onEventreceives the same event shapes as Angular:handler(with the action's result, or what its promise resolved to),stateChange(path, value and the whole snapshot) andresult(a view'sresult(value)plus its element key).Boundaries
TypeError. A view callsevent.preventDefault()itself.emit,setorresult.watcheffects, and thepreventDefaultbinding field.Docs and parity
react-doc-examples.Test plan
nx test react: 77 files, 1,353 tests. The newinteraction.spec.tsxhas 18 tests.stateChangeeach fails a test.react:type-tests, lint (0 errors), and the React builddocs-content-rulesandreact-doc-examplesverify-packages,verify-render-state,verify-a2ui-surfacesandverify-markdownpass. Node specs pass: packages 102, render-state 13, readiness 23, boundaries 544, inventory 37.verify-react-readinesspasses. Locally it neededTMPDIRset to the real path, because Vite fails on the macOS/varsymlink.cockpit-render-state-management-reacte2e passes 8 of 8.🤖 Generated with Claude Code