-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
test(vue-router): virtual routes #6109
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
WalkthroughAdds two end-to-end Vue example projects demonstrating virtual file–based routing with generated route trees, nested layouts, data loaders, Vite/Tailwind configuration, Playwright E2E tests, and test server setup/teardown utilities. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes
Possibly related PRs
Suggested reviewers
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
View your CI Pipeline Execution ↗ for commit 9d27139
☁️ Nx Cloud last updated this comment at |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 28
Note
Due to the large number of review comments, Critical severity comments were prioritized as inline comments.
🧹 Nitpick comments (5)
e2e/vue-router/basic-virtual-named-export-config-file-based/src/styles.css (1)
18-20: Consider removing redundant border styling.The universal selector here applies border utilities that overlap with the border-color already set in the base layer (lines 6-12). Both rules target the same elements with border styling.
If you prefer the
@applyapproach, you can simplify by removing the base layer border styling:-@layer base { - *, - ::after, - ::before, - ::backdrop, - ::file-selector-button { - border-color: var(--color-gray-200, currentcolor); - } -} - html { color-scheme: light dark; }Or keep the base layer and remove the universal selector styling:
html { color-scheme: light dark; } -* { - @apply border-gray-200 dark:border-gray-800; -} body { @apply bg-gray-50 text-gray-950 dark:bg-gray-900 dark:text-gray-200; }e2e/vue-router/basic-virtual-file-based/src/posts.tsx (1)
31-36: Consider adding error handling for consistency.Unlike
fetchPost, this function lacks error handling. If the request fails, it could result in an unhandled promise rejection. For consistency and test reliability, consider adding a catch block similar tofetchPost.Apply this diff to add error handling:
export const fetchPosts = async () => { console.info('Fetching posts...') return axios .get<Array<PostType>>(`${queryURL}/posts`) .then((r) => r.data.slice(0, 10)) + .catch((err) => { + console.error('Error fetching posts:', err) + throw err + }) }e2e/vue-router/basic-virtual-named-export-config-file-based/src/posts.tsx (1)
10-14: Consider usingconstwith a conditional expression.Using
constwith a ternary makes the intent clearer and prevents accidental reassignment.-let queryURL = 'https://jsonplaceholder.typicode.com' - -if (import.meta.env.VITE_NODE_ENV === 'test') { - queryURL = `http://localhost:${import.meta.env.VITE_EXTERNAL_PORT}` -} +const queryURL = + import.meta.env.VITE_NODE_ENV === 'test' + ? `http://localhost:${import.meta.env.VITE_EXTERNAL_PORT}` + : 'https://jsonplaceholder.typicode.com'e2e/vue-router/basic-virtual-file-based/src/main.tsx (1)
21-21: Consider handling missing app element gracefully.The non-null assertion on Line 21 will throw a runtime error if the
appelement doesn't exist in the DOM.Consider adding a null check:
-const rootElement = document.getElementById('app')! +const rootElement = document.getElementById('app') +if (!rootElement) { + throw new Error('Root element #app not found') +}e2e/vue-router/basic-virtual-file-based/playwright.config.ts (1)
29-29: Consider extracting the webServer command for readability.The command on Line 29 is quite long and could be more maintainable if extracted to a separate script file or broken into multiple lines.
Example:
webServer: { - command: `VITE_NODE_ENV="test" VITE_EXTERNAL_PORT=${EXTERNAL_PORT} VITE_SERVER_PORT=${PORT} pnpm build && VITE_NODE_ENV="test" VITE_EXTERNAL_PORT=${EXTERNAL_PORT} VITE_SERVER_PORT=${PORT} pnpm preview --port ${PORT}`, + command: [ + `VITE_NODE_ENV="test" VITE_EXTERNAL_PORT=${EXTERNAL_PORT} VITE_SERVER_PORT=${PORT}`, + `pnpm build && pnpm preview --port ${PORT}` + ].join(' '),
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (55)
e2e/vue-router/basic-virtual-file-based/.gitignore(1 hunks)e2e/vue-router/basic-virtual-file-based/index.html(1 hunks)e2e/vue-router/basic-virtual-file-based/package.json(1 hunks)e2e/vue-router/basic-virtual-file-based/playwright.config.ts(1 hunks)e2e/vue-router/basic-virtual-file-based/postcss.config.mjs(1 hunks)e2e/vue-router/basic-virtual-file-based/routes.ts(1 hunks)e2e/vue-router/basic-virtual-file-based/src/main.tsx(1 hunks)e2e/vue-router/basic-virtual-file-based/src/posts.tsx(1 hunks)e2e/vue-router/basic-virtual-file-based/src/routeTree.gen.ts(1 hunks)e2e/vue-router/basic-virtual-file-based/src/routes/a.tsx(1 hunks)e2e/vue-router/basic-virtual-file-based/src/routes/b.tsx(1 hunks)e2e/vue-router/basic-virtual-file-based/src/routes/file-based-subtree/hello/index.tsx(1 hunks)e2e/vue-router/basic-virtual-file-based/src/routes/file-based-subtree/hello/route.tsx(1 hunks)e2e/vue-router/basic-virtual-file-based/src/routes/file-based-subtree/hello/universe.tsx(1 hunks)e2e/vue-router/basic-virtual-file-based/src/routes/file-based-subtree/hello/world.tsx(1 hunks)e2e/vue-router/basic-virtual-file-based/src/routes/home.tsx(1 hunks)e2e/vue-router/basic-virtual-file-based/src/routes/layout/first-layout.tsx(1 hunks)e2e/vue-router/basic-virtual-file-based/src/routes/layout/second-layout.tsx(1 hunks)e2e/vue-router/basic-virtual-file-based/src/routes/posts/posts-detail.tsx(1 hunks)e2e/vue-router/basic-virtual-file-based/src/routes/posts/posts-home.tsx(1 hunks)e2e/vue-router/basic-virtual-file-based/src/routes/posts/posts.tsx(1 hunks)e2e/vue-router/basic-virtual-file-based/src/routes/root.tsx(1 hunks)e2e/vue-router/basic-virtual-file-based/src/styles.css(1 hunks)e2e/vue-router/basic-virtual-file-based/tests/app.spec.ts(1 hunks)e2e/vue-router/basic-virtual-file-based/tests/setup/global.setup.ts(1 hunks)e2e/vue-router/basic-virtual-file-based/tests/setup/global.teardown.ts(1 hunks)e2e/vue-router/basic-virtual-file-based/tsconfig.json(1 hunks)e2e/vue-router/basic-virtual-file-based/vite.config.ts(1 hunks)e2e/vue-router/basic-virtual-named-export-config-file-based/.gitignore(1 hunks)e2e/vue-router/basic-virtual-named-export-config-file-based/index.html(1 hunks)e2e/vue-router/basic-virtual-named-export-config-file-based/package.json(1 hunks)e2e/vue-router/basic-virtual-named-export-config-file-based/playwright.config.ts(1 hunks)e2e/vue-router/basic-virtual-named-export-config-file-based/postcss.config.mjs(1 hunks)e2e/vue-router/basic-virtual-named-export-config-file-based/routes.ts(1 hunks)e2e/vue-router/basic-virtual-named-export-config-file-based/src/main.tsx(1 hunks)e2e/vue-router/basic-virtual-named-export-config-file-based/src/posts.tsx(1 hunks)e2e/vue-router/basic-virtual-named-export-config-file-based/src/routes/a.tsx(1 hunks)e2e/vue-router/basic-virtual-named-export-config-file-based/src/routes/b.tsx(1 hunks)e2e/vue-router/basic-virtual-named-export-config-file-based/src/routes/file-based-subtree/hello/index.tsx(1 hunks)e2e/vue-router/basic-virtual-named-export-config-file-based/src/routes/file-based-subtree/hello/route.tsx(1 hunks)e2e/vue-router/basic-virtual-named-export-config-file-based/src/routes/file-based-subtree/hello/universe.tsx(1 hunks)e2e/vue-router/basic-virtual-named-export-config-file-based/src/routes/file-based-subtree/hello/world.tsx(1 hunks)e2e/vue-router/basic-virtual-named-export-config-file-based/src/routes/home.tsx(1 hunks)e2e/vue-router/basic-virtual-named-export-config-file-based/src/routes/layout/first-layout.tsx(1 hunks)e2e/vue-router/basic-virtual-named-export-config-file-based/src/routes/layout/second-layout.tsx(1 hunks)e2e/vue-router/basic-virtual-named-export-config-file-based/src/routes/posts/posts-detail.tsx(1 hunks)e2e/vue-router/basic-virtual-named-export-config-file-based/src/routes/posts/posts-home.tsx(1 hunks)e2e/vue-router/basic-virtual-named-export-config-file-based/src/routes/posts/posts.tsx(1 hunks)e2e/vue-router/basic-virtual-named-export-config-file-based/src/routes/root.tsx(1 hunks)e2e/vue-router/basic-virtual-named-export-config-file-based/src/styles.css(1 hunks)e2e/vue-router/basic-virtual-named-export-config-file-based/tests/app.spec.ts(1 hunks)e2e/vue-router/basic-virtual-named-export-config-file-based/tests/setup/global.setup.ts(1 hunks)e2e/vue-router/basic-virtual-named-export-config-file-based/tests/setup/global.teardown.ts(1 hunks)e2e/vue-router/basic-virtual-named-export-config-file-based/tsconfig.json(1 hunks)e2e/vue-router/basic-virtual-named-export-config-file-based/vite.config.ts(1 hunks)
🧰 Additional context used
📓 Path-based instructions (3)
**/*.{ts,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
Use TypeScript strict mode with extensive type safety for all code
Files:
e2e/vue-router/basic-virtual-named-export-config-file-based/src/routes/file-based-subtree/hello/index.tsxe2e/vue-router/basic-virtual-named-export-config-file-based/tests/app.spec.tse2e/vue-router/basic-virtual-file-based/src/routes/file-based-subtree/hello/world.tsxe2e/vue-router/basic-virtual-named-export-config-file-based/src/routes/home.tsxe2e/vue-router/basic-virtual-named-export-config-file-based/tests/setup/global.setup.tse2e/vue-router/basic-virtual-file-based/src/routes/b.tsxe2e/vue-router/basic-virtual-named-export-config-file-based/src/routes/posts/posts-detail.tsxe2e/vue-router/basic-virtual-named-export-config-file-based/src/main.tsxe2e/vue-router/basic-virtual-named-export-config-file-based/src/routes/file-based-subtree/hello/universe.tsxe2e/vue-router/basic-virtual-file-based/src/routes/file-based-subtree/hello/route.tsxe2e/vue-router/basic-virtual-named-export-config-file-based/tests/setup/global.teardown.tse2e/vue-router/basic-virtual-file-based/src/routes/file-based-subtree/hello/universe.tsxe2e/vue-router/basic-virtual-file-based/src/main.tsxe2e/vue-router/basic-virtual-file-based/src/posts.tsxe2e/vue-router/basic-virtual-named-export-config-file-based/src/routes/file-based-subtree/hello/world.tsxe2e/vue-router/basic-virtual-named-export-config-file-based/src/routes/root.tsxe2e/vue-router/basic-virtual-file-based/src/routes/posts/posts-home.tsxe2e/vue-router/basic-virtual-named-export-config-file-based/routes.tse2e/vue-router/basic-virtual-file-based/routes.tse2e/vue-router/basic-virtual-file-based/src/routes/file-based-subtree/hello/index.tsxe2e/vue-router/basic-virtual-named-export-config-file-based/src/routes/posts/posts.tsxe2e/vue-router/basic-virtual-named-export-config-file-based/src/posts.tsxe2e/vue-router/basic-virtual-named-export-config-file-based/src/routes/b.tsxe2e/vue-router/basic-virtual-file-based/vite.config.tse2e/vue-router/basic-virtual-file-based/playwright.config.tse2e/vue-router/basic-virtual-named-export-config-file-based/src/routes/file-based-subtree/hello/route.tsxe2e/vue-router/basic-virtual-named-export-config-file-based/vite.config.tse2e/vue-router/basic-virtual-file-based/src/routes/root.tsxe2e/vue-router/basic-virtual-named-export-config-file-based/src/routes/layout/second-layout.tsxe2e/vue-router/basic-virtual-file-based/src/routes/posts/posts-detail.tsxe2e/vue-router/basic-virtual-file-based/tests/app.spec.tse2e/vue-router/basic-virtual-file-based/src/routes/posts/posts.tsxe2e/vue-router/basic-virtual-file-based/tests/setup/global.setup.tse2e/vue-router/basic-virtual-file-based/src/routes/home.tsxe2e/vue-router/basic-virtual-named-export-config-file-based/src/routes/layout/first-layout.tsxe2e/vue-router/basic-virtual-file-based/src/routes/layout/second-layout.tsxe2e/vue-router/basic-virtual-file-based/src/routes/layout/first-layout.tsxe2e/vue-router/basic-virtual-named-export-config-file-based/src/routes/a.tsxe2e/vue-router/basic-virtual-file-based/tests/setup/global.teardown.tse2e/vue-router/basic-virtual-file-based/src/routes/a.tsxe2e/vue-router/basic-virtual-named-export-config-file-based/src/routes/posts/posts-home.tsxe2e/vue-router/basic-virtual-named-export-config-file-based/playwright.config.tse2e/vue-router/basic-virtual-file-based/src/routeTree.gen.ts
**/*.{js,ts,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
Implement ESLint rules for router best practices using the ESLint plugin router
Files:
e2e/vue-router/basic-virtual-named-export-config-file-based/src/routes/file-based-subtree/hello/index.tsxe2e/vue-router/basic-virtual-named-export-config-file-based/tests/app.spec.tse2e/vue-router/basic-virtual-file-based/src/routes/file-based-subtree/hello/world.tsxe2e/vue-router/basic-virtual-named-export-config-file-based/src/routes/home.tsxe2e/vue-router/basic-virtual-named-export-config-file-based/tests/setup/global.setup.tse2e/vue-router/basic-virtual-file-based/src/routes/b.tsxe2e/vue-router/basic-virtual-named-export-config-file-based/src/routes/posts/posts-detail.tsxe2e/vue-router/basic-virtual-named-export-config-file-based/src/main.tsxe2e/vue-router/basic-virtual-named-export-config-file-based/src/routes/file-based-subtree/hello/universe.tsxe2e/vue-router/basic-virtual-file-based/src/routes/file-based-subtree/hello/route.tsxe2e/vue-router/basic-virtual-named-export-config-file-based/tests/setup/global.teardown.tse2e/vue-router/basic-virtual-file-based/src/routes/file-based-subtree/hello/universe.tsxe2e/vue-router/basic-virtual-file-based/src/main.tsxe2e/vue-router/basic-virtual-file-based/src/posts.tsxe2e/vue-router/basic-virtual-named-export-config-file-based/src/routes/file-based-subtree/hello/world.tsxe2e/vue-router/basic-virtual-named-export-config-file-based/src/routes/root.tsxe2e/vue-router/basic-virtual-file-based/src/routes/posts/posts-home.tsxe2e/vue-router/basic-virtual-named-export-config-file-based/routes.tse2e/vue-router/basic-virtual-file-based/routes.tse2e/vue-router/basic-virtual-file-based/src/routes/file-based-subtree/hello/index.tsxe2e/vue-router/basic-virtual-named-export-config-file-based/src/routes/posts/posts.tsxe2e/vue-router/basic-virtual-named-export-config-file-based/src/posts.tsxe2e/vue-router/basic-virtual-named-export-config-file-based/src/routes/b.tsxe2e/vue-router/basic-virtual-file-based/vite.config.tse2e/vue-router/basic-virtual-file-based/playwright.config.tse2e/vue-router/basic-virtual-named-export-config-file-based/src/routes/file-based-subtree/hello/route.tsxe2e/vue-router/basic-virtual-named-export-config-file-based/vite.config.tse2e/vue-router/basic-virtual-file-based/src/routes/root.tsxe2e/vue-router/basic-virtual-named-export-config-file-based/src/routes/layout/second-layout.tsxe2e/vue-router/basic-virtual-file-based/src/routes/posts/posts-detail.tsxe2e/vue-router/basic-virtual-file-based/tests/app.spec.tse2e/vue-router/basic-virtual-file-based/src/routes/posts/posts.tsxe2e/vue-router/basic-virtual-file-based/tests/setup/global.setup.tse2e/vue-router/basic-virtual-file-based/src/routes/home.tsxe2e/vue-router/basic-virtual-named-export-config-file-based/src/routes/layout/first-layout.tsxe2e/vue-router/basic-virtual-file-based/src/routes/layout/second-layout.tsxe2e/vue-router/basic-virtual-file-based/src/routes/layout/first-layout.tsxe2e/vue-router/basic-virtual-named-export-config-file-based/src/routes/a.tsxe2e/vue-router/basic-virtual-file-based/tests/setup/global.teardown.tse2e/vue-router/basic-virtual-file-based/src/routes/a.tsxe2e/vue-router/basic-virtual-named-export-config-file-based/src/routes/posts/posts-home.tsxe2e/vue-router/basic-virtual-named-export-config-file-based/playwright.config.tse2e/vue-router/basic-virtual-file-based/src/routeTree.gen.ts
**/package.json
📄 CodeRabbit inference engine (AGENTS.md)
Use workspace protocol
workspace:*for internal dependencies in package.json files
Files:
e2e/vue-router/basic-virtual-named-export-config-file-based/package.jsone2e/vue-router/basic-virtual-file-based/package.json
🧠 Learnings (9)
📓 Common learnings
Learnt from: nlynzaad
Repo: TanStack/router PR: 5402
File: packages/router-generator/tests/generator/no-formatted-route-tree/routeTree.nonnested.snapshot.ts:19-21
Timestamp: 2025-10-08T08:11:47.088Z
Learning: Test snapshot files in the router-generator tests directory (e.g., files matching the pattern `packages/router-generator/tests/generator/**/routeTree*.snapshot.ts` or `routeTree*.snapshot.js`) should not be modified or have issues flagged, as they are fixtures used to verify the generator's output and are intentionally preserved as-is.
Learnt from: FatahChan
Repo: TanStack/router PR: 5475
File: e2e/react-start/basic-prerendering/src/routes/redirect/$target/via-beforeLoad.tsx:8-0
Timestamp: 2025-10-14T18:59:33.990Z
Learning: In TanStack Router e2e test files, when a route parameter is validated at the route level (e.g., using zod in validateSearch or param validation), switch statements on that parameter do not require a default case, as the validation ensures only expected values will reach the switch.
Learnt from: CR
Repo: TanStack/router PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-06T15:03:07.223Z
Learning: Use file-based routing in `src/routes/` directories or code-based routing with route definitions
📚 Learning: 2025-10-08T08:11:47.088Z
Learnt from: nlynzaad
Repo: TanStack/router PR: 5402
File: packages/router-generator/tests/generator/no-formatted-route-tree/routeTree.nonnested.snapshot.ts:19-21
Timestamp: 2025-10-08T08:11:47.088Z
Learning: Test snapshot files in the router-generator tests directory (e.g., files matching the pattern `packages/router-generator/tests/generator/**/routeTree*.snapshot.ts` or `routeTree*.snapshot.js`) should not be modified or have issues flagged, as they are fixtures used to verify the generator's output and are intentionally preserved as-is.
Applied to files:
e2e/vue-router/basic-virtual-named-export-config-file-based/src/routes/file-based-subtree/hello/index.tsxe2e/vue-router/basic-virtual-named-export-config-file-based/tests/app.spec.tse2e/vue-router/basic-virtual-named-export-config-file-based/src/routes/home.tsxe2e/vue-router/basic-virtual-file-based/src/routes/b.tsxe2e/vue-router/basic-virtual-named-export-config-file-based/src/routes/posts/posts-detail.tsxe2e/vue-router/basic-virtual-named-export-config-file-based/src/routes/file-based-subtree/hello/universe.tsxe2e/vue-router/basic-virtual-named-export-config-file-based/index.htmle2e/vue-router/basic-virtual-named-export-config-file-based/tests/setup/global.teardown.tse2e/vue-router/basic-virtual-file-based/src/main.tsxe2e/vue-router/basic-virtual-named-export-config-file-based/src/routes/file-based-subtree/hello/world.tsxe2e/vue-router/basic-virtual-named-export-config-file-based/src/routes/root.tsxe2e/vue-router/basic-virtual-named-export-config-file-based/routes.tse2e/vue-router/basic-virtual-file-based/routes.tse2e/vue-router/basic-virtual-file-based/src/routes/file-based-subtree/hello/index.tsxe2e/vue-router/basic-virtual-named-export-config-file-based/src/routes/posts/posts.tsxe2e/vue-router/basic-virtual-file-based/.gitignoree2e/vue-router/basic-virtual-named-export-config-file-based/src/routes/b.tsxe2e/vue-router/basic-virtual-named-export-config-file-based/src/routes/file-based-subtree/hello/route.tsxe2e/vue-router/basic-virtual-file-based/src/routes/root.tsxe2e/vue-router/basic-virtual-named-export-config-file-based/package.jsone2e/vue-router/basic-virtual-named-export-config-file-based/src/routes/layout/second-layout.tsxe2e/vue-router/basic-virtual-file-based/index.htmle2e/vue-router/basic-virtual-file-based/tests/app.spec.tse2e/vue-router/basic-virtual-file-based/src/routes/posts/posts.tsxe2e/vue-router/basic-virtual-named-export-config-file-based/.gitignoree2e/vue-router/basic-virtual-file-based/tsconfig.jsone2e/vue-router/basic-virtual-file-based/tests/setup/global.setup.tse2e/vue-router/basic-virtual-named-export-config-file-based/tsconfig.jsone2e/vue-router/basic-virtual-file-based/src/routes/home.tsxe2e/vue-router/basic-virtual-file-based/src/routes/layout/second-layout.tsxe2e/vue-router/basic-virtual-file-based/src/routes/layout/first-layout.tsxe2e/vue-router/basic-virtual-named-export-config-file-based/src/routes/a.tsxe2e/vue-router/basic-virtual-file-based/tests/setup/global.teardown.tse2e/vue-router/basic-virtual-file-based/src/routes/a.tsxe2e/vue-router/basic-virtual-named-export-config-file-based/src/routes/posts/posts-home.tsxe2e/vue-router/basic-virtual-file-based/package.jsone2e/vue-router/basic-virtual-file-based/src/routeTree.gen.ts
📚 Learning: 2025-12-06T15:03:07.223Z
Learnt from: CR
Repo: TanStack/router PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-06T15:03:07.223Z
Learning: Use file-based routing in `src/routes/` directories or code-based routing with route definitions
Applied to files:
e2e/vue-router/basic-virtual-named-export-config-file-based/src/routes/file-based-subtree/hello/index.tsxe2e/vue-router/basic-virtual-file-based/src/routes/file-based-subtree/hello/world.tsxe2e/vue-router/basic-virtual-named-export-config-file-based/src/routes/home.tsxe2e/vue-router/basic-virtual-file-based/src/routes/b.tsxe2e/vue-router/basic-virtual-file-based/src/routes/posts/posts-home.tsxe2e/vue-router/basic-virtual-named-export-config-file-based/routes.tse2e/vue-router/basic-virtual-file-based/routes.tse2e/vue-router/basic-virtual-file-based/src/routes/file-based-subtree/hello/index.tsxe2e/vue-router/basic-virtual-named-export-config-file-based/src/routes/posts/posts.tsxe2e/vue-router/basic-virtual-named-export-config-file-based/src/routes/b.tsxe2e/vue-router/basic-virtual-named-export-config-file-based/src/routes/file-based-subtree/hello/route.tsxe2e/vue-router/basic-virtual-file-based/src/routes/posts/posts.tsxe2e/vue-router/basic-virtual-file-based/src/routes/home.tsxe2e/vue-router/basic-virtual-named-export-config-file-based/src/routes/layout/first-layout.tsxe2e/vue-router/basic-virtual-file-based/src/routes/layout/second-layout.tsxe2e/vue-router/basic-virtual-file-based/src/routes/layout/first-layout.tsxe2e/vue-router/basic-virtual-named-export-config-file-based/src/routes/a.tsxe2e/vue-router/basic-virtual-file-based/src/routes/a.tsxe2e/vue-router/basic-virtual-named-export-config-file-based/src/routes/posts/posts-home.tsxe2e/vue-router/basic-virtual-file-based/src/routeTree.gen.ts
📚 Learning: 2025-12-06T15:03:07.223Z
Learnt from: CR
Repo: TanStack/router PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-06T15:03:07.223Z
Learning: Applies to **/*.{js,ts,tsx} : Implement ESLint rules for router best practices using the ESLint plugin router
Applied to files:
e2e/vue-router/basic-virtual-named-export-config-file-based/tests/app.spec.tse2e/vue-router/basic-virtual-named-export-config-file-based/src/routes/home.tsxe2e/vue-router/basic-virtual-file-based/src/routes/b.tsxe2e/vue-router/basic-virtual-named-export-config-file-based/src/routes/posts/posts-detail.tsxe2e/vue-router/basic-virtual-named-export-config-file-based/src/main.tsxe2e/vue-router/basic-virtual-file-based/src/main.tsxe2e/vue-router/basic-virtual-named-export-config-file-based/src/routes/file-based-subtree/hello/world.tsxe2e/vue-router/basic-virtual-named-export-config-file-based/src/routes/root.tsxe2e/vue-router/basic-virtual-file-based/src/routes/posts/posts-home.tsxe2e/vue-router/basic-virtual-named-export-config-file-based/routes.tse2e/vue-router/basic-virtual-file-based/routes.tse2e/vue-router/basic-virtual-file-based/src/routes/file-based-subtree/hello/index.tsxe2e/vue-router/basic-virtual-named-export-config-file-based/src/routes/posts/posts.tsxe2e/vue-router/basic-virtual-named-export-config-file-based/src/routes/b.tsxe2e/vue-router/basic-virtual-named-export-config-file-based/src/routes/file-based-subtree/hello/route.tsxe2e/vue-router/basic-virtual-file-based/src/routes/root.tsxe2e/vue-router/basic-virtual-named-export-config-file-based/package.jsone2e/vue-router/basic-virtual-named-export-config-file-based/src/routes/layout/second-layout.tsxe2e/vue-router/basic-virtual-file-based/src/routes/posts/posts-detail.tsxe2e/vue-router/basic-virtual-file-based/src/routes/posts/posts.tsxe2e/vue-router/basic-virtual-named-export-config-file-based/.gitignoree2e/vue-router/basic-virtual-file-based/tsconfig.jsone2e/vue-router/basic-virtual-named-export-config-file-based/tsconfig.jsone2e/vue-router/basic-virtual-file-based/src/routes/home.tsxe2e/vue-router/basic-virtual-file-based/src/routes/layout/second-layout.tsxe2e/vue-router/basic-virtual-file-based/src/routes/layout/first-layout.tsxe2e/vue-router/basic-virtual-named-export-config-file-based/src/routes/a.tsxe2e/vue-router/basic-virtual-file-based/src/routes/a.tsxe2e/vue-router/basic-virtual-named-export-config-file-based/src/routes/posts/posts-home.tsxe2e/vue-router/basic-virtual-file-based/package.json
📚 Learning: 2025-11-02T16:16:24.898Z
Learnt from: nlynzaad
Repo: TanStack/router PR: 5732
File: packages/start-client-core/src/client/hydrateStart.ts:6-9
Timestamp: 2025-11-02T16:16:24.898Z
Learning: In packages/start-client-core/src/client/hydrateStart.ts, the `import/no-duplicates` ESLint disable is necessary for imports from `#tanstack-router-entry` and `#tanstack-start-entry` because both aliases resolve to the same placeholder file (`fake-start-entry.js`) in package.json during static analysis, even though they resolve to different files at runtime.
Applied to files:
e2e/vue-router/basic-virtual-named-export-config-file-based/tests/setup/global.setup.tse2e/vue-router/basic-virtual-named-export-config-file-based/src/main.tsxe2e/vue-router/basic-virtual-file-based/src/main.tsxe2e/vue-router/basic-virtual-named-export-config-file-based/package.jsone2e/vue-router/basic-virtual-file-based/tests/setup/global.setup.tse2e/vue-router/basic-virtual-named-export-config-file-based/tsconfig.jsone2e/vue-router/basic-virtual-file-based/package.json
📚 Learning: 2025-10-09T12:59:14.842Z
Learnt from: hokkyss
Repo: TanStack/router PR: 5418
File: e2e/react-start/custom-identifier-prefix/public/site.webmanifest:2-3
Timestamp: 2025-10-09T12:59:14.842Z
Learning: In e2e test fixtures (files under e2e directories), empty or placeholder values in configuration files like site.webmanifest are acceptable and should not be flagged unless the test specifically validates those fields.
Applied to files:
e2e/vue-router/basic-virtual-named-export-config-file-based/tests/setup/global.setup.tse2e/vue-router/basic-virtual-file-based/playwright.config.tse2e/vue-router/basic-virtual-named-export-config-file-based/playwright.config.ts
📚 Learning: 2025-10-01T18:31:35.420Z
Learnt from: schiller-manuel
Repo: TanStack/router PR: 5330
File: e2e/react-start/custom-basepath/src/routeTree.gen.ts:58-61
Timestamp: 2025-10-01T18:31:35.420Z
Learning: Do not review files named `routeTree.gen.ts` in TanStack Router repositories, as these are autogenerated files that should not be manually modified.
Applied to files:
e2e/vue-router/basic-virtual-file-based/src/main.tsxe2e/vue-router/basic-virtual-named-export-config-file-based/src/routes/root.tsxe2e/vue-router/basic-virtual-named-export-config-file-based/routes.tse2e/vue-router/basic-virtual-file-based/routes.tse2e/vue-router/basic-virtual-file-based/src/routes/file-based-subtree/hello/index.tsxe2e/vue-router/basic-virtual-file-based/.gitignoree2e/vue-router/basic-virtual-named-export-config-file-based/src/routes/b.tsxe2e/vue-router/basic-virtual-file-based/src/routes/root.tsxe2e/vue-router/basic-virtual-named-export-config-file-based/package.jsone2e/vue-router/basic-virtual-named-export-config-file-based/.gitignoree2e/vue-router/basic-virtual-file-based/tsconfig.jsone2e/vue-router/basic-virtual-file-based/src/routes/layout/first-layout.tsxe2e/vue-router/basic-virtual-file-based/src/routes/a.tsxe2e/vue-router/basic-virtual-file-based/package.jsone2e/vue-router/basic-virtual-file-based/src/routeTree.gen.ts
📚 Learning: 2025-10-09T12:59:02.129Z
Learnt from: hokkyss
Repo: TanStack/router PR: 5418
File: e2e/react-start/custom-identifier-prefix/src/styles/app.css:19-21
Timestamp: 2025-10-09T12:59:02.129Z
Learning: In e2e test directories (paths containing `e2e/`), accessibility concerns like outline suppression patterns are less critical since the code is for testing purposes, not production use.
Applied to files:
e2e/vue-router/basic-virtual-file-based/.gitignore
📚 Learning: 2025-12-06T15:03:07.223Z
Learnt from: CR
Repo: TanStack/router PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-06T15:03:07.223Z
Learning: Applies to **/*.{ts,tsx} : Use TypeScript strict mode with extensive type safety for all code
Applied to files:
e2e/vue-router/basic-virtual-file-based/tsconfig.jsone2e/vue-router/basic-virtual-named-export-config-file-based/tsconfig.json
🧬 Code graph analysis (32)
e2e/vue-router/basic-virtual-named-export-config-file-based/src/routes/file-based-subtree/hello/index.tsx (3)
e2e/vue-router/basic-virtual-named-export-config-file-based/src/routes/a.tsx (1)
Route(1-3)e2e/vue-router/basic-virtual-named-export-config-file-based/src/routes/b.tsx (1)
Route(1-3)e2e/vue-router/basic-virtual-named-export-config-file-based/src/routes/file-based-subtree/hello/route.tsx (1)
Route(3-27)
e2e/vue-router/basic-virtual-file-based/src/routes/file-based-subtree/hello/world.tsx (3)
e2e/vue-router/basic-virtual-file-based/src/routes/file-based-subtree/hello/index.tsx (1)
Route(1-3)e2e/vue-router/basic-virtual-file-based/src/routes/file-based-subtree/hello/route.tsx (1)
Route(3-27)e2e/vue-router/basic-virtual-file-based/src/routes/file-based-subtree/hello/universe.tsx (1)
Route(1-3)
e2e/vue-router/basic-virtual-named-export-config-file-based/src/routes/home.tsx (2)
e2e/vue-router/basic-virtual-named-export-config-file-based/src/routes/a.tsx (1)
Route(1-3)e2e/vue-router/basic-virtual-named-export-config-file-based/src/routes/b.tsx (1)
Route(1-3)
e2e/vue-router/basic-virtual-named-export-config-file-based/src/routes/posts/posts-detail.tsx (2)
e2e/vue-router/basic-virtual-file-based/src/routes/root.tsx (1)
Route(9-19)e2e/vue-router/basic-virtual-named-export-config-file-based/src/posts.tsx (1)
fetchPost(16-29)
e2e/vue-router/basic-virtual-named-export-config-file-based/src/main.tsx (1)
e2e/solid-router/js-only-file-based/src/main.jsx (1)
rootElement(14-14)
e2e/vue-router/basic-virtual-named-export-config-file-based/src/routes/file-based-subtree/hello/universe.tsx (5)
e2e/vue-router/basic-virtual-file-based/src/routes/file-based-subtree/hello/index.tsx (1)
Route(1-3)e2e/vue-router/basic-virtual-file-based/src/routes/file-based-subtree/hello/route.tsx (1)
Route(3-27)e2e/vue-router/basic-virtual-file-based/src/routes/file-based-subtree/hello/world.tsx (1)
Route(1-3)e2e/vue-router/basic-virtual-file-based/src/routes/posts/posts-home.tsx (1)
Route(1-3)e2e/vue-router/basic-virtual-named-export-config-file-based/src/routes/file-based-subtree/hello/index.tsx (1)
Route(1-3)
e2e/vue-router/basic-virtual-file-based/src/routes/file-based-subtree/hello/route.tsx (3)
e2e/vue-router/basic-virtual-file-based/src/routes/file-based-subtree/hello/universe.tsx (1)
Route(1-3)e2e/vue-router/basic-virtual-file-based/src/routes/file-based-subtree/hello/world.tsx (1)
Route(1-3)e2e/vue-router/basic-virtual-named-export-config-file-based/src/routes/file-based-subtree/hello/route.tsx (1)
Route(3-27)
e2e/vue-router/basic-virtual-named-export-config-file-based/tests/setup/global.teardown.ts (2)
e2e/vue-router/basic-virtual-file-based/tests/setup/global.teardown.ts (1)
teardown(4-6)scripts/set-ts-version.js (1)
packageJson(33-33)
e2e/vue-router/basic-virtual-file-based/src/routes/file-based-subtree/hello/universe.tsx (3)
e2e/vue-router/basic-virtual-file-based/src/routes/file-based-subtree/hello/index.tsx (1)
Route(1-3)e2e/vue-router/basic-virtual-file-based/src/routes/file-based-subtree/hello/route.tsx (1)
Route(3-27)e2e/vue-router/basic-virtual-file-based/src/routes/file-based-subtree/hello/world.tsx (1)
Route(1-3)
e2e/vue-router/basic-virtual-file-based/src/main.tsx (1)
e2e/solid-router/js-only-file-based/src/main.jsx (1)
rootElement(14-14)
e2e/vue-router/basic-virtual-file-based/src/posts.tsx (1)
e2e/vue-router/basic-virtual-named-export-config-file-based/src/posts.tsx (3)
PostType(4-8)fetchPost(16-29)fetchPosts(31-36)
e2e/vue-router/basic-virtual-named-export-config-file-based/src/routes/root.tsx (3)
e2e/vue-router/basic-virtual-file-based/src/routes/root.tsx (1)
Route(9-19)e2e/vue-router/basic-virtual-named-export-config-file-based/src/routes/a.tsx (1)
Route(1-3)e2e/vue-router/basic-virtual-named-export-config-file-based/src/routes/b.tsx (1)
Route(1-3)
e2e/vue-router/basic-virtual-file-based/src/routes/posts/posts-home.tsx (3)
e2e/vue-router/basic-virtual-file-based/src/routes/file-based-subtree/hello/route.tsx (1)
Route(3-27)e2e/vue-router/basic-virtual-file-based/src/routes/home.tsx (1)
Route(1-3)e2e/vue-router/basic-virtual-file-based/src/routes/posts/posts.tsx (1)
Route(4-7)
e2e/vue-router/basic-virtual-named-export-config-file-based/routes.ts (1)
e2e/vue-router/basic-virtual-file-based/routes.ts (1)
routes(9-22)
e2e/vue-router/basic-virtual-named-export-config-file-based/src/routes/posts/posts.tsx (2)
e2e/vue-router/basic-virtual-file-based/src/routes/posts/posts.tsx (1)
Route(4-7)e2e/vue-router/basic-virtual-file-based/src/posts.tsx (1)
fetchPosts(31-36)
e2e/vue-router/basic-virtual-named-export-config-file-based/src/posts.tsx (1)
e2e/vue-router/basic-virtual-file-based/src/posts.tsx (3)
PostType(4-8)fetchPost(16-29)fetchPosts(31-36)
e2e/vue-router/basic-virtual-named-export-config-file-based/src/routes/b.tsx (3)
e2e/vue-router/basic-virtual-named-export-config-file-based/src/routes/a.tsx (1)
Route(1-3)e2e/vue-router/basic-virtual-named-export-config-file-based/src/routes/file-based-subtree/hello/index.tsx (1)
Route(1-3)e2e/vue-router/basic-virtual-named-export-config-file-based/src/routes/file-based-subtree/hello/route.tsx (1)
Route(3-27)
e2e/vue-router/basic-virtual-file-based/vite.config.ts (2)
e2e/vue-router/basic-virtual-file-based/routes.ts (1)
routes(9-22)e2e/vue-router/basic-virtual-named-export-config-file-based/routes.ts (1)
routes(9-22)
e2e/vue-router/basic-virtual-file-based/playwright.config.ts (1)
scripts/set-ts-version.js (1)
packageJson(33-33)
e2e/vue-router/basic-virtual-named-export-config-file-based/src/routes/file-based-subtree/hello/route.tsx (1)
e2e/vue-router/basic-virtual-file-based/src/routes/file-based-subtree/hello/route.tsx (1)
Route(3-27)
e2e/vue-router/basic-virtual-named-export-config-file-based/src/routes/layout/second-layout.tsx (4)
e2e/vue-router/basic-virtual-file-based/src/routes/layout/first-layout.tsx (1)
Route(3-5)e2e/vue-router/basic-virtual-file-based/src/routes/layout/second-layout.tsx (1)
Route(3-5)e2e/vue-router/basic-virtual-named-export-config-file-based/src/routes/a.tsx (1)
Route(1-3)e2e/vue-router/basic-virtual-named-export-config-file-based/src/routes/b.tsx (1)
Route(1-3)
e2e/vue-router/basic-virtual-file-based/src/routes/posts/posts-detail.tsx (2)
e2e/vue-router/basic-virtual-named-export-config-file-based/src/routes/posts/posts-detail.tsx (1)
PostErrorComponent(5-7)e2e/vue-router/basic-virtual-file-based/src/posts.tsx (1)
fetchPost(16-29)
e2e/vue-router/basic-virtual-file-based/src/routes/posts/posts.tsx (2)
e2e/vue-router/basic-virtual-file-based/src/routes/posts/posts-detail.tsx (1)
Route(9-16)e2e/vue-router/basic-virtual-file-based/src/posts.tsx (1)
fetchPosts(31-36)
e2e/vue-router/basic-virtual-file-based/tests/setup/global.setup.ts (1)
scripts/set-ts-version.js (1)
packageJson(33-33)
e2e/vue-router/basic-virtual-file-based/src/routes/home.tsx (14)
e2e/vue-router/basic-virtual-file-based/src/routes/a.tsx (1)
Route(1-3)e2e/vue-router/basic-virtual-file-based/src/routes/b.tsx (1)
Route(1-3)e2e/vue-router/basic-virtual-file-based/src/routes/file-based-subtree/hello/index.tsx (1)
Route(1-3)e2e/vue-router/basic-virtual-file-based/src/routes/file-based-subtree/hello/universe.tsx (1)
Route(1-3)e2e/vue-router/basic-virtual-file-based/src/routes/file-based-subtree/hello/world.tsx (1)
Route(1-3)e2e/vue-router/basic-virtual-file-based/src/routes/layout/first-layout.tsx (1)
Route(3-5)e2e/vue-router/basic-virtual-file-based/src/routes/layout/second-layout.tsx (1)
Route(3-5)e2e/vue-router/basic-virtual-file-based/src/routes/posts/posts-detail.tsx (1)
Route(9-16)e2e/vue-router/basic-virtual-file-based/src/routes/posts/posts-home.tsx (1)
Route(1-3)e2e/vue-router/basic-virtual-file-based/src/routes/posts/posts.tsx (1)
Route(4-7)e2e/vue-router/basic-virtual-file-based/src/routes/root.tsx (1)
Route(9-19)e2e/vue-router/basic-virtual-named-export-config-file-based/src/routes/a.tsx (1)
Route(1-3)e2e/vue-router/basic-virtual-named-export-config-file-based/src/routes/b.tsx (1)
Route(1-3)e2e/vue-router/basic-virtual-named-export-config-file-based/src/routes/file-based-subtree/hello/index.tsx (1)
Route(1-3)
e2e/vue-router/basic-virtual-named-export-config-file-based/src/routes/layout/first-layout.tsx (1)
e2e/vue-router/basic-virtual-file-based/src/routes/file-based-subtree/hello/route.tsx (1)
Route(3-27)
e2e/vue-router/basic-virtual-file-based/src/routes/layout/second-layout.tsx (11)
e2e/vue-router/basic-virtual-file-based/src/routes/a.tsx (1)
Route(1-3)e2e/vue-router/basic-virtual-file-based/src/routes/b.tsx (1)
Route(1-3)e2e/vue-router/basic-virtual-file-based/src/routes/file-based-subtree/hello/route.tsx (1)
Route(3-27)e2e/vue-router/basic-virtual-file-based/src/routes/file-based-subtree/hello/universe.tsx (1)
Route(1-3)e2e/vue-router/basic-virtual-file-based/src/routes/file-based-subtree/hello/world.tsx (1)
Route(1-3)e2e/vue-router/basic-virtual-file-based/src/routes/home.tsx (1)
Route(1-3)e2e/vue-router/basic-virtual-file-based/src/routes/layout/first-layout.tsx (1)
Route(3-5)e2e/vue-router/basic-virtual-file-based/src/routes/posts/posts-detail.tsx (1)
Route(9-16)e2e/vue-router/basic-virtual-file-based/src/routes/posts/posts.tsx (1)
Route(4-7)e2e/vue-router/basic-virtual-file-based/src/routes/root.tsx (1)
Route(9-19)e2e/vue-router/basic-virtual-named-export-config-file-based/src/routes/file-based-subtree/hello/route.tsx (1)
Route(3-27)
e2e/vue-router/basic-virtual-file-based/src/routes/layout/first-layout.tsx (6)
e2e/vue-router/basic-virtual-file-based/src/routes/a.tsx (1)
Route(1-3)e2e/vue-router/basic-virtual-file-based/src/routes/b.tsx (1)
Route(1-3)e2e/vue-router/basic-virtual-file-based/src/routes/file-based-subtree/hello/route.tsx (1)
Route(3-27)e2e/vue-router/basic-virtual-file-based/src/routes/home.tsx (1)
Route(1-3)e2e/vue-router/basic-virtual-file-based/src/routes/layout/second-layout.tsx (1)
Route(3-5)e2e/vue-router/basic-virtual-file-based/src/routes/posts/posts.tsx (1)
Route(4-7)
e2e/vue-router/basic-virtual-named-export-config-file-based/src/routes/a.tsx (6)
e2e/vue-router/basic-virtual-file-based/src/routes/a.tsx (1)
Route(1-3)e2e/vue-router/basic-virtual-file-based/src/routes/file-based-subtree/hello/route.tsx (1)
Route(3-27)e2e/vue-router/basic-virtual-file-based/src/routes/posts/posts.tsx (1)
Route(4-7)e2e/vue-router/basic-virtual-file-based/src/routes/root.tsx (1)
Route(9-19)e2e/vue-router/basic-virtual-named-export-config-file-based/src/routes/b.tsx (1)
Route(1-3)e2e/vue-router/basic-virtual-named-export-config-file-based/src/routes/file-based-subtree/hello/index.tsx (1)
Route(1-3)
e2e/vue-router/basic-virtual-file-based/tests/setup/global.teardown.ts (2)
e2e/vue-router/basic-virtual-named-export-config-file-based/tests/setup/global.teardown.ts (1)
teardown(4-6)scripts/set-ts-version.js (1)
packageJson(33-33)
e2e/vue-router/basic-virtual-file-based/src/routes/a.tsx (1)
e2e/vue-router/basic-virtual-file-based/src/routes/home.tsx (1)
Route(1-3)
e2e/vue-router/basic-virtual-named-export-config-file-based/src/routes/posts/posts-home.tsx (1)
e2e/vue-router/basic-virtual-file-based/src/routes/posts/posts-home.tsx (1)
Route(1-3)
🔇 Additional comments (37)
e2e/vue-router/basic-virtual-named-export-config-file-based/.gitignore (1)
1-13: LGTM!The .gitignore configuration correctly excludes standard dependencies, build artifacts, Playwright test outputs, and the autogenerated route tree file (
src/routeTree.gen.ts). The patterns are properly formatted and comprehensive for a Vue Router e2e test project.e2e/vue-router/basic-virtual-file-based/.gitignore (1)
1-11: LGTM!Standard and well-organized
.gitignoreconfiguration for a Vue + Playwright e2e project. The ignore patterns appropriately exclude build artifacts, package dependencies, OS-specific files, and test output directories without any redundancy.e2e/vue-router/basic-virtual-named-export-config-file-based/tsconfig.json (1)
1-16: LGTM! Well-configured for Vue + Vite e2e tests.The TypeScript configuration is appropriate for this Vue Router e2e test project. It correctly enables strict mode (per coding guidelines), uses modern bundler module resolution, properly configures Vue JSX support, and includes necessary Vite client types.
e2e/vue-router/basic-virtual-named-export-config-file-based/postcss.config.mjs (1)
1-5: Configuration correctly implements Tailwind CSS v4 with PostCSS.The configuration properly adds @tailwindcss/postcss to the postcss.config.mjs file, and @tailwindcss/postcss v4.1.18 is available. The empty options object uses plugin defaults, which is valid for standard Tailwind setup. Dependencies are correctly declared in package.json.
e2e/vue-router/basic-virtual-file-based/src/posts.tsx (4)
1-2: LGTM!The imports are appropriate for the data-fetching utilities. Using
redaxiosas a lightweight HTTP client is a good choice for e2e tests.
4-8: LGTM!The type definition is correct and consistent with the sibling test suite in
basic-virtual-named-export-config-file-based/src/posts.tsx.
16-29: LGTM!The implementation correctly handles 404 errors by throwing
notFound()from TanStack Router, which integrates well with the router's error handling system. The error handling is appropriate and consistent with the sibling test suite.
10-14: No actionable concerns identified. TheVITE_NODE_ENVandVITE_EXTERNAL_PORTenvironment variables are properly configured in the Playwright configuration file where the build and preview commands are executed. These variables are successfully passed to the build process and accessible in the application code viaimport.meta.env.e2e/vue-router/basic-virtual-file-based/package.json (2)
14-24: Internal dependencies follow workspace protocol correctly.The use of
workspace:^for TanStack internal packages (@tanstack/router-plugin,@tanstack/virtual-file-routes,@tanstack/vue-router,@tanstack/vue-router-devtools,@tanstack/router-e2e-utils) aligns with the coding guidelines.
32-32: Vite version^7.1.7is stable and well-established. The latest version is 7.3.0, meaning 7.1.7 is available and mature. No action needed.e2e/vue-router/basic-virtual-file-based/src/routes/posts/posts.tsx (1)
9-37: PostsComponent implementation looks good.The component correctly:
- Uses
Route.useLoaderData()to access loader data- Renders posts as a list with navigation links
- Includes an
Outletfor nested routes- Adds a non-existent post for testing the notFound behavior
e2e/vue-router/basic-virtual-named-export-config-file-based/src/routes/posts/posts-detail.tsx (1)
18-27: PostComponent implementation is correct.The component properly uses
Route.useLoaderData()and accesses the reactive post data withpost().titleandpost().body.e2e/vue-router/basic-virtual-file-based/src/routes/posts/posts-detail.tsx (1)
18-27: PostComponent implementation is correct.The component properly uses
Route.useLoaderData()and accesses the reactive post data.e2e/vue-router/basic-virtual-named-export-config-file-based/src/posts.tsx (1)
16-36: Data fetching utilities look good.The implementation correctly:
- Types the API responses with
PostType- Handles 404 errors by throwing
notFound()from vue-router- Re-throws other errors for proper error boundary handling
- Limits posts to 10 items for the list view
e2e/vue-router/basic-virtual-named-export-config-file-based/tests/setup/global.setup.ts (1)
1-6: LGTM!The setup file correctly uses the modern JSON import assertion syntax and properly integrates with the e2e test infrastructure.
e2e/vue-router/basic-virtual-file-based/index.html (1)
1-11: LGTM!Clean HTML5 scaffold that properly bootstraps the Vue Router application with module script support.
e2e/vue-router/basic-virtual-named-export-config-file-based/tests/setup/global.teardown.ts (1)
1-6: LGTM!The teardown file correctly mirrors the setup pattern and properly stops the dummy server using the package name.
e2e/vue-router/basic-virtual-file-based/src/styles.css (1)
1-21: LGTM!Clean Tailwind CSS v4 setup with proper theme support for light and dark modes.
e2e/vue-router/basic-virtual-file-based/tests/setup/global.teardown.ts (1)
1-6: LGTM!Proper teardown implementation that cleans up the e2e dummy server. The import attributes syntax is correct and matches the modern standard.
e2e/vue-router/basic-virtual-file-based/tsconfig.json (1)
1-16: LGTM!TypeScript configuration correctly enables strict mode as required by coding guidelines and properly configures JSX for Vue with appropriate compiler options for the e2e test project.
e2e/vue-router/basic-virtual-named-export-config-file-based/package.json (1)
1-35: LGTM!Package manifest correctly uses the
workspace:^protocol for all internal TanStack dependencies as required by coding guidelines. Scripts and dependency versions are appropriate for an e2e test project.e2e/vue-router/basic-virtual-named-export-config-file-based/vite.config.ts (1)
1-18: LGTM!The Vite configuration is well-structured with appropriate plugins for Vue and TanStack Router. The virtual route configuration setup aligns with the e2e test objectives.
e2e/vue-router/basic-virtual-file-based/tests/setup/global.setup.ts (1)
1-6: LGTM!The global setup correctly initializes the e2e test server using the package name. The import attribute syntax for JSON is appropriate.
e2e/vue-router/basic-virtual-file-based/tests/app.spec.ts (1)
1-33: LGTM!The Playwright tests provide good coverage of navigation flows including posts, nested layouts, and not-found handling. The test structure and assertions are appropriate.
e2e/vue-router/basic-virtual-named-export-config-file-based/tests/app.spec.ts (1)
1-33: LGTM!The test suite mirrors the basic-virtual-file-based tests appropriately, providing consistent e2e coverage for the named-export-config variant.
e2e/vue-router/basic-virtual-file-based/src/main.tsx (1)
23-25: Clarify the purpose of the innerHTML check.The conditional rendering based on
!rootElement.innerHTMLis unconventional for a Vue app entrypoint. This pattern is typically used for SSR hydration scenarios, but there's no SSR setup evident in this e2e test.Is this intended for SSR hydration, or can it be simplified to always render?
-if (!rootElement.innerHTML) { - render(() => <RouterProvider router={router} />, rootElement) -} +render(() => <RouterProvider router={router} />, rootElement)e2e/vue-router/basic-virtual-named-export-config-file-based/src/routes/root.tsx (1)
9-75: LGTM!The root route configuration is well-structured with proper navigation, not-found handling, and devtools integration. The intentional
@ts-expect-erroron Line 60 correctly documents the test case for non-existent routes.e2e/vue-router/basic-virtual-named-export-config-file-based/src/routes/layout/second-layout.tsx (1)
7-34: LGTM!The nested layout component is well-structured with proper navigation links and outlet placement.
e2e/vue-router/basic-virtual-file-based/src/routes/root.tsx (1)
9-75: LGTM!The root route is properly configured with navigation, error handling, and devtools. The structure mirrors best practices for TanStack Vue Router.
e2e/vue-router/basic-virtual-file-based/playwright.config.ts (1)
1-41: LGTM!The Playwright configuration is well-structured with proper port management, global setup/teardown, and environment variable handling for the e2e test environment.
e2e/vue-router/basic-virtual-file-based/src/routes/layout/first-layout.tsx (1)
7-16: LGTM!The layout component correctly renders a wrapper with an outlet for nested routes.
e2e/vue-router/basic-virtual-named-export-config-file-based/src/routes/posts/posts.tsx (1)
9-38: LGTM!The posts component properly uses loader data, renders a list of posts with navigation links, and includes a test case for non-existent posts. The reactive data handling with
posts()is appropriate for Vue.e2e/vue-router/basic-virtual-file-based/routes.ts (1)
9-22: LGTM!The virtual route tree is well-structured with proper nesting of layouts, dynamic routes, and physical subtree mapping. The declarative route definition aligns with the virtual-file-routes API design.
e2e/vue-router/basic-virtual-named-export-config-file-based/routes.ts (1)
1-22: LGTM! Virtual route configuration is well-structured.The route configuration correctly uses the
@tanstack/virtual-file-routeshelpers to define a hierarchical route structure with root, index, nested routes, layouts, and physical file-based subtrees. The structure is consistent with the established pattern in the codebase.e2e/vue-router/basic-virtual-file-based/vite.config.ts (1)
1-19: LGTM! Vite configuration is correctly set up.The configuration properly integrates the TanStack Router plugin with Vue, enabling virtual file-based routing with auto code splitting. All necessary plugins are included and correctly configured.
e2e/vue-router/basic-virtual-named-export-config-file-based/playwright.config.ts (2)
8-10: LGTM! Playwright configuration is well-structured.The configuration correctly:
- Derives ports using the e2e-utils helpers for isolation
- Sets up single-worker execution for stability
- Configures the web server with proper environment variable propagation
- Defines a single Chromium project for testing
Also applies to: 14-19, 23-41
20-21: Verify the global teardown file path exists.The
globalTeardownpath references a local file'./tests/setup/global.teardown.ts', but ensure this file exists in the current directory. If the teardown is shared with thebasic-virtual-file-baseddirectory, the path may need to be updated to point to the shared file.Run this script to check if the file exists and compare with related directories:
#!/bin/bash # Check if teardown file exists in current directory if [ -f "e2e/vue-router/basic-virtual-named-export-config-file-based/tests/setup/global.teardown.ts" ]; then echo "✓ Local teardown file exists" cat e2e/vue-router/basic-virtual-named-export-config-file-based/tests/setup/global.teardown.ts else echo "✗ Local teardown file NOT found" fi # Check if it exists in the other directory if [ -f "e2e/vue-router/basic-virtual-file-based/tests/setup/global.teardown.ts" ]; then echo "✓ Teardown file exists in basic-virtual-file-based" fi # List all setup/teardown files in vue-router e2e tests fd "global\.(setup|teardown)\.ts" e2e/vue-router
| export const Route = createFileRoute({ | ||
| component: LayoutAComponent, | ||
| }) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing import for createFileRoute.
The file uses createFileRoute but doesn't import it. This will cause a compilation error.
Add the missing import at the top of the file:
+import { createFileRoute } from '@tanstack/vue-router'
+
export const Route = createFileRoute({
component: LayoutAComponent,
})📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| export const Route = createFileRoute({ | |
| component: LayoutAComponent, | |
| }) | |
| import { createFileRoute } from '@tanstack/vue-router' | |
| export const Route = createFileRoute({ | |
| component: LayoutAComponent, | |
| }) |
🤖 Prompt for AI Agents
In e2e/vue-router/basic-virtual-file-based/src/routes/a.tsx lines 1-3, the code
calls createFileRoute but doesn't import it; add a top-level import for
createFileRoute (for example: import { createFileRoute } from
'virtual:generated-pages' or from the project's routing helper module used
elsewhere) so the symbol is defined and the file compiles.
| export const Route = createFileRoute({ | ||
| component: LayoutBComponent, | ||
| }) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing import for createFileRoute.
The file uses createFileRoute but doesn't import it. This will cause a compilation error.
Add the missing import at the top of the file:
+import { createFileRoute } from '@tanstack/vue-router'
+
export const Route = createFileRoute({
component: LayoutBComponent,
})📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| export const Route = createFileRoute({ | |
| component: LayoutBComponent, | |
| }) | |
| import { createFileRoute } from '@tanstack/vue-router' | |
| export const Route = createFileRoute({ | |
| component: LayoutBComponent, | |
| }) |
🤖 Prompt for AI Agents
e2e/vue-router/basic-virtual-file-based/src/routes/b.tsx lines 1-3: the file
uses createFileRoute but doesn't import it; add an import for createFileRoute at
the top of the file (for example: import { createFileRoute } from
'virtual:generated-pages') so the symbol is defined and the file compiles.
| export const Route = createFileRoute({ | ||
| component: () => <div>This is the index</div>, | ||
| }) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing import for createFileRoute.
The createFileRoute function is used but never imported, which will cause a ReferenceError at runtime.
Apply this diff to add the missing import:
+import { createFileRoute } from '@tanstack/vue-router'
+
export const Route = createFileRoute({
component: () => <div>This is the index</div>,
})📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| export const Route = createFileRoute({ | |
| component: () => <div>This is the index</div>, | |
| }) | |
| import { createFileRoute } from '@tanstack/vue-router' | |
| export const Route = createFileRoute({ | |
| component: () => <div>This is the index</div>, | |
| }) |
🤖 Prompt for AI Agents
In
e2e/vue-router/basic-virtual-file-based/src/routes/file-based-subtree/hello/index.tsx
lines 1-3, the createFileRoute function is used but not imported; add an import
for createFileRoute from its module (where other routes import it from in the
project, e.g., the router utilities) at the top of this file and then keep the
existing export unchanged so the component can reference createFileRoute without
causing a ReferenceError.
| import { Link, Outlet } from '@tanstack/vue-router' | ||
|
|
||
| export const Route = createFileRoute({ | ||
| component: () => ( | ||
| <div> | ||
| Hello! | ||
| <br />{' '} | ||
| <Link | ||
| to="/classic/hello/universe" | ||
| activeProps={{ | ||
| class: 'font-bold', | ||
| }} | ||
| > | ||
| say hello to the universe | ||
| </Link>{' '} | ||
| <Link | ||
| to="/classic/hello/world" | ||
| activeProps={{ | ||
| class: 'font-bold', | ||
| }} | ||
| > | ||
| say hello to the world | ||
| </Link> | ||
| <Outlet /> | ||
| </div> | ||
| ), | ||
| }) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing import for createFileRoute.
The function createFileRoute is called but never imported, which will cause a ReferenceError at runtime.
Apply this diff to add the missing import:
-import { Link, Outlet } from '@tanstack/vue-router'
+import { createFileRoute, Link, Outlet } from '@tanstack/vue-router'
export const Route = createFileRoute({📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| import { Link, Outlet } from '@tanstack/vue-router' | |
| export const Route = createFileRoute({ | |
| component: () => ( | |
| <div> | |
| Hello! | |
| <br />{' '} | |
| <Link | |
| to="/classic/hello/universe" | |
| activeProps={{ | |
| class: 'font-bold', | |
| }} | |
| > | |
| say hello to the universe | |
| </Link>{' '} | |
| <Link | |
| to="/classic/hello/world" | |
| activeProps={{ | |
| class: 'font-bold', | |
| }} | |
| > | |
| say hello to the world | |
| </Link> | |
| <Outlet /> | |
| </div> | |
| ), | |
| }) | |
| import { createFileRoute, Link, Outlet } from '@tanstack/vue-router' | |
| export const Route = createFileRoute({ | |
| component: () => ( | |
| <div> | |
| Hello! | |
| <br />{' '} | |
| <Link | |
| to="/classic/hello/universe" | |
| activeProps={{ | |
| class: 'font-bold', | |
| }} | |
| > | |
| say hello to the universe | |
| </Link>{' '} | |
| <Link | |
| to="/classic/hello/world" | |
| activeProps={{ | |
| class: 'font-bold', | |
| }} | |
| > | |
| say hello to the world | |
| </Link> | |
| <Outlet /> | |
| </div> | |
| ), | |
| }) |
🤖 Prompt for AI Agents
e2e/vue-router/basic-virtual-file-based/src/routes/file-based-subtree/hello/route.tsx
lines 1-27: The file calls createFileRoute but never imports it; add an import
for createFileRoute from '@tanstack/vue-router' alongside the existing Link and
Outlet import (e.g., include createFileRoute in the import list) so the symbol
is defined and the component builds at runtime.
| import { Link, Outlet } from '@tanstack/vue-router' | ||
|
|
||
| export const Route = createFileRoute({ | ||
| component: LayoutComponent, | ||
| }) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing import for createFileRoute.
The function createFileRoute is used on Line 3 but not imported, which will cause a runtime error.
Apply this diff to add the missing import:
-import { Link, Outlet } from '@tanstack/vue-router'
+import { Link, Outlet, createFileRoute } from '@tanstack/vue-router'📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| import { Link, Outlet } from '@tanstack/vue-router' | |
| export const Route = createFileRoute({ | |
| component: LayoutComponent, | |
| }) | |
| import { Link, Outlet, createFileRoute } from '@tanstack/vue-router' | |
| export const Route = createFileRoute({ | |
| component: LayoutComponent, | |
| }) |
🤖 Prompt for AI Agents
In
e2e/vue-router/basic-virtual-named-export-config-file-based/src/routes/layout/second-layout.tsx
around lines 1-5, the file calls createFileRoute but never imports it; add
createFileRoute to the import from '@tanstack/vue-router' (e.g. include
createFileRoute in the named import on line 1) so the symbol is available where
Route is created.
| import { ErrorComponent } from '@tanstack/vue-router' | ||
| import { fetchPost } from '../../posts' | ||
| import type { ErrorComponentProps } from '@tanstack/vue-router' | ||
|
|
||
| export function PostErrorComponent({ error }: ErrorComponentProps) { | ||
| return <ErrorComponent error={error} /> | ||
| } | ||
|
|
||
| export const Route = createFileRoute({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing import for createFileRoute.
createFileRoute is used on line 9 but is not imported. This will cause a runtime error.
-import { ErrorComponent } from '@tanstack/vue-router'
+import { createFileRoute, ErrorComponent } from '@tanstack/vue-router'
import { fetchPost } from '../../posts'
import type { ErrorComponentProps } from '@tanstack/vue-router'📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| import { ErrorComponent } from '@tanstack/vue-router' | |
| import { fetchPost } from '../../posts' | |
| import type { ErrorComponentProps } from '@tanstack/vue-router' | |
| export function PostErrorComponent({ error }: ErrorComponentProps) { | |
| return <ErrorComponent error={error} /> | |
| } | |
| export const Route = createFileRoute({ | |
| import { createFileRoute, ErrorComponent } from '@tanstack/vue-router' | |
| import { fetchPost } from '../../posts' | |
| import type { ErrorComponentProps } from '@tanstack/vue-router' | |
| export function PostErrorComponent({ error }: ErrorComponentProps) { | |
| return <ErrorComponent error={error} /> | |
| } | |
| export const Route = createFileRoute({ |
🤖 Prompt for AI Agents
In
e2e/vue-router/basic-virtual-named-export-config-file-based/src/routes/posts/posts-detail.tsx
around lines 1 to 9, the function createFileRoute is used on line 9 but not
imported; add an import for createFileRoute (e.g., import { createFileRoute }
from '@tanstack/vue-router') at the top with the other imports so the symbol is
defined and prevents the runtime error.
| export const Route = createFileRoute({ | ||
| component: PostsIndexComponent, | ||
| }) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing import for createFileRoute.
The createFileRoute function is used but never imported, which will cause a ReferenceError at runtime.
Apply this diff to add the missing import:
+import { createFileRoute } from '@tanstack/vue-router'
+
export const Route = createFileRoute({
component: PostsIndexComponent,
})🤖 Prompt for AI Agents
In
e2e/vue-router/basic-virtual-named-export-config-file-based/src/routes/posts/posts-home.tsx
around lines 1-3, the function createFileRoute is used but not imported; add an
import for createFileRoute at the top of the file (e.g. import { createFileRoute
} from 'virtual:generated-pages' or from the actual module that provides it) so
the identifier is defined before the export and the runtime ReferenceError is
avoided.
| import { Link, Outlet } from '@tanstack/vue-router' | ||
| import { fetchPosts } from '../../posts' | ||
|
|
||
| export const Route = createFileRoute({ | ||
| loader: fetchPosts, | ||
| component: PostsComponent, | ||
| }) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing import for createFileRoute.
The function createFileRoute is used on Line 4 but not imported, which will cause a runtime error.
Apply this diff to add the missing import:
-import { Link, Outlet } from '@tanstack/vue-router'
+import { Link, Outlet, createFileRoute } from '@tanstack/vue-router'
import { fetchPosts } from '../../posts'📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| import { Link, Outlet } from '@tanstack/vue-router' | |
| import { fetchPosts } from '../../posts' | |
| export const Route = createFileRoute({ | |
| loader: fetchPosts, | |
| component: PostsComponent, | |
| }) | |
| import { Link, Outlet, createFileRoute } from '@tanstack/vue-router' | |
| import { fetchPosts } from '../../posts' | |
| export const Route = createFileRoute({ | |
| loader: fetchPosts, | |
| component: PostsComponent, | |
| }) |
🤖 Prompt for AI Agents
In
e2e/vue-router/basic-virtual-named-export-config-file-based/src/routes/posts/posts.tsx
lines 1-7, the createFileRoute identifier is used but not imported; add an
import for createFileRoute from '@tanstack/vue-router' alongside the existing
imports (e.g., include createFileRoute in the import list at the top) so the
function is available for the Route declaration.
| @@ -0,0 +1,23 @@ | |||
| @import 'tailwindcss'; | |||
|
|
|||
| @source './**/*.{js,jsx,ts,tsx}'; | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add .vue extension to the source glob.
This is a Vue project, but the source glob only includes JS/TS file extensions. Tailwind CSS needs to scan .vue files to detect utility classes used in Vue components.
Apply this diff to include Vue files:
-@source './**/*.{js,jsx,ts,tsx}';
+@source './**/*.{js,jsx,ts,tsx,vue}';📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| @source './**/*.{js,jsx,ts,tsx}'; | |
| @source './**/*.{js,jsx,ts,tsx,vue}'; |
🤖 Prompt for AI Agents
In e2e/vue-router/basic-virtual-named-export-config-file-based/src/styles.css
around line 3, the Tailwind source glob only lists JS/TS extensions so .vue
files are not scanned; update the source glob to include the .vue extension
(e.g. change the pattern to include ,vue in the brace list like
.{js,jsx,ts,tsx,vue}) so Tailwind will scan Vue single-file components for
utility classes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
♻️ Duplicate comments (1)
e2e/vue-router/basic-virtual-named-export-config-file-based/src/routes/posts/posts-detail.tsx (1)
1-3: Missing import forcreateFileRoute.This issue was already flagged in a previous review. The function
createFileRouteis used on line 9 but is not imported, which will cause a runtime error.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (6)
e2e/vue-router/basic-virtual-file-based/src/main.tsx(1 hunks)e2e/vue-router/basic-virtual-file-based/src/routes/posts/posts-detail.tsx(1 hunks)e2e/vue-router/basic-virtual-file-based/src/routes/posts/posts.tsx(1 hunks)e2e/vue-router/basic-virtual-named-export-config-file-based/src/main.tsx(1 hunks)e2e/vue-router/basic-virtual-named-export-config-file-based/src/routes/posts/posts-detail.tsx(1 hunks)e2e/vue-router/basic-virtual-named-export-config-file-based/src/routes/posts/posts.tsx(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (5)
- e2e/vue-router/basic-virtual-named-export-config-file-based/src/main.tsx
- e2e/vue-router/basic-virtual-file-based/src/main.tsx
- e2e/vue-router/basic-virtual-file-based/src/routes/posts/posts.tsx
- e2e/vue-router/basic-virtual-named-export-config-file-based/src/routes/posts/posts.tsx
- e2e/vue-router/basic-virtual-file-based/src/routes/posts/posts-detail.tsx
🧰 Additional context used
📓 Path-based instructions (2)
**/*.{ts,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
Use TypeScript strict mode with extensive type safety for all code
Files:
e2e/vue-router/basic-virtual-named-export-config-file-based/src/routes/posts/posts-detail.tsx
**/*.{js,ts,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
Implement ESLint rules for router best practices using the ESLint plugin router
Files:
e2e/vue-router/basic-virtual-named-export-config-file-based/src/routes/posts/posts-detail.tsx
🧠 Learnings (4)
📓 Common learnings
Learnt from: nlynzaad
Repo: TanStack/router PR: 5402
File: packages/router-generator/tests/generator/no-formatted-route-tree/routeTree.nonnested.snapshot.ts:19-21
Timestamp: 2025-10-08T08:11:47.088Z
Learning: Test snapshot files in the router-generator tests directory (e.g., files matching the pattern `packages/router-generator/tests/generator/**/routeTree*.snapshot.ts` or `routeTree*.snapshot.js`) should not be modified or have issues flagged, as they are fixtures used to verify the generator's output and are intentionally preserved as-is.
📚 Learning: 2025-12-06T15:03:07.223Z
Learnt from: CR
Repo: TanStack/router PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-06T15:03:07.223Z
Learning: Applies to **/*.{js,ts,tsx} : Implement ESLint rules for router best practices using the ESLint plugin router
Applied to files:
e2e/vue-router/basic-virtual-named-export-config-file-based/src/routes/posts/posts-detail.tsx
📚 Learning: 2025-10-08T08:11:47.088Z
Learnt from: nlynzaad
Repo: TanStack/router PR: 5402
File: packages/router-generator/tests/generator/no-formatted-route-tree/routeTree.nonnested.snapshot.ts:19-21
Timestamp: 2025-10-08T08:11:47.088Z
Learning: Test snapshot files in the router-generator tests directory (e.g., files matching the pattern `packages/router-generator/tests/generator/**/routeTree*.snapshot.ts` or `routeTree*.snapshot.js`) should not be modified or have issues flagged, as they are fixtures used to verify the generator's output and are intentionally preserved as-is.
Applied to files:
e2e/vue-router/basic-virtual-named-export-config-file-based/src/routes/posts/posts-detail.tsx
📚 Learning: 2025-11-02T16:16:24.898Z
Learnt from: nlynzaad
Repo: TanStack/router PR: 5732
File: packages/start-client-core/src/client/hydrateStart.ts:6-9
Timestamp: 2025-11-02T16:16:24.898Z
Learning: In packages/start-client-core/src/client/hydrateStart.ts, the `import/no-duplicates` ESLint disable is necessary for imports from `#tanstack-router-entry` and `#tanstack-start-entry` because both aliases resolve to the same placeholder file (`fake-start-entry.js`) in package.json during static analysis, even though they resolve to different files at runtime.
Applied to files:
e2e/vue-router/basic-virtual-named-export-config-file-based/src/routes/posts/posts-detail.tsx
🔇 Additional comments (2)
e2e/vue-router/basic-virtual-named-export-config-file-based/src/routes/posts/posts-detail.tsx (2)
5-7: LGTM!The
PostErrorComponentcorrectly forwards the error to the underlyingErrorComponent.
18-27: LGTM!The
PostComponentcorrectly consumes the loader data viaRoute.useLoaderData()and safely accesses nested properties using optional chaining.
| export const Route = createFileRoute({ | ||
| loader: async ({ params: { postId } }) => fetchPost(postId), | ||
| errorComponent: PostErrorComponent as any, | ||
| notFoundComponent: () => { | ||
| return <p>Post not found</p> | ||
| }, | ||
| component: PostComponent, | ||
| }) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
# Search for createFileRoute usage patterns in the repository
find . -type f \( -name "*.tsx" -o -name "*.ts" \) | head -20 | xargs grep -l "createFileRoute" | head -10Repository: TanStack/router
Length of output: 178
🏁 Script executed:
# Read the files to see createFileRoute usage patterns
echo "=== about.tsx ===" && cat -n ./e2e/react-router/basepath-file-based/src/routes/about.tsx
echo ""
echo "=== index.tsx ===" && cat -n ./e2e/react-router/basepath-file-based/src/routes/index.tsxRepository: TanStack/router
Length of output: 1365
🏁 Script executed:
# Check for vue-router examples with createFileRoute
find ./e2e/vue-router -type f \( -name "*.tsx" -o -name "*.ts" \) | xargs grep -l "createFileRoute" | head -5Repository: TanStack/router
Length of output: 488
🏁 Script executed:
# Check one of the Vue router examples
cat -n "./e2e/vue-router/basic-file-based-jsx/src/routes/(another-group)/onlyrouteinside.tsx"Repository: TanStack/router
Length of output: 1204
🏁 Script executed:
# Check the actual file under review
cat -n "./e2e/vue-router/basic-virtual-named-export-config-file-based/src/routes/posts/posts-detail.tsx"Repository: TanStack/router
Length of output: 1010
🏁 Script executed:
# Check the directory structure to understand the route hierarchy and parameters
ls -la "./e2e/vue-router/basic-virtual-named-export-config-file-based/src/routes/posts/"Repository: TanStack/router
Length of output: 354
🏁 Script executed:
# Check the posts.tsx file to understand the parameter definition
cat -n "./e2e/vue-router/basic-virtual-named-export-config-file-based/src/routes/posts/posts.tsx"Repository: TanStack/router
Length of output: 1314
🏁 Script executed:
# Check the root directory structure of this e2e app to understand the setup
ls -la "./e2e/vue-router/basic-virtual-named-export-config-file-based/src/routes/"Repository: TanStack/router
Length of output: 575
🏁 Script executed:
# Check for other examples with dynamic route segments to confirm naming pattern
rg -A 2 'createFileRoute\(' ./e2e/vue-router/ -m 3 --type tsxRepository: TanStack/router
Length of output: 86
🏁 Script executed:
# Search for createFileRoute with dynamic route segments
rg -A 2 'createFileRoute\(' ./e2e/vue-router --type ts -A 2 | head -40Repository: TanStack/router
Length of output: 3113
🏁 Script executed:
# Check the difference between basic-virtual-file-based and basic-file-based-jsx
ls -la ./e2e/vue-router/ | grep "file-based"Repository: TanStack/router
Length of output: 442
🏁 Script executed:
# Compare the setup between basic-file-based-jsx and basic-virtual-named-export-config-file-based
echo "=== basic-file-based-jsx posts-detail ===" && cat -n "./e2e/vue-router/basic-file-based-jsx/src/routes/posts/posts-detail.tsx"Repository: TanStack/router
Length of output: 221
🏁 Script executed:
# Check the directory structure of basic-file-based-jsx
ls -la "./e2e/vue-router/basic-file-based-jsx/src/routes/"Repository: TanStack/router
Length of output: 1252
🏁 Script executed:
# Check the posts.$postId.tsx file to see how it uses createFileRoute
cat -n "./e2e/vue-router/basic-file-based-jsx/src/routes/posts.\$postId.tsx"Repository: TanStack/router
Length of output: 981
🏁 Script executed:
# Check if there's a special config or setup for the basic-virtual-named-export-config-file-based variant
cat -n "./e2e/vue-router/basic-virtual-named-export-config-file-based/src/routes/posts/posts.tsx"Repository: TanStack/router
Length of output: 1314
🏁 Script executed:
# Check the root.tsx to understand the routing setup for this variant
cat -n "./e2e/vue-router/basic-virtual-named-export-config-file-based/src/routes/root.tsx"Repository: TanStack/router
Length of output: 2162
Add the route path argument to createFileRoute call.
The createFileRoute API requires the route path as a string argument before the configuration object. Based on the directory structure and the postId parameter, add the path:
export const Route = createFileRoute('/posts/$postId')({
loader: async ({ params: { postId } }) => fetchPost(postId),
errorComponent: PostErrorComponent as any,
notFoundComponent: () => {
return <p>Post not found</p>
},
component: PostComponent,
})
🤖 Prompt for AI Agents
In
e2e/vue-router/basic-virtual-named-export-config-file-based/src/routes/posts/posts-detail.tsx
around lines 9 to 16, the createFileRoute call is missing the required route
path string argument; update the call to pass the path '/posts/$postId' before
the config object and adjust syntax to call
createFileRoute('/posts/$postId')({...}) so the loader, errorComponent,
notFoundComponent and component remain inside the config object.
|
|
||
| export const Route = createFileRoute({ | ||
| loader: async ({ params: { postId } }) => fetchPost(postId), | ||
| errorComponent: PostErrorComponent as any, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove the as any type cast.
The as any cast defeats TypeScript's type safety guarantees and violates the coding guideline requiring strict TypeScript with extensive type safety.
Investigate why PostErrorComponent doesn't satisfy the expected type and address the root cause. If there's a genuine type mismatch with the Vue Router error component signature, consider:
- Adjusting the component signature to match the expected type
- Using a more specific type assertion if the types are compatible but TypeScript cannot infer it
As per coding guidelines, strict type safety should be maintained for all TypeScript files.
add e2e suites:
basic-virtual-file-routes
basic-virtual-named-export-config-file-based
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.