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 09b8fa6
☁️ Nx Cloud last updated this comment at |
🚀 Changeset Version Preview8 package(s) bumped directly, 5 bumped as dependents. 🟩 Patch bumps
|
Bundle Size Benchmarks
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 2 benchmarks
|
| Mode | Benchmark | BASE |
HEAD |
Efficiency | |
|---|---|---|---|---|---|
| ❌ | Memory | mem client navigation-churn (vue) |
986.5 KB | 1,052.5 KB | -6.27% |
| ❌ | Memory | mem server request-churn (react) |
482.5 KB | 502.5 KB | -3.98% |
| ⚡ | Memory | mem server error-paths not-found (solid) |
763.6 KB | 416.7 KB | +83.24% |
| ⚡ | Memory | mem server error-paths redirect (vue) |
732.1 KB | 545.2 KB | +34.28% |
| ⚡ | Simulation | client-preload interaction loop (react) |
60.6 ms | 57.3 ms | +5.68% |
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 (753f919) with main (62a191b)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 |
|
|
||
| export const Head: ComponentBody<HeadProps> = (props) => { | ||
| const router = useRouter() | ||
| const server = isServer ?? router.isServer |
There was a problem hiding this comment.
we must always inline isServer ?? router.isServer, otherwise treeshaking wont happen as expected
Summary
Validation