Repository navigation
Give dev builds stable declaration keys - #99
Draft
devagrawal09 wants to merge 34 commits into
Draft
devagrawal09 wants to merge 34 commits into
devagrawal09 wants to merge 34 commits into
Conversation
… its line. `e as T` is TypeScript's assertion: erased where the program runs, kept in the projection. A statement-bodied arrow that fails to parse is no longer re-read as a record, which blamed the handler's `let` with JS_LOCAL.
`source open := false` is already a boolean. Inside `{if open}` the read is `true`, and `open := false` was checked against that. The projection keeps the slot's type and checks the write against it.
The projection checks the import against the declaration, so a ref parameter or result is that type and not the accessor the implementation is written with. The compiled import is unchanged.
The read happens when the handler runs, and the branch may no longer hold. Snapshot into a local and narrow that. A check inside the handler still narrows its own snapshot.
…s an error. CSS-2 already scopes a stylesheet to its own view, so Row stayed unstyled with no warning. STYLE_SCOPE names the other component and the fix: its own style, or a class map.
…has none. n++ in a handler was reported as a generic parse error once the statement reading won outright. The expression reading's ASSIGNMENT hint is kept, and JS_LOCAL from re-reading the body as a record is not.
NoteList's stylesheet does not reach Row (CSS-2). .when and td were pruned; they belong on Row.
…eeps the value. `out := s as Status` evaluated to undefined: the oracle's expression walk had no case for `as`. The checker walks through it too, so the read is still the operand.
…rt type. The projection aliases the other declare namespace, not the sibling .ts.
The model marks that region shadowed by the inner one, so the map can draw it.
yumemi-thomas
added a commit
to yumemi-thomas/reactivescript
that referenced
this pull request
Nov 28, 2026
…s#99 (stable dev declaration keys) and solidjs#100 (the map and keyed dev hot replacement), both by devagrawal09, weighed idea by idea without waiting for them to land (DEV-6: 22 ideas ranked by value to a .rx developer against cost, each taken, adapted, deferred or rejected with its reason), and the ones taken written as rules on this branch's design: a development build is the browser's build under the dev server and differs from the production lowering by one thing, each source's creating call under `__rt.key(key, shape, …)` (DEV-1); a key is `<module>|<scope>|<name>[#n]` and its shape a hash of the declaration's AST, from both emitters, not the model (DEV-2); the entry is a hot boundary that re-runs the program under a transparent memo and carries each live source whose shape is unchanged, resetting (and saying so) an edited declaration, a key of several instances and a question with no answer, with no rename or move heuristics and no module kept alive across the swap (DEV-3); a development client hydrates the production server's output, nothing added taking a hydration id (DEV-4); production output unchanged (DEV-5). What waits on Solid #5089 (`openView`: travel, map-observed replacement) and the map itself are next steps (DEV-7). solidjs#98's rules this branch declined are not taken through either PR. spec-refs knows the DEV- prefix. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
yumemi-thomas
added a commit
to yumemi-thomas/reactivescript
that referenced
this pull request
Nov 28, 2026
…odule>|<scope>|<name>[#n]", "<shape>", () => __rt.source(…))`, the same around `__rt.question(…)`, the module relative to the project root and the shape eight hex digits of FNV-1a over the declaration's AST as canonical JSON (lines dropped, keys sorted), so an edit anywhere but the declaration itself changes no pair. compiler/src/devkeys.rs and ref/compile/devkeys.ts are the one walk (a module's declarations, each component's and fn's, every region of a view, in source order); the crate's copy of an instantiating fn whose result awaits keeps its declarations' keys. Asked for by `rxc app --dev [--root dir]`, `rxc compile --dev`, `rxc lower`'s `dev`, the Node-API `app(…, devRoot)` (a trailing argument after this branch's own) and `compileModules(set, { dev })`; without it nothing is computed and the output is byte for byte the production build's. `key` is the call alone in the server's runtime and the scenario runtime. Keys for dev declarations rooted at the project path are solidjs#99's (devagrawal09), re-implemented on sources only, with the shape beside them and outside the resolved model. `ref/crate.ts --lower --dev`: 840/840 programs lowered alike; compiler/test/dev.mjs (keys stable across rebuilds, unchanged by edits elsewhere, changed by the declaration's own, relative to the root; a production build has none; a development build differs only by the key wrappers); devkeys unit tests.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
yumemi-thomas
added a commit
to yumemi-thomas/reactivescript
that referenced
this pull request
Nov 28, 2026
…t — what the dev server serves (its server build is the production lowering) and the browser takes over with keys and the hot boundary. `RX_DEV=1` compiles the browser's modules as a development build and the server's as the production one, on both compilers (compile/lowered.ts), and the SSR runner hydrates under `hot`: 268 pass, 0 fail, with Solid's development build reporting no key miss — nothing added takes a hydration id, so solidjs#99's two exceptions (an ownerless root for boundary tracing, no observation memos while hydrating) have no counterpart here. `RX_DEV=1 npm run compiled`: 268 pass. The SSR runner also waits, a bounded while, for the flight a browser row's server-function request asks in its body, and for that row's frame (a flush does not wait for the response): solidjs#99's (devagrawal09). scripts/ci.mjs runs `crate --lower --dev`, compiler/test/dev.mjs, compiler/test/vite-hot.mjs, ref-compiled-dev and ref-ssr-dev. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
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.
Stacked on #98; review only the last 5 commits:
5b280a5Key dev declarations and expose their resolved model0c54e01Hydrate a dev client against non-dev server output81b0c7dPreserve module keys in non-bundled loweringad7d6deDo not allocate foreign observation memos during hydrationc700955Wait for server function frames in the SSR runnerWhat and why
Builds on the language fixes. Give dev sources, equations and actions stable keys rooted at the project path. The runtime uses those keys to name Solid nodes and attribute writes, action runs and boundary state. The resolved model adds
key, viewoutlineanddeadTyped; the Node-API addsapp(…, dev, root)andmodel().Vite adds an optional dev-client registration hook only if
@reactivescript/map/liveresolves from the project. No map implementation or hot replacement is included here. The runtime exports separate development and production builds. Dev boundary tracing uses an ownerless root so it does not consume a Solid hydration ID. The SSR runner also waits for RPC-backed frames instead of assuming that a Solid flush completes the HTTP round trip.Compatibility
The Node-API changes are additive. Production compiler output is unchanged from the language branch. Production runtime exports no longer include dev instrumentation or reference-only error stubs; applications can still inject an API.
Verification
rxc appagainst the language branchrxc appagainst upstream main, using the updated example treerxc appagainst upstream main, using the original example tree./apiprecedence change@solidjs/vite-plugin3.0.1; no__RX_orrx:RX_DEV=1runs.S-sf-1also passed in isolation in both modes.Questions for Ryan