Repository navigation
feat: support checked compiled boundaries and a compiled router entry - #2054
Merged
trueadm merged 4 commits intoOct 14, 2026
Merged
Conversation
domgan-oai
marked this pull request as ready for review
October 14, 2026 14:33
Contributor
Benchmark report
Compares js-framework: 1k/10k row operationsAll 20 timed operations (20 without a verdict)
All 64 work counters are unchanged. Application bundle size (bytes)
84 other measured values are unchanged. Public-import reachability bundles (bytes)
113 other measured values are unchanged. |
trueadm
added a commit
that referenced
this pull request
Oct 15, 2026
Brings in #2047-#2051 (Strong literal stabilisation), #2054 (checked compiled boundaries and a compiled router entry), #2055/#2057 (Strong rejects descriptor APIs and .tsx/.jsx), #2056/#2060/#2061 (CLI Strong reports), #2062 (Strong in the website and devtools), #2065 (no browser-translation DOM accommodations) and Version Packages. Conflicts, resolved so main's behaviour lands on the redesign's commit model: - runtime.ts, #2065: setText keeps main's legacy host-only convention and the redesign's hydration writeText. The translator recovery is gone from renderText/commitText, setRenderText/commitSetText, commitHole, childTextHoleUpdate, recordHole and bindSignalChild; removeOnlyChildText still removes a committed Text at commit. resetOnlyChildHost and PENDING_HOST_TEXTS (which served only the host-only text writes) are deleted. - compile.js, #2065: text updates call setRenderText(_txt, v), commit functions setText(_txt, v), and commitHole takes no host. - runtime.server.ts, #2054: a compiled-only frame checks its output; ordinary frames keep the redesign's returned-value normalization. - codes.json: main's 344-346 (CompiledContext, CompiledOutlet) keep their numbers; the redesign's codes move to 347 (server boundary error), 348 (hydration protocol skew) and 349 (frontier rehome). Generated tables and CLI data are regenerated; docs/ssr.md names #348. Adaptations: - compiled-boundaries.test.ts: the server runs no error boundary (React's model), so an invalid CompiledOutlet under a catch-only @Try fails renderToString with the CompiledOutlet error; the client still shows the catch arm. - scripts/render-writers.mjs drops resetOnlyChildHost. Co-Authored-By: Claude Opus 5.5 <[email protected]>
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
Applications that deliberately render only compiler-owned components at dynamic route or context boundaries still have to retain generic JSX, text, array, and portal handling. Add checked
CompiledOutlet,CompiledContext, andcreateCompiledContextfor this opt-in contract on client and server. Invalid returned output fails clearly. Ordinary rendering, including ordinary children inside a compiled component, keeps its existing contract.Add
@octanejs/tanstack-router/compiled: core base route constructors, a paired provider, outlet, hooks, and lazy route component. It uses the standard router and store lifecycle, handles matched/pending/error/not-found routes, and rejects shell options that would bypass the checked contract. Standard router imports keep their existing concrete route-bound APIs.Client roots validate and snapshot
initialSignalswithout serializing and parsing the entire manifest first. SSR wire-format checks remain in place. Includes package docs, minor changesets for both APIs, and generated catalogs.Validation
Octane and router package/public API typechecks; affected runtime, router, compiler, SSR/hydration and signal-manifest tests (366 existing and new core tests, 99 router tests, 9 router SSR tests).
SSR nesting regression checked against the previous PR commit using the same full conformance suite: Node 24 went from 8 failed / 74 passed to 82/82 passed. Node 26 also passes 82/82. The new fixture covers ordinary child descriptors inside and after a compiled outlet; original conformance tests unchanged.
Existing initial-document signals production SSR/hydration guard.
Packed both packages; verified an isolated real consumer after dropping both first-party patches. All 28 component sources compile for client and server (56/56); all 12 existing history/retention and production composer tests pass, including SSR/hydration, draft/focus/selection, IME, lazy-load/rejection.
pnpm sync, fullpnpm format:checkplus formatting on later changes, changeset checks, Octane production package build/tests.Full current-head CI: all four Node 24 test shards, full typechecks, lint, all React parity lanes, Chromium and heavy integration, examples, publishable packages, bundle checks, and CI provenance pass. 30/30 PR checks green for
e01dfbdf14, including the benchmark.Shard 1/4 rerun on the identical SHA cleared a single load-sensitive timeout in an existing behavior-root test. No timeout or test coverage changes.
Perf review: compiled-router-boundaries
git diff f7b41dcc HEAD -- packages/octane/src | node scripts/perf-review-scan.mjs --diff - --json: 0 runtime candidates. The scan's diff mode does not check class shape; manual review confirms no new BlockImpl or ScopeImpl fields. Router source scan: 14 candidates.Hot paths: checked client slot/provider, once per compiled render; SSR frame, once per component; compiled router Matches, per active match. The SSR frame uses an optional internal
trueselector and a direct ordinary output call: defaulted callback dispatch reduced recursive depth and has been removed. Initial document validation runs once per root. No new scheduling or layout reads.runtime.server.tsSSR frame; compiled router MatchesDismissed: 12 rest/arguments hits in
hookBindings.tsand one inrouterStateBinding.tsmove the existing slot-aware overloads into factories initialized once. The last incompiled/bindings.tspreserves that same compiler slot convention. They add no subscriptions or render hops. Standard and compiled provider tests cover them.concise-code: new files publish the opt-in entry and its checked matches/contexts; shared hook, state, and lazy-loader modules avoid copying existing implementations. Required runtime exports are the three checked primitives and their generated errors. Type-only standard route chain declarations preserve bound hooks afteraddChildren/lazy options. A renderer-wide mode or a second copy of router hooks is unnecessary. Independent read-only complexity review: no must-fix findings.Risk / follow-ups
Use the paired provider/hooks from the same entry and supply compiled route components, including lazy targets. We have source-compilation and existing consumer-test evidence, not a complete production build of the original application: an independent third-party patch series is incomplete in its draft checkout. No original-application complete-bundle or latency claim. Locally, full-workspace installation was blocked by unrelated registry policy dependencies; scoped runs used the approved lockfile with
--config.verify-deps-before-run=false.Provenance
agent-authored)Codex task · host
com-79386Need help on this PR? Tag
@codesmith-botwith what you need.Note
Medium Risk
Opt-in APIs, but they extend core client/SSR render paths and require not mixing standard vs compiled router providers; invalid dynamic route components now throw instead of silently mis-rendering.
Overview
Adds checked compiled-only boundaries in Octane:
createCompiledContext,CompiledContext, andCompiledOutletfor dynamically selected views that must be compiler-owned output (no returned JSX/text/descriptors). Client and SSR enforce the contract with new errors 344–346; the compiler treats realoctaneimports of these builtins as void-output slots (including under HMR).Streamed document signal bootstrap now validates in-memory
initialSignalsvia exportedvalidateNativeSignalManifestinstead of round-tripping through JSON parse.Introduces opt-in
@octanejs/tanstack-router/compiled:CompiledRouterProvider, routerCompiledOutlet,lazyCompiledRouteComponent, and matching hooks on compiled-only contexts—same TanStack matching/navigation, rejectsWrap/InnerWrap/shellComponent. Standard router entry keeps descriptor-capableRouterProvider/Outlet; hook logic is factored into shared factories (hookBindings,lazyRouteLoader,routerStateBinding), anduseTransitionertakes an explicit router instance.Docs, changesets, conformance tests for boundaries, hydration, pending/lazy routes, and type tests for route
addChildren/lazyergonomics.Reviewed by Cursor Bugbot for commit e01dfbd. Bugbot is set up for automated code reviews on this repo. Configure here.