Skip to content

Conversation

@schiller-manuel
Copy link
Contributor

@schiller-manuel schiller-manuel commented Jan 24, 2026

Summary by CodeRabbit

  • Chores
    • Removed a public re-export of the server-detection helper from the package surface.
    • Updated internal imports to use a dedicated server-detection entrypoint.
    • Added a development-time alias and TypeScript path mapping so tests and dev builds resolve correctly.
    • Marked the server-detection entrypoint as external during bundling to preserve build behavior.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 24, 2026

📝 Walkthrough

Walkthrough

Removed the barrel re-export of isServer from router-core and redirected imports to the dedicated module path @tanstack/router-core/isServer; added TS and Vite resolution for that subpath and updated multiple framework packages to import from the new path.

Changes

Cohort / File(s) Summary
Public export removed
packages/router-core/src/isServer.ts, packages/router-core/src/index.ts
Deleted the local barrel re-export of isServer (no longer exposed from the core index).
TS & build resolution
packages/router-core/tsconfig.json, packages/router-core/vite.config.ts
Added a paths alias mapping @tanstack/router-core/isServer./src/isServer/development.ts and configured Vite to treat @tanstack/router-core/isServer as an external (plus test alias).
Router-core internal imports
packages/router-core/src/load-matches.ts, packages/router-core/src/router.ts, packages/router-core/src/scroll-restoration.ts
Replaced local ./isServer imports with @tanstack/router-core/isServer.
Framework packages — React
packages/react-router/src/Asset.tsx, packages/react-router/src/Match.tsx, packages/react-router/src/Matches.tsx, packages/react-router/src/ScriptOnce.tsx, packages/react-router/src/link.tsx, packages/react-router/src/scroll-restoration.tsx
Switched isServer imports from @tanstack/router-core to @tanstack/router-core/isServer.
Framework packages — Solid
packages/solid-router/src/Asset.tsx, packages/solid-router/src/Match.tsx, packages/solid-router/src/Matches.tsx, packages/solid-router/src/ScriptOnce.tsx, packages/solid-router/src/Transitioner.tsx, packages/solid-router/src/scroll-restoration.tsx
Switched isServer imports to @tanstack/router-core/isServer.
Framework packages — Vue
packages/vue-router/src/Asset.tsx, packages/vue-router/src/Match.tsx, packages/vue-router/src/Matches.tsx, packages/vue-router/src/ScriptOnce.tsx, packages/vue-router/src/Transitioner.tsx, packages/vue-router/src/scroll-restoration.tsx
Switched isServer imports to @tanstack/router-core/isServer (some files use isServer ?? router.isServer).
SSR / other packages
packages/router-ssr-query-core/src/index.ts
Adjusted import of isServer to the dedicated module path; other exports unchanged.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • birkskyum

Poem

🐰 I hopped through paths and exports bright,
Swapped a barrel for a scoped delight,
Type maps hum, Vite gives a cheer,
Imports redirect, the routes stay clear,
A tiny rabbit's tidy bite.

🚥 Pre-merge checks | ✅ 1 | ❌ 2
❌ Failed checks (1 warning, 1 inconclusive)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The title 'fix: re-export correctly' is vague and does not clearly convey what specific re-export issue is being fixed or what the main change entails. Consider a more specific title that describes the actual change, such as 'fix: move isServer to dedicated module export' or 'refactor: separate isServer into external module path'.
✅ Passed checks (1 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

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

@nx-cloud
Copy link

nx-cloud bot commented Jan 24, 2026

View your CI Pipeline Execution ↗ for commit 6565946

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

☁️ Nx Cloud last updated this comment at 2026-01-24 16:54:28 UTC

@pkg-pr-new
Copy link

pkg-pr-new bot commented Jan 24, 2026

More templates

@tanstack/arktype-adapter

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

@tanstack/eslint-plugin-router

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

@tanstack/history

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

@tanstack/nitro-v2-vite-plugin

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

@tanstack/react-router

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

@tanstack/react-router-devtools

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

@tanstack/react-router-ssr-query

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

@tanstack/react-start

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

@tanstack/react-start-client

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

@tanstack/react-start-server

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

@tanstack/router-cli

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

@tanstack/router-core

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

@tanstack/router-devtools

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

@tanstack/router-devtools-core

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

@tanstack/router-generator

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

@tanstack/router-plugin

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

@tanstack/router-ssr-query-core

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

@tanstack/router-utils

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

@tanstack/router-vite-plugin

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

@tanstack/solid-router

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

@tanstack/solid-router-devtools

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

@tanstack/solid-router-ssr-query

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

@tanstack/solid-start

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

@tanstack/solid-start-client

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

@tanstack/solid-start-server

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

@tanstack/start-client-core

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

@tanstack/start-fn-stubs

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

@tanstack/start-plugin-core

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

@tanstack/start-server-core

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

@tanstack/start-static-server-functions

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

@tanstack/start-storage-context

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

@tanstack/valibot-adapter

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

@tanstack/virtual-file-routes

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

@tanstack/vue-router

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

@tanstack/vue-router-devtools

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

@tanstack/vue-router-ssr-query

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

@tanstack/vue-start

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

@tanstack/vue-start-client

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

@tanstack/vue-start-server

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

@tanstack/zod-adapter

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

commit: 264be9c

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
packages/router-core/src/router.ts (1)

1-31: Fix import order to satisfy lint rule.
Place the external isServer import with the other external imports.

🔧 Suggested fix
 import { Store, batch } from '@tanstack/store'
 import { createBrowserHistory, parseHref } from '@tanstack/history'
+import { isServer } from '@tanstack/router-core/isServer'
 import {
   createControlledPromise,
   decodePath,
   deepEqual,
@@
 } from './path'
-import { isServer } from '@tanstack/router-core/isServer'
 import { createLRUCache } from './lru-cache'
packages/router-core/src/load-matches.ts (1)

1-7: Fix import order to satisfy ESLint (import/order).
Line 7 is an external import and should be grouped with other externals before relative imports.

♻️ Proposed fix
 import { batch } from '@tanstack/store'
 import invariant from 'tiny-invariant'
-import { createControlledPromise, isPromise } from './utils'
-import { isNotFound } from './not-found'
-import { rootRouteId } from './root'
-import { isRedirect } from './redirect'
 import { isServer } from '@tanstack/router-core/isServer'
+import { createControlledPromise, isPromise } from './utils'
+import { isNotFound } from './not-found'
+import { rootRouteId } from './root'
+import { isRedirect } from './redirect'
🤖 Fix all issues with AI agents
In `@packages/router-core/src/scroll-restoration.ts`:
- Around line 1-3: The import order violates the lint rule: move the external
import isServer (from '@tanstack/router-core/isServer') before the local imports
functionalUpdate (from './utils') and the type AnyRouter (from './router') so
external imports precede local ones; update the import statements accordingly to
ensure the external symbol isServer appears above the local symbols
functionalUpdate and AnyRouter.

@schiller-manuel schiller-manuel merged commit 0fc75f2 into main Jan 24, 2026
4 of 5 checks passed
@schiller-manuel schiller-manuel deleted the fix-reexport branch January 24, 2026 16:55
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.

2 participants