Repository navigation
feat: support compiled Router and Start website usage - #2075
Merged
trueadm merged 5 commits intoOct 15, 2026
Merged
Conversation
domgan-oai
marked this pull request as ready for review
October 15, 2026 00:56
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
The website could not use the compiled Router entry: it lacked the document shell, links and route-bound APIs, and Start selected the ordinary provider. Extend that existing entry, add matching Start client/server entries and a
compiled: trueVite/Rsbuild option, and migrate the website's actual route tree and consumers. Refs #2059.Share the existing route, Link and head-asset behavior between entries. Preserve document hydration ownership, native Link timing, and live execution of route scripts. Route generation and splitting use the selected entry consistently; mixed runtime imports fail before modifying route files. Custom Start entries retain precedence.
The integration exposed a documented dynamic
<style>typing defect. Move its existing host-element normalization into the shared copy-on-write parser adoption pass so runtime and editor tooling agree. Raw scoped CSS remains unchanged. Rsbuild now composes the existing framework generator plugin as Vite does, allowing native TSRX route bodies.Validation
pnpm format:checkwas not run locally.pnpm testwas not run locally.TSRX3010; both ordinary/Strong editor mappings now pass. Development/production client/server output is byte-identical to main for the fixture.ea438fb4versus PR3a82a3e92, with identical dependency versions. All 16 documentation routes, three homepage samples and six additional Router journeys pass at 1280×900 and 390×844. Includes SSR adoption, intent preload, modified/keyboard navigation, history/hash/scroll, search/filtering, safe error arguments, 404s, head metadata/JSON-LD, live Playground and production/development Devtools interactions. Recorded semantic/geometry observations match; 24/25 screenshot pairs are byte-identical, with the remaining difference confined to the automatically scrolling Lynx gallery.pnpm sync, scoped formatting and Octane/Router/Start/public-consumer/website types pass. Current head is014a36fac; matched production/browser evidence uses3a82a3e92. Follow-ups change only validation configuration and tests: Start’s tsconfig includes the new authored.tsentries under its existing unused-symbol checks; all 11 affected website test providers select the compiled entry; the homepage sample test uses its existing visible mount-effect signal instead of an unrelated network-idle wait. Runtime/compiler/build-plugin sources are unchanged.014a36fac: CI run and benchmark run are green. All required and relevant checks, including CI provenance and Bugbot, pass. Four test shards passed 54,081 tests (two skipped); website integration passed 105/105 and Chromium integration 616/616. All parity lanes, publication validation, examples, lint and types pass. The paired benchmark records 64 unchanged work counters, 93 unchanged application-bundle values, 120 unchanged reachability values and no timing verdict outside its ±3% noise threshold across 20 operations. These core benchmarks are separate from the complete website measurement below.perf-review: 16 scan candidates, all existing Link conditional spreads or hook rest parameters moved to shared owners; no unresolved must-fix. Hot paths are Link events, match rendering and head/script updates. No new scheduler, geometry read or core runtime state. Asset value memoization retains one memo cell; keyed head-asset rows replace descriptor arrays. Both entries share the existing script descriptor list to preserve self-removing transport tags and live navigation execution. Parser normalization reuses the existing cold traversal. Complete production public JavaScript grows from 4,351,604 to 4,353,218 gzip bytes (+1,614 bytes, +0.0371%) across the same 614 emitted/copied JS files; raw bytes grow by 7,657. This measures all public JavaScript, not one route or chunk. Four binary Lynx containers are separate (raw unchanged, gzip +10 bytes). This is a functional migration with measured size growth; no latency/allocation improvement is claimed.concise-code: net +502 source/declaration lines (+364 Router, +134 Start, +4 compiler), no core runtime additions. Ten Router modules share existing behavior or extend compiled adapters; six Start modules provide the matching public/boot entries. Rejected duplicating a second Link/router state machine, a general entry registry, an extra parser traversal, and a caller-level style alias. Independent review found no unresolved source/complexity blocker.The final real-Start browser check caught and fixed an additional hydration regression: keyed script rows retained markers after transport scripts removed themselves, causing the original app shell to be replaced. The persistent test now uses real router serialization and executes the actual self-removing scripts before hydration; it fails on the keyed implementation and passes on the shared ordinary script owner. No hydration suppression or script-payload patch was added. Three fresh held-boot production runs on each final build now preserve the original HTML/head/body/app, shell, header, main and counter through hydration and clicks.
Parsed client/server emissions separately confirm that the new Start components and compiled route/Link adapters have no descriptor calls at their own sites. The document shell still emits one
createElementFromConfigcall plus scoped descriptor helpers, and the shared script owner has onecreateElementcall per emitted module. This PR does not establish descriptor-free website output.Risk / follow-ups
This is a compiled website integration slice, not whole-package Strong compliance or removal of the generic renderer. Link retains
flushSyncbecause removing it changes the synchronousonBeforeNavigatetransition cue. Compiled match error propagation, scroll script adoption/raw HTML and existing lifecycle dependencies remain explicit follow-ups.Wrap/InnerWrapremain unsupported by the compiled entry; ordinary compatibility entry behavior is retained.The actual CLI reports zero findings across all 98 website source modules. Its recursive compatibility frontier contains six Router modules (
compiled/Matches,hookBindings,linkBinding,routerStateBinding,scriptComponent,useStore) plus the two unchanged Three modules; Start is absent and there are no React-compat boundaries. Whole Router source analysis is 33 diagnostics/0 parse errors across 73 files (baseline 37/0 across 63); all six new Start compiled modules are clean. No upstream dependency upgrade is included. Clean manual-slot hook modules remain undeclared because a Strong directive changes their memoization emission; that requires separate performance work.Publication CI validates all 123 tarballs and source/export shape. Its strict external-source matrix validates 51 enrolled bindings under TypeScript 5.9/6/7.1, but retains Router’s existing exception and does not enroll Start. It is not new external strict-source proof for these entries; package/public workspace typechecks and actual website builds provide their consumer evidence here.
The website comparison records existing main behavior separately: light-theme navigation restores the static dark theme-color value, and the homepage Lynx teardown can emit its existing errors. Narrow viewport evidence is browser emulation. Matched production QA passes. Local HMR used identical explicit polling on both builds: the candidate macOS native watcher missed the first edit in two attempts (no filesystem event or Vite update), although restoration later delivered an event. Those attempts are retained as failed native-delivery evidence. No manual Vite invalidation was used, and native watcher parity is not claimed. The watcher/HMR inputs are unchanged by this PR. The PR is ready for maintainer review. All required and relevant checks are successful on
014a36fac; there are no unresolved review threads.Provenance
agent-authored)Codex task · implementation host
com-79386.Need help on this PR? Tag
@codesmith-botwith what you need.Note
Medium Risk
Opt-in compiled mode changes SSR/hydration, document shells, and script transport, but behavior is shared with the ordinary Router entry and mixed-import builds fail early.
Overview
Extends
@octanejs/tanstack-router/compiledfrom a narrow provider/outlet into a full compiled route tree:createRoute/ file-route factories with route-bound hooks andLink, document shell APIs (Html,Head,Body,HeadContent,Scripts, assets), andshellComponenton the compiled match pipeline.RouterProvider/Outlet/lazyRouteComponentare aliases of the compiled components; Link, head assets, and scripts are refactored into shared factories used by both entries, with tighter transition render acknowledgement viaexpectedMatches.Adds
tanstackStart({ compiled: true })on Vite/Rsbuild: compiled default client/server boot entries,@octanejs/tanstack-start/compiled/clientand/compiled/server, and route generation/code-splitting that import the matching Router package (/compiledvs root) and error on mixed contexts. The websiteNotFoundpage switches to the compiledLinkimport.In octane,
<style children={…}>/dangerouslySetInnerHTMLare normalized in the shared parser adoption pass so editor tooling treats them as ordinary host props (scoped blocks unchanged); adds Volar/compiler regression coverage.Docs, status metadata, and conformance/hydration/generator tests are updated for the expanded compiled surface.
Reviewed by Cursor Bugbot for commit 014a36f. Bugbot is set up for automated code reviews on this repo. Configure here.