Skip to content

Conversation

@ha1fstack
Copy link

@ha1fstack ha1fstack commented Nov 11, 2025

This PR fixes wrong dependency config of devtools related packages:

router-devtools-core > tiny-invariant should be a normal dependency

react-router-devtools and solid-router-devtools do not provide router-devtools-core 's peer dependency router-core so added it as optional peerDeps

Summary by CodeRabbit

  • Chores
    • Enhanced dependency configuration across multiple devtools packages to improve overall compatibility and streamline the package installation process.
    • Refined and optimized internal dependencies for better module resolution and reduced potential installation conflicts between packages.
    • Updated peer dependency settings to ensure proper compatibility across different router framework integrations and use cases.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 11, 2025

Walkthrough

Updates dependency declarations across three dev-tools packages: adds optional peer dependencies on @tanstack/router-core to react-router-devtools and solid-router-devtools packages, and promotes tiny-invariant from peer dependency to direct runtime dependency in router-devtools-core.

Changes

Cohort / File(s) Summary
Optional @tanstack/router-core peer dependency
packages/react-router-devtools/package.json, packages/solid-router-devtools/package.json
Adds @tanstack/router-core as optional peer dependency with corresponding peerDependenciesMeta marking
tiny-invariant dependency promotion
packages/router-devtools-core/package.json
Moves tiny-invariant from peerDependencies to dependencies

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

  • Verify the @tanstack/router-core workspace version specifier is correct and consistent across packages
  • Confirm that promoting tiny-invariant to a runtime dependency in router-devtools-core doesn't create unintended version conflicts with dependents
  • Check that optional peer dependency metadata is properly formatted in both react-router-devtools and solid-router-devtools

Suggested reviewers

  • birkskyum
  • lachlancollins
  • SeanCassiere

Poem

🐰 Dependencies aligned with care,
Optional routers floating there,
Invariants pinned where they belong,
Each workspace version stays strong! 🌟

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title references fixing devtools dependencies, which aligns with the core objective of correcting dependency configuration across devtools packages.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5404201 and 78e6279.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (3)
  • packages/react-router-devtools/package.json (1 hunks)
  • packages/router-devtools-core/package.json (2 hunks)
  • packages/solid-router-devtools/package.json (1 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
**/package.json

📄 CodeRabbit inference engine (AGENTS.md)

Use workspace:* protocol for internal dependencies in package.json files

Files:

  • packages/react-router-devtools/package.json
  • packages/solid-router-devtools/package.json
  • packages/router-devtools-core/package.json
packages/{router-devtools,*-router-devtools}/**

📄 CodeRabbit inference engine (AGENTS.md)

Keep router devtools packages in packages/router-devtools/ and packages/*-router-devtools/

Files:

  • packages/react-router-devtools/package.json
  • packages/solid-router-devtools/package.json
🧠 Learnings (9)
📓 Common learnings
Learnt from: CR
Repo: TanStack/router PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-09-23T17:36:12.598Z
Learning: Applies to packages/{router-devtools,*-router-devtools}/** : Keep router devtools packages in packages/router-devtools/ and packages/*-router-devtools/
Learnt from: CR
Repo: TanStack/router PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-09-23T17:36:12.598Z
Learning: Applies to packages/{router-cli,router-generator,router-plugin,virtual-file-routes}/** : Keep CLI, generators, bundler plugins, and virtual file routing utilities in their dedicated tooling package directories
Learnt from: CR
Repo: TanStack/router PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-09-23T17:36:12.598Z
Learning: Applies to packages/{react-router,solid-router}/** : Implement React and Solid bindings/components only in packages/react-router/ and packages/solid-router/
Learnt from: CR
Repo: TanStack/router PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-09-23T17:36:12.598Z
Learning: Applies to packages/router-core/** : Keep framework-agnostic core router logic in packages/router-core/
Learnt from: CR
Repo: TanStack/router PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-09-23T17:36:12.598Z
Learning: Applies to packages/router-plugin/** : Use unplugin for universal bundler plugins in the router-plugin package
📚 Learning: 2025-09-23T17:36:12.598Z
Learnt from: CR
Repo: TanStack/router PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-09-23T17:36:12.598Z
Learning: Applies to packages/{router-devtools,*-router-devtools}/** : Keep router devtools packages in packages/router-devtools/ and packages/*-router-devtools/

Applied to files:

  • packages/react-router-devtools/package.json
  • packages/solid-router-devtools/package.json
  • packages/router-devtools-core/package.json
📚 Learning: 2025-09-23T17:36:12.598Z
Learnt from: CR
Repo: TanStack/router PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-09-23T17:36:12.598Z
Learning: Applies to packages/{react-router,solid-router}/** : Implement React and Solid bindings/components only in packages/react-router/ and packages/solid-router/

Applied to files:

  • packages/react-router-devtools/package.json
  • packages/solid-router-devtools/package.json
  • packages/router-devtools-core/package.json
📚 Learning: 2025-09-23T17:36:12.598Z
Learnt from: CR
Repo: TanStack/router PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-09-23T17:36:12.598Z
Learning: Applies to packages/router-core/** : Keep framework-agnostic core router logic in packages/router-core/

Applied to files:

  • packages/react-router-devtools/package.json
  • packages/solid-router-devtools/package.json
  • packages/router-devtools-core/package.json
📚 Learning: 2025-09-23T17:36:12.598Z
Learnt from: CR
Repo: TanStack/router PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-09-23T17:36:12.598Z
Learning: Applies to packages/{router-cli,router-generator,router-plugin,virtual-file-routes}/** : Keep CLI, generators, bundler plugins, and virtual file routing utilities in their dedicated tooling package directories

Applied to files:

  • packages/react-router-devtools/package.json
  • packages/solid-router-devtools/package.json
  • packages/router-devtools-core/package.json
📚 Learning: 2025-09-23T17:36:12.598Z
Learnt from: CR
Repo: TanStack/router PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-09-23T17:36:12.598Z
Learning: Applies to **/package.json : Use workspace:* protocol for internal dependencies in package.json files

Applied to files:

  • packages/react-router-devtools/package.json
  • packages/solid-router-devtools/package.json
  • packages/router-devtools-core/package.json
📚 Learning: 2025-09-23T17:36:12.598Z
Learnt from: CR
Repo: TanStack/router PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-09-23T17:36:12.598Z
Learning: Applies to packages/router-plugin/** : Use unplugin for universal bundler plugins in the router-plugin package

Applied to files:

  • packages/solid-router-devtools/package.json
📚 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:

  • packages/router-devtools-core/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:

  • packages/router-devtools-core/package.json
🔇 Additional comments (3)
packages/react-router-devtools/package.json (1)

73-83: Correctly adds optional peer dependency with proper workspace protocol.

The addition of @tanstack/router-core as an optional peer dependency is correct. The workspace:^ protocol is used appropriately for internal dependencies, and peerDependenciesMeta correctly marks it as optional. This ensures consumers who depend on react-router-devtools can optionally provide router-core without a hard requirement.

packages/solid-router-devtools/package.json (1)

76-85: Consistent with react-router-devtools; correctly adds optional router-core peer dependency.

The pattern mirrors react-router-devtools, applying the same optional peer dependency structure. Using workspace:^ for internal dependencies is correct per the coding guidelines, and peerDependenciesMeta properly marks router-core as optional.

packages/router-devtools-core/package.json (1)

64-68: Verified: tiny-invariant version is consistent across the monorepo.

The version ^1.3.3 is standardized across all 10 packages that depend on tiny-invariant. Promoting it from peerDependencies to dependencies in router-devtools-core is correct and causes no version conflicts or compatibility issues.


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.

❤️ Share

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

@nx-cloud
Copy link

nx-cloud bot commented Nov 11, 2025

View your CI Pipeline Execution ↗ for commit 78e6279

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

☁️ Nx Cloud last updated this comment at 2025-11-11 18:08:59 UTC

@pkg-pr-new
Copy link

pkg-pr-new bot commented Nov 11, 2025

More templates

@tanstack/arktype-adapter

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

@tanstack/directive-functions-plugin

npm i https://pkg.pr.new/TanStack/router/@tanstack/directive-functions-plugin@5819

@tanstack/eslint-plugin-router

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

@tanstack/history

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

@tanstack/nitro-v2-vite-plugin

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

@tanstack/react-router

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

@tanstack/react-router-devtools

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

@tanstack/react-router-ssr-query

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

@tanstack/react-start

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

@tanstack/react-start-client

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

@tanstack/react-start-server

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

@tanstack/router-cli

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

@tanstack/router-core

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

@tanstack/router-devtools

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

@tanstack/router-devtools-core

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

@tanstack/router-generator

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

@tanstack/router-plugin

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

@tanstack/router-ssr-query-core

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

@tanstack/router-utils

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

@tanstack/router-vite-plugin

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

@tanstack/server-functions-plugin

npm i https://pkg.pr.new/TanStack/router/@tanstack/server-functions-plugin@5819

@tanstack/solid-router

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

@tanstack/solid-router-devtools

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

@tanstack/solid-router-ssr-query

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

@tanstack/solid-start

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

@tanstack/solid-start-client

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

@tanstack/solid-start-server

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

@tanstack/start-client-core

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

@tanstack/start-plugin-core

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

@tanstack/start-server-core

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

@tanstack/start-static-server-functions

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

@tanstack/start-storage-context

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

@tanstack/valibot-adapter

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

@tanstack/virtual-file-routes

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

@tanstack/zod-adapter

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

commit: 78e6279

@schiller-manuel
Copy link
Contributor

since @tanstack/router-core is a dependency of @tanstack/react-router, why do we need @tanstack/router-core as an explicit peer dep?

@ha1fstack
Copy link
Author

ha1fstack commented Nov 12, 2025

Sadly it breaks yarn PnP which strictly forbids extraneous dependency 😢 Marked as optional so shouldn't be a problem if router/core is not installed

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