Skip to content

Add the ReactiveScript map and dev hot replacement - #100

Draft
devagrawal09 wants to merge 37 commits into
solidjs:mainfrom
devagrawal09:upstream/tooling
Draft

devagrawal09 wants to merge 37 commits into
solidjs:mainfrom
devagrawal09:upstream/tooling

Conversation

@devagrawal09

Copy link
Copy Markdown
Collaborator

Stacked on #99; review only the last 3 commits:

  • e30e928 Add the ReactiveScript map and keyed dev replacement
  • 7214d9d Rebuild the map page from the split compiler and runtime
  • ddc27bd Check travel denial against stock Solid

What and why

Builds on dev keys. @reactivescript/map shows the static program and a live view of changes. It includes an RX app for the map page, read-only MCP queries, layout and diffing, travel, and a fake host and conformance suite. The compiler plans keyed hot replacement; the map can observe it without owning it.

Travel and map-observed HMR state carry-over require openView from solidjs/solid#5089. See also solidjs/solid#5198 and the openView discussion. On stock Solid 2.0, travel reports unsupported; map-observed HMR reports that keyed replacement is unsupported and falls back to a full reload. Live inspection still works where dev attribution is available. Exact list travel requires the additional view fixes listed in the README.

Compatibility

No intended changes to production lowering. The live map and HMR are dev-only. The view and some attribution details depend on experimental Solid APIs and are capability-checked.

Verification

Check Result
Interpreter, Solid oracle, compiled scenarios Pass
TypeScript projection scenarios 202 pass
Rust tests, Node-API, runtime Pass
Checker and projection parity 414/414 and 235/235
Lowering parity 209/239 in each mode; strict runner reports the 30 known mismatches
SSR/hydration 144 pass, 0 fail, 7 skipped in both standard and RX_DEV=1 runs. S-sf-1 also passed in isolation in both modes.
Map package without SOLID_VIEW Pass with RXC set; real-host view tests skipped
Map package with SOLID_VIEW Pass, including DOM travel and HMR
Stock Solid browser smoke test Travel returns unsupported and the app still responds

Questions for Ryan

  • Should the map wait for Solid’s view and attribution APIs to stabilize, or ship sooner with travel labeled experimental?
  • Which attribution details should be public: flight starts, disposal, store paths, or accessor identity?
  • Should the generated page be checked in or built only at package time?

… 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.
@socket-security

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addednpm/​@​reactivescript/​compiler@​0.3.17110010091100

View full report

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
…keeps its state — every save reloaded the page, losing what it held and asking every question again. The front end makes a development build's entry a hot boundary (`export default hot(main, import.meta.hot)`, `import.meta.hot.accept()`, the source map's lines kept): one function for every version of the module, mounting the program under a `transparent` memo (no hydration id of its own) that reads which version is current. A replacement re-runs the whole program in every app it is mounted in, the app's module instances made inside it dropped first (a host-rooted library instance is kept); while it runs, each source created under a key with an unchanged shape starts from the value the live source had (a store's as Solid's snapshot), and an atomic question shows its carried answer while it asks again. An edited declaration, a key with several live instances (no instance identity survives a re-run; pairing by order would hand one row's state to another) and a question with no answer start fresh, and the console says so once per replacement; a key that is gone is not reported. A program that fails as it runs (its memo fails, which Solid hands to readers rather than to flush) reloads the page. The runtime's development half is ref/compile/rt-dev.ts (`key`, the carry, `hot`), behind Solid's `DEV`; `hot` is its own export. Keyed hot replacement planned from the compiler is solidjs#100's (devagrawal09), re-implemented without its text planner, rename heuristics, persistent module owners or deferred carry, and without Solid #5089. runtime/test.mjs *hot* (7 checks, no DOM: carry, reset, two instances, a question, a failure, the production build); compiler/test/vite-hot.mjs, a real dev server in Chromium (13 checks: view, handler and dependency edits keep state with no reload; a declaration's edit resets it and is named; a broken edit keeps the page and the next replaces it; a reload starts fresh; the production build has no key and no boundary).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant