Skip to content

Add framework adapter#7847

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

Add framework adapter#7847
tannerlinsley wants to merge 13 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

  • Octane 0.1.13 baseline, including the permanent-static and streamed-ownership fixes from octanejs/octane@c36608cc
  • lockfile regenerated normally under minimumReleaseAge; resolves Octane 0.1.13 and @tsrx/core 0.1.47
  • workspace Vite remains pinned to 8.0.16; the Octane/Nitro fixture is scoped to Vite 8.1.5 for its pre-listen environment initialization path
  • Router plugin unit suite: 604 passed
  • Start plugin core unit suite: 515 passed
  • Octane packages: 100 unit tests passed
  • all four Octane packages pass TypeScript 5.6 through 7.0
  • Octane lint, build, publint, and package API checks
  • Octane Start production SSR Playwright suite: 11 passed
  • Octane Start state-preserving Vite HMR Playwright suite: 1 passed
  • React Start bundled-dev HMR Playwright suite: 25 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: 18fcf814-0f4f-4a9a-b9b3-70be52c67a4f

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 78879dd

Command Status Duration Result
nx affected --targets=test:eslint,test:unit,tes... ✅ Succeeded 11m 57s View ↗
nx run-many --target=build --exclude=examples/*... ✅ Succeeded 1m 34s View ↗

☁️ Nx Cloud last updated this comment at 2026-07-23 23:40:26 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

This pull request does not affect bundle size in any measured scenario.

@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: 68ad75a

@codspeed-hq

codspeed-hq Bot commented Jul 18, 2026

Copy link
Copy Markdown

Merging this PR will degrade performance by 15.83%

⚠️ 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

❌ 10 regressed benchmarks
✅ 170 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 unmatched (react) 264.5 KB 808.2 KB -67.27%
Memory mem server error-paths redirect (solid) 441 KB 553.9 KB -20.38%
Simulation ssr not-found (react) 59.3 ms 65.2 ms -9.12%
Simulation ssr control-flow unmatched 404 (vue) 190 ms 199.6 ms -4.8%
Memory mem server peak-large-page (vue) 711.6 KB 745.1 KB -4.49%
Simulation ssr not-found (solid) 75.8 ms 79.2 ms -4.31%
Simulation client-async-pipeline navigation loop (react) 49.8 ms 51.8 ms -3.74%
Memory mem server server-fn-churn (react) 271.4 KB 281.8 KB -3.67%
Simulation ssr control-flow error 500 (react) 62.3 ms 64.6 ms -3.54%
Simulation ssr control-flow route headers (react) 61 ms 63 ms -3.21%

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 (68ad75a) with main (88f366a)

Open in CodSpeed

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.13751008296100
Addedvite@​8.0.16991008298100

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: packages/octane-router/package.jsonnpm/octane@0.1.13

ℹ 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.13. 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
@tannerlinsley

Copy link
Copy Markdown
Member Author

@trueadm The 0.1.13 alignment is complete and pushed. Both lockfiles were regenerated normally after the release-age gate cleared.

Router/Start now resolves Octane 0.1.13 with @tsrx/core 0.1.47. All four Octane packages pass their unit, lint, build, publint, package API, and TypeScript 5.6–7.0 checks, plus production SSR (11/11), state-preserving HMR (1/1), Cloudflare, and Netlify builds. The Query adapter in TanStack/query#11101 is aligned to the same baseline and passes its differential and streaming suite.

That puts the permanent-static and streamed-ownership changes from c36608cc in the tested baseline. Thanks again for catching it and reviewing the merge.

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