Repository navigation
fix(router): enable Strong hook and store bindings - #2086
Merged
trueadm merged 3 commits intoOct 15, 2026
Merged
Conversation
domgan-oai
marked this pull request as ready for review
October 15, 2026 12:39
Contributor
Benchmark report🟢 No byte growth, no added work, and no timing changes beyond ±3%. Compares js-framework: 1k/10k row operationsAll 20 timed operations (20 without a verdict)
All 64 work counters are unchanged. Application bundle size (bytes)No changes across 93 measured values. Public-import reachability bundles (bytes)No changes across 120 measured values. |
11 of 12 tasks
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
Enable Strong mode in Router's
useStore, hook bindings, and router-state binding, removing three website dependency boundaries tracked in #2059. Preserve the existing APIs, authored slots, subscriptions, selector semantics, and stable navigation callbacks.Strong previously skipped production memo lowering even for manually slotted modules. Reuse that compiler path after the existing guard rejects generated Strong cache slots; keep the development, server, signal, profiling, and universal exclusions intact. No new runtime cache or public option.
Extend existing subscription-lifetime and compiler coverage plus the hook-memo benchmark. Teardown counters now report absolute work because unchanged main's hook-free driver performs different cleanup; hit/miss controls and budgets are unchanged.
Fix a website cold-start defect exposed by CI: the isolated pnpm layout filtered out all ten transitive Devtools prebundle entries. Two owner-qualified imports now prebundle the host's full lazy graph and the native event client. Existing browser assertions and timeouts are unchanged.
Validation
pnpm sync(no generated changes).node benchmarks/bench.mjs --ratios hook-memo: 24 guards pass. Same final harness against main fails four guards: the Strong manual case creates 128 functions and 128 dependency arrays across 32 hits; the fix creates zero. Counts describe source creation events, not heap bytes or latency. The complete benchmark bundle changes +100 raw/−18 gzip bytes.c6cb71aand integrated1b1f78dhave identical production inputs; their only difference is an MDX HMR test. See the original diagnostic limitation below.235411f06: all required and relevant checks pass. CI passes all 27 jobs: 54,353 unit tests (2 skipped), 105/105 website tests, 616/616 Chromium tests, React parity/example shards, lint/types, compatibility and publication checks. Normal fresh dependency installation and validation of 123 tarballs pass. The benchmark workflow passes: all 64 work counters, 93 bundle values and 120 reachability values are unchanged. All 20 timing operations have no resolved verdict; wide intervals do not establish speed equivalence or improvement. Maintainer approval remains required.perf-review: zero mechanical candidates and no independent-review source blockers for the hook/compiler change. All 25 paired module emissions preserve the existing hot paths. Complete production public JavaScript (614 files, summed per-file gzip level 9): 19,409,867 → 19,409,663 raw bytes (−204), 4,353,393 → 4,353,381 gzip bytes (−12). Four separate binary Lynx containers have unchanged raw size and +3 gzip bytes. These are complete emitted public assets, not an initial-route payload or latency result. Final head retains byte-identical production output to the browser-tested build: all 614 JavaScript files and four binary supplements have identical relative paths and SHA-256 hashes.concise-code: independent review found no source blocker. Total diff: 13 files, +103/-36; shipped package source +9/-1 (client runtime +0/-0), website config +7/-19. New files are one changeset and one 13-line benchmark fixture retaining the non-Strong control. No new runtime state, imports, or public API. A binding-level cache rewrite was rejected because the compiler owns the lost optimization; the website uses its existing nested dependency-resolution mechanism.Risk / follow-ups
Remaining website boundaries: Router
compiled/Matches.tsrx,linkBinding.ts,scriptComponent.tsrx, and Threeweb/events.ts. This does not enable repository-wide Strong enforcement.The original candidate development run recorded two Build Tools
<code>hydration warnings despite passing its interaction assertions. Their original served client module was not retained, so their cause remains unknown. Final strict development journeys and fresh interactive captures have no warning; the relevant served client template, server markup and hydrated DOM match main exactly. This is not a claim that the original warning was fixed or was existing main behavior.Back during the destination's native smooth scrolling can miss the original scroll position on both revisions. Waiting for native
scrollendthen pressing Back restores exactly 360px for all 45 observed frames, with matching settled screenshots at both sizes. Existing Lynx teardown diagnostics, theme-color behavior and deliberate 404 responses are retained separately.Both local full-suite runs passed 104/105; the generated MDX live-edit assertion timed out, including with
CHOKIDAR_USEPOLLING=1. A matched main/candidate check reproduces the timeout on both: disk changes, but the selected macOS file-event backend reports no change event, transform or HMR update. Vite reports bothusePolling: trueanduseFsEvents: trueand selects the latter handler. The current-head hosted Linux website job passes all 105 tests, including both live MDX edits and post-HMR hydration. A paired comparison with externalserver.watch={usePolling:true,useFsEvents:false}passes both edits on the first attempt on both revisions: file events, transforms, WebSocket updates, visible text, original DOM/counter state and fresh SSR/hydration all pass with no console/page errors. Sources were restored exactly. This bounds the local failure to file-event delivery on the selected backend; the underlying missing FSEvents notifications remain unexplained, and no native macOS watcher fix is claimed.Local fresh installs were blocked by the configured dependency firewall; validation reuses an existing dependency graph after verifying all 514 manifests/lock/workspace inputs match and remapping workspace sources. Current-head hosted CI passes a normal fresh install. Router remains an existing exception in the separate strict packed-source TypeScript matrix; Router source/public typetests and real website builds pass. Existing upstream pristine parity remains recorded-unverified; differential and adapted type evidence are the exercised lanes.
Provenance
agent-authored)Codex task · implementation host
com-79386.Need help on this PR? Tag
@codesmith-botwith what you need.Note
Medium Risk
Touches compiler Strong/memo policy and core router reactive adapters; behavior is heavily tested but affects production hook codegen and subscription wiring.
Overview
Turns on
use strongfor TanStack Router’suseStore, hook bindings, and router-state binding so those adapters run under Strong policy while keeping authored hook slots and existing subscription/selector behavior.Compiler: production inline hook memo lowering now applies to manual-slot Strong modules (when generated declaration caches are already rejected), instead of Strong always skipping that path—restoring allocation-free memo hits for Router’s hand-slotted hooks.
Tests & benchmarks: parametrized Strong/manual-slot compiler coverage, a Strong manual-slot hook-memo fixture, and stricter router conformance around atom identity and subscriber lifetime; hook-memo unmount phases report absolute teardown counts (not net of the hook-free driver).
Website: narrows Vite
optimizeDepsprebundle entries for the devtools island to workspace-owned nested roots so pnpm isolation doesn’t drop transitive deps and trigger mid-mount 504 optimize failures.Reviewed by Cursor Bugbot for commit 235411f. Bugbot is set up for automated code reviews on this repo. Configure here.