Add framework adapter#7847
Conversation
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
View your CI Pipeline Execution ↗ for commit 3c46780 ☁️ Nx Cloud last updated this comment at |
🚀 Changeset Version Preview8 package(s) bumped directly, 5 bumped as dependents. 🟩 Patch bumps
|
Bundle Size Benchmarks
The following scenarios have bundle-size changes compared with the baseline:
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. |
Merging this PR will regress 15 benchmarks
|
| 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
Footnotes
There was a problem hiding this comment.
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 {
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
|
we need to first merge #7830 |
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>
…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>
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
|
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.
|
|
@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, 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
left a comment
There was a problem hiding this comment.
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.
|
@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 :) |
Summary
.tsrxroute generation, compiler transforms, code splitting, and HMRValidation