Skip to content

Add framework adapter#7847

Draft
tannerlinsley wants to merge 10 commits into
mainfrom
taren/framework-adapter
Draft

Add framework adapter#7847
tannerlinsley wants to merge 10 commits into
mainfrom
taren/framework-adapter

Conversation

@tannerlinsley

@tannerlinsley tannerlinsley commented Jul 18, 2026

Copy link
Copy Markdown
Member

Summary

  • add official Octane Router and Start packages
  • add first-class .tsrx route generation, compiler transforms, code splitting, and HMR
  • add SSR, streaming hydration, server functions, redirects, error handling, and document asset coverage
  • compose the framework compiler hooks without changing Octane's renderer-agnostic meta-framework APIs
  • cover Vite, Nitro, Cloudflare, and Netlify deployment paths

Validation

  • Router plugin unit suite: 604 passed
  • Start plugin core unit suite: 515 passed
  • Octane Router unit suite: 79 passed
  • affected lint, type, build, publint, and package API checks
  • Octane Start production SSR Playwright suite: 11 passed
  • Octane Start Vite HMR Playwright suite: 1 passed
  • Cloudflare and Netlify client + SSR production builds
  • clean CI temp-directory reproduction for generator and CLI fixtures

@coderabbitai

coderabbitai Bot commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: c70a08bd-75a8-491e-ba0e-917f31a5c184

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch taren/framework-adapter

Comment @coderabbitai help to get the list of available commands.

@nx-cloud

nx-cloud Bot commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

View your CI Pipeline Execution ↗ for commit 3c46780


☁️ Nx Cloud last updated this comment at 2026-07-22 14:52:50 UTC

@github-actions

github-actions Bot commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

🚀 Changeset Version Preview

8 package(s) bumped directly, 5 bumped as dependents.

🟩 Patch bumps

Package Version Reason
@tanstack/octane-router 1.170.18 → 1.170.19 Changeset
@tanstack/octane-start 1.168.28 → 1.168.29 Changeset
@tanstack/octane-start-client 1.168.16 → 1.168.17 Changeset
@tanstack/octane-start-server 1.167.22 → 1.167.23 Changeset
@tanstack/router-cli 1.167.21 → 1.167.22 Changeset
@tanstack/router-generator 1.167.21 → 1.167.22 Changeset
@tanstack/router-plugin 1.168.23 → 1.168.24 Changeset
@tanstack/start-plugin-core 1.171.24 → 1.171.25 Changeset
@tanstack/react-start 1.168.32 → 1.168.33 Dependent
@tanstack/react-start-rsc 0.1.31 → 0.1.32 Dependent
@tanstack/router-vite-plugin 1.167.23 → 1.167.24 Dependent
@tanstack/solid-start 1.168.32 → 1.168.33 Dependent
@tanstack/vue-start 1.168.31 → 1.168.32 Dependent

@github-actions

github-actions Bot commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

Bundle Size Benchmarks

  • Commit: a71e9c20921b
  • Measured at: 2026-07-22T01:27:37.843Z
  • Baseline source: history:edf55759d8e9
  • Dashboard: bundle-size history

The following scenarios have bundle-size changes compared with the baseline:

Scenario Current (gzip) Delta vs baseline Initial gzip Raw Brotli Trend
react-router.minimal 87.38 KiB +31 B (+0.03%) 87.24 KiB 273.71 KiB 75.98 KiB ▁▁▁▁▁▁▁▁▁▁▁█
react-router.full 91.07 KiB +3 B (+0.00%) 90.93 KiB 285.61 KiB 79.07 KiB ▁▁▁▁▁▁▁▁▁▁▁█
solid-router.full 40.59 KiB +6 B (+0.01%) 40.46 KiB 121.13 KiB 36.45 KiB ▁▁▁▁▁▁▁▁▁▁▁█
vue-router.minimal 53.00 KiB +2 B (+0.00%) 52.87 KiB 149.97 KiB 47.63 KiB ▁▁▁▁▁▁▁▁▁▁▁█
vue-router.full 58.95 KiB +15 B (+0.02%) 58.82 KiB 168.74 KiB 52.79 KiB ▁▁▁▁▁▁▁▁▁▁▁█
react-start.minimal 101.98 KiB -7 B (-0.01%) 101.84 KiB 322.12 KiB 88.21 KiB ███████████▁
react-start.deferred-hydration 102.71 KiB -11 B (-0.01%) 101.86 KiB 323.50 KiB 89.04 KiB ███████████▁
react-start.full 105.36 KiB -4 B (-0.00%) 105.22 KiB 332.06 KiB 91.11 KiB ███████████▁
react-start.rsbuild.full 102.90 KiB +10 B (+0.01%) 102.73 KiB 326.63 KiB 88.51 KiB ▁▁▁▁▁▁▁▁▁▁▁█
solid-start.minimal 49.59 KiB -18 B (-0.04%) 49.46 KiB 152.06 KiB 43.82 KiB ███████████▁
solid-start.deferred-hydration 52.85 KiB -18 B (-0.03%) 49.52 KiB 160.10 KiB 46.81 KiB ███████████▁
solid-start.full 55.43 KiB +5 B (+0.01%) 55.30 KiB 169.13 KiB 48.97 KiB ▁▁▁▁▁▁▁▁▁▁▁█
vue-start.minimal 71.02 KiB -7 B (-0.01%) 70.89 KiB 207.21 KiB 62.90 KiB ███████████▁
vue-start.full 75.06 KiB +27 B (+0.04%) 74.93 KiB 219.86 KiB 66.45 KiB ▁▁▁▁▁▁▁▁▁▁▁█

Current gzip tracks all emitted client JS chunks. Initial gzip tracks only the entry/import graph. Trend sparkline is historical current gzip ending with this PR measurement; lower is better.

@pkg-pr-new

pkg-pr-new Bot commented Jul 18, 2026

Copy link
Copy Markdown
More templates

@tanstack/arktype-adapter

npm i https://pkg.pr.new/TanStack/router/@tanstack/arktype-adapter@7847

@tanstack/eslint-plugin-router

npm i https://pkg.pr.new/TanStack/router/@tanstack/eslint-plugin-router@7847

@tanstack/eslint-plugin-start

npm i https://pkg.pr.new/TanStack/router/@tanstack/eslint-plugin-start@7847

@tanstack/history

npm i https://pkg.pr.new/TanStack/router/@tanstack/history@7847

@tanstack/nitro-v2-vite-plugin

npm i https://pkg.pr.new/TanStack/router/@tanstack/nitro-v2-vite-plugin@7847

@tanstack/octane-router

npm i https://pkg.pr.new/TanStack/router/@tanstack/octane-router@7847

@tanstack/octane-start

npm i https://pkg.pr.new/TanStack/router/@tanstack/octane-start@7847

@tanstack/octane-start-client

npm i https://pkg.pr.new/TanStack/router/@tanstack/octane-start-client@7847

@tanstack/octane-start-server

npm i https://pkg.pr.new/TanStack/router/@tanstack/octane-start-server@7847

@tanstack/react-router

npm i https://pkg.pr.new/TanStack/router/@tanstack/react-router@7847

@tanstack/react-router-devtools

npm i https://pkg.pr.new/TanStack/router/@tanstack/react-router-devtools@7847

@tanstack/react-router-ssr-query

npm i https://pkg.pr.new/TanStack/router/@tanstack/react-router-ssr-query@7847

@tanstack/react-start

npm i https://pkg.pr.new/TanStack/router/@tanstack/react-start@7847

@tanstack/react-start-client

npm i https://pkg.pr.new/TanStack/router/@tanstack/react-start-client@7847

@tanstack/react-start-rsc

npm i https://pkg.pr.new/TanStack/router/@tanstack/react-start-rsc@7847

@tanstack/react-start-server

npm i https://pkg.pr.new/TanStack/router/@tanstack/react-start-server@7847

@tanstack/router-cli

npm i https://pkg.pr.new/TanStack/router/@tanstack/router-cli@7847

@tanstack/router-core

npm i https://pkg.pr.new/TanStack/router/@tanstack/router-core@7847

@tanstack/router-devtools

npm i https://pkg.pr.new/TanStack/router/@tanstack/router-devtools@7847

@tanstack/router-devtools-core

npm i https://pkg.pr.new/TanStack/router/@tanstack/router-devtools-core@7847

@tanstack/router-generator

npm i https://pkg.pr.new/TanStack/router/@tanstack/router-generator@7847

@tanstack/router-plugin

npm i https://pkg.pr.new/TanStack/router/@tanstack/router-plugin@7847

@tanstack/router-ssr-query-core

npm i https://pkg.pr.new/TanStack/router/@tanstack/router-ssr-query-core@7847

@tanstack/router-utils

npm i https://pkg.pr.new/TanStack/router/@tanstack/router-utils@7847

@tanstack/router-vite-plugin

npm i https://pkg.pr.new/TanStack/router/@tanstack/router-vite-plugin@7847

@tanstack/solid-router

npm i https://pkg.pr.new/TanStack/router/@tanstack/solid-router@7847

@tanstack/solid-router-devtools

npm i https://pkg.pr.new/TanStack/router/@tanstack/solid-router-devtools@7847

@tanstack/solid-router-ssr-query

npm i https://pkg.pr.new/TanStack/router/@tanstack/solid-router-ssr-query@7847

@tanstack/solid-start

npm i https://pkg.pr.new/TanStack/router/@tanstack/solid-start@7847

@tanstack/solid-start-client

npm i https://pkg.pr.new/TanStack/router/@tanstack/solid-start-client@7847

@tanstack/solid-start-server

npm i https://pkg.pr.new/TanStack/router/@tanstack/solid-start-server@7847

@tanstack/start-client-core

npm i https://pkg.pr.new/TanStack/router/@tanstack/start-client-core@7847

@tanstack/start-fn-stubs

npm i https://pkg.pr.new/TanStack/router/@tanstack/start-fn-stubs@7847

@tanstack/start-plugin-core

npm i https://pkg.pr.new/TanStack/router/@tanstack/start-plugin-core@7847

@tanstack/start-server-core

npm i https://pkg.pr.new/TanStack/router/@tanstack/start-server-core@7847

@tanstack/start-static-server-functions

npm i https://pkg.pr.new/TanStack/router/@tanstack/start-static-server-functions@7847

@tanstack/start-storage-context

npm i https://pkg.pr.new/TanStack/router/@tanstack/start-storage-context@7847

@tanstack/valibot-adapter

npm i https://pkg.pr.new/TanStack/router/@tanstack/valibot-adapter@7847

@tanstack/virtual-file-routes

npm i https://pkg.pr.new/TanStack/router/@tanstack/virtual-file-routes@7847

@tanstack/vue-router

npm i https://pkg.pr.new/TanStack/router/@tanstack/vue-router@7847

@tanstack/vue-router-devtools

npm i https://pkg.pr.new/TanStack/router/@tanstack/vue-router-devtools@7847

@tanstack/vue-router-ssr-query

npm i https://pkg.pr.new/TanStack/router/@tanstack/vue-router-ssr-query@7847

@tanstack/vue-start

npm i https://pkg.pr.new/TanStack/router/@tanstack/vue-start@7847

@tanstack/vue-start-client

npm i https://pkg.pr.new/TanStack/router/@tanstack/vue-start-client@7847

@tanstack/vue-start-server

npm i https://pkg.pr.new/TanStack/router/@tanstack/vue-start-server@7847

@tanstack/zod-adapter

npm i https://pkg.pr.new/TanStack/router/@tanstack/zod-adapter@7847

commit: b7331f3

@codspeed-hq

codspeed-hq Bot commented Jul 18, 2026

Copy link
Copy Markdown

Merging this PR will regress 15 benchmarks

⚠️ Different runtime environments detected

Some benchmarks with significant performance changes were compared across different runtime environments,
which may affect the accuracy of the results.

Open the report in CodSpeed to investigate

⚡ 13 improved benchmarks
❌ 15 regressed benchmarks
✅ 152 untouched benchmarks

Warning

Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Mode Benchmark BASE HEAD Efficiency
Memory mem server error-paths redirect (solid) 442 KB 514.8 KB -14.14%
Simulation ssr assets inline-css cdn (solid) 62.3 ms 71 ms -12.29%
Simulation ssr control-flow unmatched 404 (react) 59.6 ms 67.3 ms -11.42%
Simulation ssr control-flow unmatched 404 (solid) 72.3 ms 81.4 ms -11.22%
Simulation ssr assets linked-css control (react) 54.8 ms 60 ms -8.67%
Simulation ssr assets linked-css control (solid) 75.9 ms 81.4 ms -6.74%
Simulation ssr control-flow route headers (react) 61.2 ms 65.3 ms -6.39%
Simulation ssr control-flow error 500 (react) 62.2 ms 65.9 ms -5.72%
Simulation ssr control-flow unmatched 404 (vue) 190.4 ms 199.4 ms -4.49%
Simulation ssr control-flow route headers (solid) 82 ms 85.6 ms -4.28%
Memory mem server peak-large-page (vue) 713.9 KB 744.7 KB -4.14%
Simulation ssr dehydrate rich types (react) 56.2 ms 58.4 ms -3.79%
Simulation ssr not-found (react) 59.2 ms 61.4 ms -3.69%
Simulation ssr assets inline-css cdn (react) 51.5 ms 53.2 ms -3.18%
Simulation ssr control-flow error 500 (solid) 79.8 ms 82.4 ms -3.15%
Memory mem server error-paths redirect (vue) 979.9 KB 335.8 KB ×2.9
Memory mem server error-paths not-found (solid) 1,146.2 KB 416.9 KB ×2.7
Memory mem server error-paths unmatched (react) 567.3 KB 264.4 KB ×2.1
Simulation ssr server-fn POST (solid) 72.3 ms 62.7 ms +15.26%
Simulation ssr server-fn not-found (solid) 69.6 ms 61.9 ms +12.41%
... ... ... ... ... ...

ℹ️ Only the first 20 benchmarks are displayed. Go to the app to view all benchmarks.

Tip

Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.


Comparing taren/framework-adapter (b7331f3) with main (edf5575)1

Open in CodSpeed

Footnotes

  1. No successful run was found on main (07ce903) during the generation of this report, so edf5575 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

nx-cloud[bot]

This comment was marked as outdated.

@nx-cloud nx-cloud Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Important

At least one additional CI pipeline execution has run since the conclusion below was written and it may no longer be applicable.

Nx Cloud is proposing a fix for your failed CI:

We fixed three failing tasks introduced by the new framework adapter code. The rename fallback in generator.ts resolves EXDEV: cross-device link not permitted errors that occur when the generator's temp directory and the test's /tmp/ route directory reside on different filesystems, and the paths entries added to octane-start/tsconfig.json resolve the five TS2307 errors caused by TypeScript being unable to locate the unbuilt sub-path exports (/client, /server) during the type check.

Tip

We verified this fix by re-running @tanstack/router-generator:test:unit, @tanstack/octane-start:test:types.

Suggested Fix changes
diff --git a/packages/octane-start/tsconfig.json b/packages/octane-start/tsconfig.json
index 23535530..e800b9a6 100644
--- a/packages/octane-start/tsconfig.json
+++ b/packages/octane-start/tsconfig.json
@@ -2,7 +2,11 @@
   "extends": "../../tsconfig.json",
   "compilerOptions": {
     "module": "esnext",
-    "types": ["node"]
+    "types": ["node"],
+    "paths": {
+      "@tanstack/octane-start/client": ["./src/client.ts"],
+      "@tanstack/octane-start/server": ["./src/server.ts"]
+    }
   },
   "include": ["src", "tests", "vite.config.ts", "vite.config.server-entry.ts"]
 }
diff --git a/packages/router-generator/src/generator.ts b/packages/router-generator/src/generator.ts
index dc1ba405..3b357166 100644
--- a/packages/router-generator/src/generator.ts
+++ b/packages/router-generator/src/generator.ts
@@ -121,7 +121,23 @@ const DefaultFileSystem: fs = {
       gid: Number(res.gid),
     }
   },
-  rename: (oldPath, newPath) => fsp.rename(oldPath, newPath),
+  rename: async (oldPath, newPath) => {
+    try {
+      await fsp.rename(oldPath, newPath)
+    } catch (err) {
+      if (
+        typeof err === 'object' &&
+        err !== null &&
+        'code' in err &&
+        (err as NodeJS.ErrnoException).code === 'EXDEV'
+      ) {
+        await fsp.copyFile(oldPath, newPath)
+        await fsp.unlink(oldPath)
+      } else {
+        throw err
+      }
+    }
+  },
   writeFile: (filePath, content) => fsp.writeFile(filePath, content),
   readFile: async (filePath: string) => {
     try {

Apply fix via Nx Cloud  Reject fix via Nx Cloud


Or Apply changes locally with:

npx nx-cloud apply-locally 1osE-9Shl

Apply fix locally with your editor ↗   View interactive diff ↗



🎓 Learn more about Self-Healing CI on nx.dev

@schiller-manuel

Copy link
Copy Markdown
Collaborator

we need to first merge #7830

Comment thread packages/octane-router/src/Head.ts Outdated
trueadm added a commit to octanejs/octane that referenced this pull request Jul 19, 2026
The README referenced the prepared TanStack patch by a machine-local home
path other maintainers cannot open. The patch now lives next to the package
(packages/tanstack-start/tanstack-octane-native-injection.patch) and the
README points at it, so the byte-identity claim is verifiable from any
checkout: the patch applies clean on TanStack/router#7847's branch and
reproduces the vendored renderRouterToStream.ts exactly (both re-verified).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
trueadm added a commit to octanejs/octane that referenced this pull request Jul 19, 2026
…ch (#176)

* Sync the vendored stream file with the prepared upstream patch

The native-injection renderRouterToStream was upstreamed as a ready-to-apply
patch against TanStack/router#7847 (taren/framework-adapter @ 753f919e — the
exact commit the vendor tree came from). Keep the vendored copy
byte-identical to that patch (comment-only delta) so vendor-vs-upstream
diffs stay clean, and document the one deliberate vendor divergence in the
package README, which still claimed the whole tree was verbatim.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* Commit the upstream patch into the repo (review feedback)

The README referenced the prepared TanStack patch by a machine-local home
path other maintainers cannot open. The patch now lives next to the package
(packages/tanstack-start/tanstack-octane-native-injection.patch) and the
README points at it, so the byte-identity claim is verifiable from any
checkout: the patch applies clean on TanStack/router#7847's branch and
reproduces the vendored renderRouterToStream.ts exactly (both re-verified).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
@socket-security

socket-security Bot commented Jul 22, 2026

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addedoctane@​0.1.12751008295100

View full report

@socket-security

socket-security Bot commented Jul 22, 2026

Copy link
Copy Markdown

Warning

Review the following alerts detected in dependencies.

According to your organization's Security Policy, it is recommended to resolve "Warn" alerts. Learn more about Socket for GitHub.

Action Severity Alert  (click "▶" to expand/collapse)
Warn Medium
Low adoption: npm octane

Location: Package overview

From: e2e/octane-start/basic/package.jsonnpm/octane@0.1.12

ℹ Read more on: This package | This alert | What are unpopular packages?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Unpopular packages may have less maintenance and contain other problems.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/octane@0.1.12. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

View full report

@tannerlinsley

Copy link
Copy Markdown
Member Author

@trueadm — we audited your Octane Router and Start work against this branch and folded the TanStack-specific pieces into the official packages here, while leaving Octane’s renderer-agnostic meta-framework untouched.

This PR now carries forward the Router/Start use cases we found: the Octane Router binding, .tsrx route generation and code splitting, HMR, Start SSR and streaming hydration, server functions, document assets, and the Vite/Nitro/Cloudflare/Netlify deployment paths. During the merge we also fixed compiler-plugin state leaking across HMR virtual modules and applied the direct isServer ?? router.isServer pattern throughout the Octane render helpers for tree-shaking. It is current with main after #7830.

The Query binding moved to the TanStack Query repo in TanStack/query#11101, with the original parity work plus sequential and nested custom-hook streaming SSR coverage.

When you have time, could you review this PR and sign off that we preserved the valuable use cases and Octane-specific constraints from your implementation? Please call out anything you think was lost, changed materially, or should stay on the Octane side.

@trueadm trueadm left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice stuff it all looks good to me. One thing though, you should probably align with Octane 0.1.13 before merging. The permanent-static and streamed ownership fixes in c36608cc were released in 0.1.13, so that should be the minimum tested version.

@tannerlinsley

Copy link
Copy Markdown
Member Author

@trueadm Thanks — good catch. I pushed the Router/Start catalog and peer floors to make Octane 0.1.13 the minimum declared baseline in 3c46780. The repo's 24-hour minimumReleaseAge policy will not permit the 0.1.13 lockfile refresh until 2026-07-23 at 09:30 UTC, so I'll land that and the full 0.1.13 validation as soon as the gate clears, then post the results here. That will put the permanent-static and streamed-ownership fixes from c36608cc in our tested baseline without bypassing the supply-chain policy.

@trueadm

trueadm commented Jul 22, 2026

Copy link
Copy Markdown

@trueadm Thanks — good catch. I pushed the Router/Start catalog and peer floors to make Octane 0.1.13 the minimum declared baseline in 3c46780. The repo's 24-hour minimumReleaseAge policy will not permit the 0.1.13 lockfile refresh until 2026-07-23 at 09:30 UTC, so I'll land that and the full 0.1.13 validation as soon as the gate clears, then post the results here. That will put the permanent-static and streamed-ownership fixes from c36608cc in our tested baseline without bypassing the supply-chain policy.

You can likely have a local patch with the changes on top of 0.1.12 to validate and test first. That should enable you to give it a spin and confirm things work. If all is well then you can remove the patch tomorrow :)

@dotnize dotnize mentioned this pull request Jul 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants