Repository navigation
feat(tanstack-router): own compiled failures in catch boundaries - #2160
Merged
domgan-oai merged 1 commit intoOct 20, 2026
Merged
Conversation
domgan-oai
marked this pull request as ready for review
October 19, 2026 21:39
Contributor
Benchmark report
Compares js-framework: 1k/10k row operations
All 20 timed operations (19 without a verdict)
All 64 work counters are unchanged. Application bundle size (bytes)
57 other measured values are unchanged. Public-import reachability bundles (bytes)
107 other measured values are unchanged. |
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's Strong compiled Router tree still reached a compatibility-mode failure component whenever a route or global boundary caught an error. Move failure selection and presentation into the Strong match tree, and let the active catch arm own synchronous, once-per-entry error reporting. This preserves the existing boundary topology, ancestor propagation, not-found placement and match-identity recovery. Related to #2059.
The new
__runOnCatchis a binding-infrastructure operation, backed by catch-entry state only on the exceptional path. The route selects its fallback before invoking user reporting; callback errors continue to the enclosing boundary. SSR runs the operation once per catch pass.Validation
pnpm format:check— repository-wide run omitted; changed-file formatting passed.pnpm typecheck— repository-wide run omitted; all six selected production source files passed. Forced-inclusion test checks and the Router consumer program retained the same diagnostics as exact main (14 core, 8 Router, and 5 consumer respectively).pnpm test— repository-wide run omitted; focused isolated Vitest projects passed 44 core tests (development and production), 44 Router client/hydration/navigation tests, and 12 Router SSR tests. Both changed Router behavior cases also passed against main3c8272e52using an in-memory test overlay.octane analyze --strong-dependencies --jsonon the same 54 tracked website components: main reportedcompiled/MatchLifecycle.tsrxthrough three importers; this branch reports no compatibility dependencies or diagnostics.pnpm sync, generated error-code validation, and independent complexity review.e0db2ad7e.perf-review: scan found no candidates. Both client and SSR retain four boundary sites; normal-route topology and scheduling are unchanged. Added token/frame work runs only after a catch. Thesuspense-transitionproduction reachability scenario grew 64 raw / 32 gzip / 5 brotli bytes. The complete website public-JS inventory grew 1,143 raw / 290 summed per-file gzip bytes across 621→622 files; these inventory totals are not route transfer sizes. Browser latency was not benchmarked.octane-tsrxreplace at +8.3% (95% CI +3.1% to +21.4%). Matched local production builds of that exact benchmark target produced byte-identical complete JavaScript (105,425 bytes; SHA-2567863e89828b50a6766734a98471cea7c010ad5b1d33db43f2a44aa027444f65c); CI executable artifacts were not retained, so the timing result cannot be attributed or dismissed conclusively. CI measuredsuspense-transitionat +64 raw / +35 gzip / +5 brotli bytes and Pagecraft Oxc at +64 raw / +36 gzip / +155 brotli bytes.concise-code: source +132/-68 (runtime +58/-7); one binding-infrastructure export supplies the synchronous lifecycle, and the sole new authored file is the two-package patch changeset. A post-commit effect would alter callback timing and propagation; adding a second boundary changed the real website's recovery behavior. Unbundled compiled Router modules shrink by 351 client / 114 server bytes; the complete-build measurements above include runtime cost.Risk / follow-ups
Provenance
agent-authored)Codex task · host com-79386
Need help on this PR? Tag
@codesmith-botwith what you need.Note
Medium Risk
Changes core error-boundary and compiled Router failure paths on client and SSR, including when route
onCatchruns and how not-found errors propagate.Overview
Moves compiled TanStack Router route/global failure UI and
onCatchreporting into the Strong@catcharms inMatches.tsrx, and removes the separate compatibilityCompiledFailuremodule.Octane adds exported
__runOnCatch: a binding hook that runs a callback once per catch entry, synchronously, only while the direct catch arm is active (client and SSR). Misuse throws error #350. Catch props now carry internal catch-entry state so re-renders of an already-shown fallback do not re-fire reporting; nested components cannot report on behalf of a parent boundary.resolveFailurekeeps not-found vs error component selection, ancestor propagation when the owning route cannot handle the error, and match-identity-drivenreseton the compiled failure view. Router docs/status mark failure presentation and synchronous reporting as Strong-owned.Reviewed by Cursor Bugbot for commit e0db2ad. Bugbot is set up for automated code reviews on this repo. Configure here.