Skip to content

Prototype: ReactiveScript and the Solid ecosystem (router 2.0, TanStack, SSR) on top of upstream PR #69 - #1

Draft
yumemi-thomas wants to merge 246 commits into
pr69from
claude/magical-bell-pfhb1w
Draft

yumemi-thomas wants to merge 246 commits into
pr69from
claude/magical-bell-pfhb1w

Conversation

@yumemi-thomas

@yumemi-thomas yumemi-thomas commented Nov 19, 2026 •

Copy link
Copy Markdown
Owner

Prototype, for exploration, on top of upstream PR solidjs#69. The base branch pr69 is that PR's branch (Brenley Dueck's commit a54830a, unchanged) merged with this fork's main, so this diff shows only the prototype. Nothing here is proposed upstream yet; spec rules it adds are marked proposed, and the design choices taken while prototyping are recorded with their reasons in spec/09, Decisions §9.

Every proposal stays at the JS boundary: a declaration word, a check on declarations, or a runtime hook for the host. Nothing adds an unchecked escape inside .rx (CN-5). Each language change is in both ref/ and the crate, which agree.

Router (@solidjs/router 2.0.0)

  • Hooks need the router (MO-12): export context router, uses(router) on hooks, provides(router) on createRouter or a provider; provider order checked. S-module-7.
  • Typed params (MO-11g/h, MO-8d): a page declares props: { params: { id: string } }; a route whose path lacks id is a type error. Nested routes are typed with their parents' params, alternatives (["/a/:id", "/b/:id"]) included. S-module-8.
  • Layout routes (MO-11i): nests(children in component), so a layout's errored/provide reach its routes. S-module-9.
  • Exported routers and typed links (MO-11j/m), typed search params without an import cycle (MO-8g). S-module-10, S-module-17.
  • Data layer: a router query declared with the rows of the fn it caches, a formAction bound to a <form>, useSubmissions. S-module-19.
  • SSR (SV-4a): the server runtime's createApp({ request }); the Vite suite builds client and server, serves per request, hydrates and navigates in Chromium.

Other libraries

  • TanStack Query: holds fails(…) on result fields (MO-10f), declared callbacks as handlers (MO-10g). S-module-11, S-module-12.
  • TanStack Virtual / headless table: render props {view (row, i) { … }} (MO-11k), ref on an element as a handler, renders (MO-11l). S-module-14 to 16.
  • Libraries with their own root (toasters): renders(root, ctx…) (MO-11n). S-module-18.
  • .d.rx: optional parameters (MO-8e), version pins (MO-8f).

Types, runtime and tooling

  • rx-tsc checks each .d.rx against the module's real types (TY-6), and a production Vite build runs it (TY-1d): a type error fails the build.
  • A declared JS error class crosses SSR as itself, identified by its declaration (SV-5a).
  • rx-declare drafts a .d.rx from types, then runs the package to settle uses/provides.
  • rx-verify runs a declaration: exports, uses, provides, pure, and with a probe, holds/fails on every result field. It found that TanStack Query 6's isFetching holds on first load.
  • Harness: the Vite suite finds a plugin that loads .rx; the server runtime warns on two copies of @solidjs/web.

Results

  • ref/: 145 scenarios; compiled and oracle runtimes 145/145; types 196/196; SSR 138 (7 older skips), on ref/ and the crate's output.
  • Crate parity: 449/449 programs, normally and client-only; projection 236/236, lowering 232/232; cargo test passes.
  • Tooling: language server 16, rx-tsc 7, rx-declare 15, rx-verify 16.
  • Vite suite 22/22; compiler/test/ssr-router.mjs 5/5.

Fixed along the way

  • ref/scripts/solid-next.sh (the next branch is gone), a literal escape in compiler/src/prelude.ts, rx-tsc on .d.rx in include, examples in guide/diagnostics.md that didn't hold.

🤖 Generated with Claude Code

https://claude.ai/code/session_01BVdYZqRoBTRfgj2qMzfd7X

claude and others added 30 commits November 14, 2026 03:40
eval: regrade .rx apps on Solid next with #4840 and #4841 fixed
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0117BoWLtkg281f1NkGEDjCt
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0117BoWLtkg281f1NkGEDjCt
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0117BoWLtkg281f1NkGEDjCt
A write that lands after its page was left is not judged on the next visit
(Ryan 2026-11-14: late writes are out of scope). A4 was only applied to rows.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0117BoWLtkg281f1NkGEDjCt
…XState references follow it

Ryan 2026-11-14: with two accepted writes to one field, the server's last answer is the
only correct value at rest. --r15 drops allowance A2; FUZZ_ROUND=--r15 sh harness/grade.sh.
All six desk9 references grade 0 under it (20 seeds; React, Exact, XState, Foldkit and
vanilla also 0/60 on seeds 21-80).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0117BoWLtkg281f1NkGEDjCt
…erence, fuzz seed 45)

Also replay.mjs: DW=<n> widens the detail text it prints.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0117BoWLtkg281f1NkGEDjCt
…ence (grades 0)

Brief frozen 2026-11-14 (Ryan). 26 visible, 45 hidden, 26 overlap tests; fuzz-board.mjs
with oracles for duplicates, headings, counts, the work-in-progress limit, the detail,
and settled state. TASK=board sh harness/grade.sh grades it. The fuzzer catches two
planted bugs in the reference (limit off by one, an accepted toggle not kept).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0117BoWLtkg281f1NkGEDjCt
…el under a pending guess

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0117BoWLtkg281f1NkGEDjCt
…rite visit

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0117BoWLtkg281f1NkGEDjCt
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0117BoWLtkg281f1NkGEDjCt
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0117BoWLtkg281f1NkGEDjCt
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0117BoWLtkg281f1NkGEDjCt
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0117BoWLtkg281f1NkGEDjCt
…15 prereg draft

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0117BoWLtkg281f1NkGEDjCt
… answered add's placeholder while work is in the air

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0117BoWLtkg281f1NkGEDjCt
…, minimal trail)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0117BoWLtkg281f1NkGEDjCt
…s/solid#4874, rx runtime catchRead, pending probe)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0117BoWLtkg281f1NkGEDjCt
…); guide: one store over the server

- Runtime: `catchRead` with no observer (a component fn called from a handler or
  action) is a snapshot (04 R-8): the committed value, or the alternative on a
  matching failure. A fresh error boundary there had no value while a refresh
  was out and threw NotReadyError (S-catch-snapshot).
- Checker (ref/ and crate): ARGUMENT_COUNT (06 AC-1f) for a call of a declared
  action with the wrong number of arguments; `props` in `component C()` is
  UNBOUND (03 RG-4b). AST gains `noProps`. S-check-1 rejected variants, a
  check.rs unit test, guide/diagnostics.md sections.
- pending? inside a held `loading on(sel)` region reads false: Solid's, under
  05 DV-22 (plain-Solid repro saved). Guide and GUESS_WHILE_LOADING text say
  to test `pending? x` in the handler too (R-12).
- guide/async.md: "One store over the server".

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0117BoWLtkg281f1NkGEDjCt
…k shown column), fuzz B3 declined count hold, repro for solidjs/solid#4887

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0117BoWLtkg281f1NkGEDjCt
…on, two Solid repros

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0117BoWLtkg281f1NkGEDjCt
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0117BoWLtkg281f1NkGEDjCt
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0117BoWLtkg281f1NkGEDjCt
…and by key; record seed)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0117BoWLtkg281f1NkGEDjCt
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0117BoWLtkg281f1NkGEDjCt
…(seed 28); repro for solidjs/solid#4897

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0117BoWLtkg281f1NkGEDjCt
yumemi-thomas and others added 30 commits November 22, 2026 08:08
… it is, to a prop that renders what it carries renders it in turn — the prop is one that renders in the component's summary and its signature (router: renders provides(…)), and the components it carries are named and checked where the component is applied, under the component's own boundaries around the provider and then the application's; in this module or another. A router wrapped in the app's own Shell is accepted (S-module-22, bench router-provider); what the Shell is given must still be a value whose components can be named

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…s fields' rows — a component's prop whose type is a record with field rows (query: { data: pending fails(Error) T; … }) is read in that component as the result is, a field at a time with each held read checked, and a result (or a record of held fields below one) is given whole to such a prop when its type marks every held field at least as the declaration does; the interface is in the signature (query: takes(data pending fails(Error))), and the row words are dropped from the type TypeScript sees. A query passed down to a child is accepted, typed and run (S-module-11, bench query-forward); a prop that takes the field for plain data still refuses it

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…on or a local whose name is written only as the argument of a function that hands that position a draft is that function's callback: its parameter is the draft, its body the callback's, and it is shared by every handler that gives it to the setter (bump = (d) => { d.done := d.done + 1 }; setTodos(bump)). Any other use of the name (called by hand, passed elsewhere, stored, exported) is DRAFT_ESCAPES where it is written; a function that is not such a closure is still refused. A declared fn whose result hands out drafts is a primitive (instantiates inferred), so its setter is io and calling it while the view computes is IO_IN_REACTIVE. S-module-25, compiler/test/drafts.mjs, bench store-updater

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…N_PLACE: an Array's mutating method (push, sort, reverse, splice, …) called on the value of a source, an equation, a prop, a provision, a row of one, or the value a functional write is given changes it in place, telling no reader (rows.push(2); props.items.sort()); DISPOSER_DROPPED: a declared JS call whose result is () => void (what undoes it) written as a statement, or bound to a local nothing uses, leaves its listener behind when the component ends. guide/diagnostics.md has both; bench source-mutation and listener-cleanup

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…th two alike keys are refused (rows from data stay the data's: nothing checks them at run time, as nothing does in Solid); and a component a JS host renders (pages.rx?rx-lib) is checked as 11 CP-4d says it is, applied under a root of its own: a failure, a context or a first load its own view does not handle is UNHANDLED_FAILURE, CONTEXT_NOT_FOUND or the loading error in the host's module (whole-program builds, which know the hosts). bench duplicate-keys, start-route

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…dvice beside its diagnostics (rxc check prints advice lines and lists them in --json; ref/check.ts the same; the two are compared), never an error: ASYNC_WATERFALL for a pure question awaited after another whose answer it does not read. The spec for the round: what a prop renders and takes (09 MO-3, MO-10f, MO-11o), a named draft callback and the methods of a draft (MO-10i), a handler is passed not called (02 SC-4), W-1a, EF-5a, ST-4d, a host's pages (11 CP-4d), what Solid does and does not report of a mismatch (10 SV-7c), and the decision on each mistake the benchmark found unprotected (spec/rfc-revisions-2026-11-22.md); the guides say the same. bench: the scorecard (good 39/39, types 55/55, runtime 55/55, bad caught 57/59), the two that stay red with their reasons, and CI holds every red to a reason

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
… in place (five shapes, and what the code made itself stays its own), a handler given a call, a method that answers nothing called in a view, a disposer dropped two ways, two rows with one key — so the scenario suite and the crate/ref comparison hold them, not the benchmark alone; CHANGELOG

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…result is now the library's own object (README, runtime/README, 09, S-module-11, ssr-held.mjs); a declared type's numeric literal is told the same way by the crate and ref/

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…erexamples — a router at its provider, the same through the app's own component, and a page with no boundary at the outlet still refused through it; 13 TY-1c says what a props type is to TypeScript

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…ows/suites.yml) — cargo test; ref/'s interpreter, oracle, compiled, ssr and types runners; the crate against ref/ in each mode (checked, --spa, --whole-program, --lower, --project); compiler/test/drafts.mjs, ssr-held.mjs and confined.mjs. Solid at ref/SOLID_NEXT is built once per pin and kept in a cache

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…ges (bench/baseline-rebased.txt) — the probes a review writes to find the edge of a rule (an inherited valueOf(), a draft's iterator kept, a forEach callback that keeps rows, a callback kept in a record, [f][0]()) are compiler/test/confined.mjs's; a variant the language cannot write (PARSE, ASSIGNMENT, UNBOUND, UNKNOWN_COMPONENT, a TypeScript error alone) is counted apart, as unrepresentable; shadcn's DataTablePagination table={table} is part of the table's good program; each task's .d.rx files are measured against what rx-declare drafts for the same module (hand-written words, and the anys they hold), and --check holds both numbers; a type probe is judged on the line it wrote; query-forward runs a refetch and a failing query, sequential-awaits asserts two loads in flight at once (its loaders as rx-declare drafts them, io). Eleven tasks added: @solidjs/router 2.0's data layer, TanStack Query's mutation with dehydrate/hydrate, Formisch field arrays, a Kobalte Select with object options, solid-primitives with a TanStack Virtual adapter on an element ref, a store's draft given to a JS helper, an optimistic todo, a selection as a projection, state derived through an effect, a keyed list edited, a context with its provider component. 24 tasks: good 68/72, types 103/107, runtime 97/106, bad 84/106, unrepresentable 8/8, 437 hand-written .d.rx words, 195 anys

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
… is an error (it was an advisory row): an effect's own write of a source declared beside it, with a value or a path computed from reactive values, whether the block reads what the effect does not name (computed once, stale after: effect () { b := a * 2 }) or only what it fired for (a frame late, never computed on the server: effect (a) { b := $0 * 2 }, a history appended by an effect); a constant, the source's own value, what an io call answers, a reading under peek, a closure's later writes and a source of an outer block stay the apply's. A changing value an apply reads that its effect does not take as an input is advice, SNAPSHOT_IN_EFFECT (the second advisory row). A statement has its line (ref/src/ast.ts, compiler/src/ast.rs), and a diagnostic about one statement of a long body is placed on it, in both checkers. S-check-2, guide, 99

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…r may be declared draft (export fn moveItem(draft list: T[], from: number, to: number): void): the fn changes it in place during the call and keeps nothing, so a draft's path is given to it as it is and the call is a write of the draft (setBoard((d) => { moveItem(d.columns, 0, 2) }), as Solid's documentation uses a store); anything else it would change behind its writes — a source's value, an equation's, a prop, a store read beside its setter — is MUTATION_IN_PLACE, and a pure fn has no draft parameter. A JS fn whose parameter is not marked is lent a copy (__rt.lend), which in a development build (Solid's DEV) refuses to be changed, naming the fn and the missing word: the mutation that used to be lost without a sound is an error in the helper's own stack. rx-declare asks the question of a fn that answers nothing and takes an array or a record; rx-verify runs a draft parameter with the probe's arguments (changed during the call, not after). S-module-25, compiler/test/drafts.mjs and confined.mjs run both halves; bench store-helper

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…by its key (Solid's reconcile(v, key): a row whose key is kept keeps its region, wherever the new list puts it — it was replaced by position); DUPLICATE_KEY reads the rows a write or a guess gives a keyed list, and the rows an expression-bodied updater answers; a functional write to a path of a source applies its function to the path's value (the runtime stored the function). bench keyed-edits, S-check-3

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…pt on every path — DISPOSER_DROPPED sees a result typed by a name its declaration file gives the function (export type Unsubscribe = () => void), TypeScript's VoidFunction, and a subscription object (a record with such a function named unsubscribe, dispose, destroy, disconnect, stop, cancel or close); a local it is bound to is kept when every path from its binding to the block's end and to each return names it (let stop = listen(…); if (on) { return () => { stop() } } drops it where on is false), and another name for it (let later = stop) keeps it only as far as that name is kept. rx-declare drafts a result that takes nothing and answers nothing as () => void, as TypeScript resolves it (solid-primitives' makeEventListener answers VoidFunction). S-check-3, guide, bench primitives-virtual

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…n, and for a loader as rx-declare drafts it — a question is a declared JS fn awaited for what it answers: a pure one, or an io one whose answer the statement binds (let user = await loadUser(7)); an io call awaited for nothing (await save(a)) is a command and anything else awaited is unknown, a point of order after which nothing is held up by what came before. The advice names the first question before it whose answer it does not read, and a question told to move holds up none after it (a; b; c(a) was advised on b and on c: it is one advice, on b); where either fn is io it says what only a pure declaration rules out. ref/check.ts prints a parse error as the crate does, with its line and the code of the habit it reads like (JS_LOCAL). The unit a_waterfall_is_advised_once_for_each_question in both; S-await-1, guide, bench sequential-awaits

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
… => o.total(), then createStamp(pick(fmt)) with fmt = { total: () => n }, froze n: the call was read as pick's body alone, in which o names nothing. A call of a closure the checker can see now also calls, for each parameter, what its body calls through it: the closure in that slot of the argument where what is written says which (o.total() and a record literal; g() and the closure g is given), else any closure the argument holds, by mention; any closure the argument holds when the parameter is handed on, kept, written, looped over or called through a computed slot; and the closures held by what the body gives a closure it calls through a parameter (apply = (g) => g(fmt)). A parameter only read into a primitive, dropped, or answered calls nothing here. SNAPSHOT_ARGUMENT, SNAPSHOT_KEPT and what E-5a takes for changing read it alike, in both checkers. 07 §3: a closure's parameter may have a function type ((g: () => string) => g() was a PARSE error: the type stopped at its =>). S-region-6

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…ue renders checked where it is bound may be a prop of an .rx component applied beneath that binding (shadcn/ui's <DataTablePagination table={table} />, which was RENDERS_ESCAPES), when the component keeps the prop: no way out written in its body (a prop of a component that does not keep it in turn, a provision, a source, an export, a thrown value, a call that may keep it) is given a value that may hold a part of props.<field>, by mention, or the props whole. It is the binding region's own rule asked of the prop by the same analysis (a read of one prop flows as that prop; a component being decided is taken to keep it), and the summary is in the signature for importers: export component DataTablePagination(props: { table }) keeps(table). A component that lets it out is refused at the application, with the line where it leaves; a JS component's declaration does not say, so it never keeps. S-module-16 (its refused variants now give the value to a component that stores it; the kept table, a callback that hands it up, a component that gives it on to one that provides it), the unit a_prop_that_keeps_what_it_is_given_is_no_way_out in both, guide, bench table-pagination

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…aScript's for … of (07 §5) — said where the loop is taught (language.md, which said it works as in TypeScript), on the rules page, and for a store's draft (libraries.md), with the two ways to write a row found in a draft: by its index, or in the loop

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…ce it already had — a function a context provides or a prop is given is read by its declared type as a method of a JS result is (a component's props type and a context's type are read a step at a time, MO-10k): one that answers nothing, or a promise of nothing, is called for what it does, so {c.add(id)} in a view and onClick={c.add(id)} are refused, ACTION_CALLED_IN_OWNED_SCOPE where every provision the module writes gives the field an action (CN-1b), else IO_IN_REACTIVE; a guess in a run that starts nothing to wait for (no await, refresh, affects, write or call of its own) has no hold and is GUESS_OUTSIDE_HOLD, and an action's first guess written after an await is advice, GUESS_AFTER_AWAIT (the third advisory row); what a JS component hands its view (view (list) { … }) is the library's own state, changed in place only by its methods (MUTATION_IN_PLACE); a render prop declared optional may be left out (<Select.Listbox /> was VIEW_FN_EXPECTED). A write through a row found in a draft (let t = d.items.find(…); t.done := true) stays refused, the local being a copy (MO-10i), and its message says so with the two ways to write the row. bench: optimistic-todo names the language's code for a guess with no hold (GUESS_OUTSIDE_HOLD; the task had a name no rule has). S-check-1, S-check-3, S-module-14, the unit a_guess_needs_something_to_wait_for in both, guide

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…draft has its equation's type — a function field of a declared result whose type answers a promise (mutate: (v) => Promise<T>, refetch, invalidateQueries), called in reactive scope and not awaited, is IO_IN_REACTIVE there and as a handler attribute's value: the work would start again on every computation with nothing waiting for it, and the view be handed a promise ({rename.mutate(v)} was accepted); awaited it is asked, as a question is, and from a handler it is called. A draft(…) equation with a declared type types its draft by it (sel: Record<string, boolean> = draft({}) { d[k] := true } was TS7053 on d[k]: the prelude's draft<T> took T from the seed). S-check-3, bench query-mutation and projection-selection

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…ys a result a step at a time — declarations/solid-js is @rx-types/solid-js, the shared declaration of solid-js 2.0 (createStore with its draft setter, snapshot, merge, omit, flush: the rest of Solid is the language), found as an @types package is; rx-tsc's @types fallback (TY-4b) answers only for a package with no types of its own, so a package's real types are never replaced by the projection of what declares its rows. rx-declare drafts what the checker reads of a result: one that takes nothing and answers nothing is () => void through the library's own name for it (EF-5a); a small object by its fields (an accessor ref, a getter the app calls and a function as written, a nested object a step further); a class instance by its methods (a generic one by what it answers: void, a promise); an accessor of an options object with its callbacks; the module's own types by name (Promise<Todo[]>); a generic type with its parameters. For @tanstack/solid-router, @solidjs/router and @tanstack/solid-query it also drafts what types cannot show — renders(later), nests(…), the prop that renders, contexts, pending fails(Error), tracked and handler, pure — from src/known.js, each entry for the version range it was checked against by running that release (--types-only leaves them out; a generated declaration, MO-8l, never takes them, and its drafting rule is 3). The run pass leaves a word a row already says. spec/rfc-revisions: the round's decisions, and a proposal for a callback keyed by a sibling field (a TanStack query key that misses an input)

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…ood 72/72, types 107/107, runtime 120/121, bad 104/107, unrepresentable 8/8, 216 hand-written .d.rx words (437 at the rebased baseline), 193 anys (195). Four reds, each in its task's known: a duplicate key computed at run time, a pure JS call that differs on the server, Kobalte's own read of a store row in an effect callback (the stale known for it holds again now that the select compiles), and a TanStack query key that misses an input of its function (the cache's contract; a declaration word is proposed). The declarations are what rx-declare drafts now: the virtual adapter's options and result, TanStack Query's rows (the client by the method the app calls), the table's generic types; Solid's store is declared by @rx-types/solid-js, copied into the workspace as an app installs it, and the two tasks' own solid-js.d.rx are gone. compiler/test: the Vite suites find Solid at $SOLID_NEXT, as ref/scripts/solid-next.sh does

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…he query's function reads the id, its key does not" (expected KEY_MISSES_INPUT, red) is removed with its known and its run helper: a query key that misses an input of its function is TanStack Query's cache contract, not a Solid mistake (nothing is frozen: the closure reads props.id when it is called), and @tanstack/eslint-plugin-query's exhaustive-deps refuses it; the task keeps a comment that says so. The scorecard: good 72/72, types 107/107, runtime 120/121, bad 104/106, unrepresentable 8/8, 216 hand-written .d.rx words, 193 anys; three reds, each in its task's known (a duplicate key computed at run time, a pure JS call that differs on the server, Kobalte's own read of a store row in an effect callback). bench/README says what a variant is not

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…y use any Solid library through its declaration, and what the checker enforces there is reactivity, ownership and the contracts a declaration states in the generic words, which mean the same for every library that writes them; a rule of one package's semantics is that package's tooling's: the checker names no package, no diagnostic exists for one library, no declaration word is one library's contract. rx-declare's version-ranged table (MO-8k) is access: it drafts generic words, and the checker reads the words. spec/rfc-revisions: keyed(queryKey), proposed for a TanStack query key that misses an input, is considered and rejected under the rule. README, guide/libraries.md ("What stays the library's")

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
… source for the words — rx-declare wrote `any` for every type it could not restate (193 in the benchmark's declarations: 97 that range over a type parameter, 47 callbacks never written, 15 another package's types, 9 the module's own generic ones, 5 internal, 6 in overloaded fns, 14 by hand). A row's types are TypeScript's text and the checker reads none of it, so the draft now names the type where the library declares it: the module's own by an alias with its parameters' bounds and defaults, another package's by import("<package>").T (under the name the library's own declarations import it by), the row's type parameters as the library declares them, a callback by its own signature, a conditional, mapped or template type as the library computes it, an internal type by its place (Parameters<typeof import("kit").inner>[0]). Each reading of a row (type parameters carried or not, a part said by its place or not) is held against the module as TY-6 holds it, on the draft's text (src/declare-check.js, rxc serve's boundary), and a row takes the reading TypeScript holds that leaves the fewest `any`s, or the row every draft had: a draft brings no DECLARATION_MISMATCH of its own. --explain says why each `any` left is one; --any drafts as before; generated declarations are draft 4. A declared component may have type parameters, as a declared fn may (MO-8d: export component Picker<Option>(props: { value?: Option; … }), a member component too) — it was a parse error, the one thing the notation lacked: both parsers, the declaration's .d.ts and the boundary check in both, the tree-sitter grammar (and an import type as an array's element there), S-module-29, the unit a_component_row_may_have_type_parameters in both. rx-declare --source [<checkout>] (src/declare-source.js) reads the TypeScript a package was built from — a checkout, the src/ it publishes, the sources its source maps carry, or says which repository and version to check out — and writes what it shows of the words types cannot (handler, tracked, ref, uses, provides, instantiates, a result that undoes the call) as // SOURCE comments above the rows, each with its file and line, never as a row; it follows a callback through the library's own helpers and stops at another package's. Tried on eight of the benchmark's libraries: the TanStack packages publish src/, the others dist/ only; types read from the source are the published ones or worse, and the words are found (solid-primitives' handler and instantiates, Kobalte's uses, @solidjs/router's provides). spec/rfc-declaration-types-2026-11-22.md: the causes, why a declaration should not restate a typed package's types, and what is proposed (an omitted type read as the vendor's, a fn with several signatures). bench: the declarations as rx-declare drafts them now — good 72/72, types 107/107, runtime 120/121, bad 104/106, unrepresentable 8/8, 144 hand-written .d.rx words (216), 24 anys (193)

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…ny` is the library's or it is not written — rx-declare rendered the type TypeScript resolves and knew the names of one module's exports, so what a library computes, or exports from a subpath, was written a field at a time or by its place (Parameters<typeof import("kit").f>[0]: 81 in the benchmark's declarations, 1347 in whole drafts of its libraries). A row's types are now the annotation the library's own .d.ts gives each parameter, result, prop and bound, each name rewritten to a module the app can import it from: every subpath the package's exports list (@formisch/solid/v2/internals, a ./* pattern by what it matches), the package that declares it, the packages the library depends on, under the name it has there (a bundle's Store$1 through its symbol; a type parameter's TEntries$1 as it was written), the main entry before a subpath; a helper alias or an interface of fields no module exports is written out, a generic method at its type parameters' defaults, a result the library names by that name unless its parts say what the checker reads. Each row is still held against the module (TY-6, src/declare-check.js) and falls back to MO-8m's reading, then to the row every draft had. A declared component's props may be a type, with the fields that carry words in a record after it (MO-8o: export component Select<Option, …>(props: import("@kobalte/core/polymorphic").PolymorphicProps<T, SelectRootProps<Option, OptGroup, T>> & { onChange?: handler (value: Option | Option[]) => void; itemComponent?: Component }) provides(select)): TypeScript's intersection, chosen over a new word because both parsers, both .d.ts projections and the tree-sitter grammar read it with no new construct; the checker reads the record as it read a record of props and none of the type (a plain prop was already nothing to it), the boundary check finds the row's type parameters from the type alone (NoInfer around the record), and props that are a union of records are written as they stand — Kobalte's Select root, 15 anys, is one line with none. A declaration may hold several rows of one fn's name, its signatures (MO-8p): the checker reads the first, and a later row that says another word — on the row, a parameter, the result — is a parse error, so what differs by signature is types alone; the .d.ts writes an overload per row and TY-6 holds each; a draft writes them where they agree (up to twelve) and the shortest signature's row where they do not. Both in ref/ and the crate, with S-module-30, S-module-31 and the units a_component_row_may_name_its_props_type and a_fn_may_have_several_rows in each. MO-8q, ruled: a .d.rx holds `any` only where the library's own type has one, reproduced as it is (unknown stays unknown), and a part said by its place is counted apart, not a way around it; rx-declare --explain reports the library's anys and the draft's apart, --causes writes them by row, and a row that still holds one of the draft's says so above it. bench: each task's declarations are counted as inherited and introduced anys and by-place parts; --check fails on an introduced any that is not on bench/any-allowlist.json (empty), and on any of the numbers rising. The benchmark's declarations are regenerated with their words kept (the table adapter's rows, useParams, createEventListener's ref target and type_ are named; the dialog's context takes the draft's name): good 72/72, types 107/107, runtime 120/121, bad 104/106, unrepresentable 8/8, 135 hand-written .d.rx words (144), 0 introduced anys (24), 23 inherited (valibot's own bounds, a default of Kobalte's), 4 by-place parts (81). spec/rfc-declaration-types-2026-11-22.md: the proposal that an omitted type mean the vendor's is withdrawn (it changed what a row means and hid the type, for a fault that was the draft's), with what remains in whole drafts (110 of the draft's anys in rows no app of the benchmark uses, each with its cause). Generated declarations are draft 5

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…d no `any` in a whole draft is the draft's — a component's props may be `P & { field: … }` (MO-8o), held as `P & NoInfer<{ … }>`, which an intersection satisfies whatever the record says: a field written with another type than the library's (`onChange?: handler (v: number) => void`) or under a name it has not (`onChanged`) passed. Each field of the record is now held on its own (13 TY-6f): its name is a prop of the props' type (of one member of a union at least; any name where the props are open), and the type it is written with is assignable to the library's type for that prop — the record's fits the library's, TY-6b's direction (a declaration says less, never something else), and the sound one for a callback (as the record types it, it takes what the library calls it with). The row's type parameters are types of their own in these checks (default, else bound, else a type nothing else is; `any` where a bound comes back to itself): TypeScript reads no prop of a conditional over a type parameter. DECLARATION_MISMATCH on the row names the prop, the record's type and the library's; a row the module does not fit says that first. The crate writes the checks with the row's (project.rs boundary_checks, serve's `boundary` answers each with what it asks), rx-tsc and a draft's own held-check read them; ref/ has no boundary check (TY-6d) and reads the same row. S-module-32, the unit a_props_record_is_held_to_the_props_type in both, test/tsc.js against a typed module (a generic prop, a union under a conditional, open props; a retyped field, a callback that does not take what it is called with, a misspelt one). Kobalte's Select row holds as drafted. MO-8q is extended to whole drafts: drafting every export of the modules the benchmark declares wrote 115 `any`s of the draft's own (290 in all, 252 parts by place); now 0 (306 the libraries' own, reproduced inside the types the rows now name; 136 by place). What wrote them, and what it took: a bound that is a helper alias written out was cut at 640 characters and the row lost its type parameters (24: a row is not cut to a length); the library's own `any` inside a named type was counted as the draft's — its marker held the word — so the reading that named the type lost to one that dropped it (5); beside type parameters a part with no name was its place at the bounds, another type, and the row did not hold (13: the place at the row's type parameters, `Parameters<typeof import("kit").f<T, U>>[1]`, and of an overloaded fn where one signature takes that many type arguments); a predicate had no text (2: written as the library writes it where it is a callback's answer; a parameter that is a type parameter is that parameter); a record of an options parameter left out a field the library requires and no row can write, `"~run"`, and the row every draft had did not parse (16: such options are their type); a function field of a result (4), an accessor parameter of an unexported type (4: what the parameter answers); a bound with no name at all, a recursive helper (20: the last reading — no type parameters, the last signature, every part without a name by its place as it stands — ranked last and tried only before an `any`); a result the app's project cannot resolve, `import("solid-js/web").JSX.Element` (5: an element by the name the library wrote); options with a predicate field (12: the type the library declares); a function of nothing that gives an element drafted `Component`, which TypeScript did not hold (5: `() => View`); a component with several signatures (5: its last, by its place). rx-declare --readings <export> prints each reading of a row and TypeScript's answer. bench: each task's modules are counted as whole drafts too (scorecard.txt, `decl.draft` in scorecard.json), and --check fails on an `any` of a draft's that is not on any-allowlist.json (an entry with `draft`; none) and on a task whose whole drafts say more by place than recorded; an export named `any` is not one. The scorecard is as it was: good 72/72, types 107/107, runtime 120/121, bad 104/106, unrepresentable 8/8, 135 hand-written words, 23 inherited, 0 introduced, 4 by place. tree-sitter reads a member of an import type (`import("pkg").Types["error"]`, which drafts wrote and the grammar refused), with a corpus entry for the forms a draft writes. Generated declarations are draft 6. spec/rfc-declaration-types: the third round, with what stayed a proposal (a name for a library's unexported helper types, a predicate as a fn's own result, a callback's shape in the last reading, a record's field held for every type argument).

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…gnature, read as one; one build for .rx apps and .tsx Solid 2 apps

A package's .d.rx was found (MO-8k, second place) and read as a JS module's declaration (MO-8a), where an .rx package ships its modules' printed signatures (MO-9b): other defaults (absent rejects(…) is nothing, not Error) and other rows (sources and equations, actions, .rx contexts with keys relative to the module, catches, shape(…), server fn).

MO-13a, the marker: `//@ signature <module>.rx …`, a pragma line before the first row. A declaration a JS import finds with it — beside a relative module or by MO-8k — is handed to the signature reader, and the import is an .rx import known by its signature (MO-9a): one switch, and MO-13b's table lists every difference it decides. The compiler writes the line on every signature it prints (the header comment is gone); a .d.rx without it means what it meant. Both checkers (ref/src/modules.ts isPrintedSignature, the crate's is_printed_signature), S-module-33, the unit a_marked_declaration_is_read_as_a_signature in each; a context key crosses the package boundary because it is relative (./theme.rx#theme is the package's own module where it is installed). The lowering imports the module's factory as __rx from the specifier written and keys the module by it (MO-13c); the projection writes the module's path, so TypeScript finds x.rx.d.ts beside the signature (MO-13d, 13 TY-4c). A signature's stub declares an error class as a value and a type. rxc serve's boundary, rows and declaration, and rx-tsc's named declarations, pass a printed signature over: nothing in it is asserted. tree-sitter reads a file that begins with the marker as a printed signature (signature_pragma, signature_export rows), with corpus entries and highlights.

MO-13e, the build: rx-lib (compiler/lib.mjs, the package's bin; rxc app --lib prints each module's signature). For every module the entries reach: x.dom.js and x.ssr.js, x.js and x.server.js (the factory as __rx, each export through the runtime's library()), x.d.rx, x.rx.d.ts (rx-tsc's declarations of the projection), x.d.ts (the types of x.js: a source is an accessor, a ref parameter one too), rx-prelude.d.ts; the package.json's exports are held to it under Solid's conditions (worker, browser, deno, node, default; no `solid`), --write writes them. Sources are not shipped for apps to compile: the signature is exact, and one compiled module is one instance. Hydration keys are the runtime's owner ids, so a package compiled apart hydrates with the app. The runtime's library(factory) binds each export to the page's app (the request's on the server) and instantiates the module in a root of its own. MO-13f: what stops at the .tsx boundary (TypeScript's checks and no others), no server fn or context as a JS value, Solid 2. 11 CP-4e, guide/libraries.md, README, CHANGELOG.

compiler/test/lib.mjs (the build, the exports check, an app compiled against the installed package), test/tsc.js (a printed signature in include), bench/tasks/rx-package: the package built and installed, an .rx app checked against the shipped .d.rx with the verdicts it gets against the package's source (good and nine mistakes, both checkers, same lines), a .tsx app type-checked by tsc against the shipped .d.ts, both served, hydrated and driven in Chromium. The scorecard: good 75/75, types 115/115, runtime 143/144, bad 113/115, unrepresentable 8/8, 135 hand-written words, 23 inherited, 0 introduced, 4 by place — the other 24 tasks as they were. spec/rfc-rx-packages-2026-11-22.md: what stayed a proposal (a signature naming another package's context, scoped styles, server fns, the root a module is instantiated under for a JS host, an .rx program and a .tsx host sharing one instance, a package's own TypeScript, a hash on the marker for strict mode).

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…r imports it; a plain render on the server is enough

What was true: an .rx program and JavaScript that both imported a package written in .rx had an instance of its state each, in the browser and on the server (the program's app, and a second the runtime made for the host); library() threw on the server outside Solid's request event; and a module JavaScript used first inside a component was disposed with that component (Solid disposes a root made under an owner with it), its questions with it.

MO-13g: JavaScript's use of an .rx module (library, and CP-4d's components) is bound to the page's app. In the browser that is the first app made in the page: a program's createApp, or the one the runtime made for JavaScript that came first, which the program's createApp then returns. On the server, inside a request event it is the request's (the app that streams, the first createApp inside the event, or one made at first use and kept in the event's locals); outside a request it is the render's — one per renderToString or renderToStream, kept by the render's root owner (found through the owner's parents, as Solid's getRequestEvent finds a render) and dropped when it is disposed. Never the process's: a use outside any render and any request throws, saying to use it in a render or inside provideRequestEvent. A second createApp in a page is a second app with instances of its own (MO-1b); JavaScript stays with the first.

MO-13h: where JavaScript instantiates a module, it is a root of its own that the place of first use does not own — no owner in the browser, the render's root owner on the server — whose id is the module's name (rx-lib writes it into the call: library(__rx, "<package>/<module>")), so its nodes have the same ids on both sides wherever the first use is.

ref/compile/rt-web.ts, rt-server.ts (the runtime), compiler/lib.mjs. bench/tasks/rx-package: the .tsx app served by a plain renderToStream and inside a request event, hydrated both ways; two renders at once (plain, and as requests) each read their own numbered instance before and after the rate lands; a plain renderToString; the message outside a render; mixed.mjs — an .rx program's app and the package's JavaScript exports over one instance, in either order, a second app apart, and inside a program's stream (the rate asked once). runtime/test.mjs: components and library under a plain renderToString with no warning of a missing event, a module outliving its first reader, the program taking the page's app. compiler/test/lib.mjs: the name in the call.

The scorecard: good 75/75, types 115/115, runtime 154/155 (143/144: eleven checks added to rx-package, the one failure kobalte-select's, as before), bad 113/115, unrepresentable 8/8, 135 hand-written words, 23 inherited, 0 introduced, 4 by place.

spec/09 MO-13f/g/h, 11 CP-4d and CP-4e, guide/libraries.md, runtime/README.md, CHANGELOG. spec/rfc-rx-packages: items 4 and 5 landed, with what they leave (a ?rx-lib module's root, a dependency two packages share, Solid's internals for the render's root; two renders in one request event, an export used after an await outside a request).

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
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.

6 participants