-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
refactor: export devtools options type #5435
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
WalkthroughExport names and public option interfaces were renamed and made explicit across packages: internal Changes
Sequence Diagram(s)(omitted — changes are API/export surface renames only; no runtime/control-flow changes to diagram) Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes 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 |
@coderabbitai generate docstrings |
✅ Actions performedDocstrings generation started. |
Docstrings generation was requested by @lachieh. * #5435 (comment) The following files were modified: * `packages/react-router-devtools/src/TanStackRouterDevtools.tsx`
Note Generated docstrings for this pull request at #5437 |
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: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
packages/react-router-devtools/src/TanStackRouterDevtools.tsx
(3 hunks)packages/router-devtools-core/src/TanStackRouterDevtoolsCore.tsx
(4 hunks)packages/router-devtools-core/src/TanStackRouterDevtoolsPanelCore.tsx
(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
- packages/router-devtools-core/src/TanStackRouterDevtoolsPanelCore.tsx
- packages/router-devtools-core/src/TanStackRouterDevtoolsCore.tsx
🧰 Additional context used
📓 Path-based instructions (2)
**/*.{ts,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
Use TypeScript in strict mode with extensive type safety across the codebase
Files:
packages/react-router-devtools/src/TanStackRouterDevtools.tsx
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/src/TanStackRouterDevtools.tsx
🔇 Additional comments (2)
packages/react-router-devtools/src/TanStackRouterDevtools.tsx (2)
8-44
: LGTM! Interface rename aligns with PR objectives.The interface rename from
DevtoolsOptions
toTanStackRouterDevtoolsOptions
successfully addresses the TS4023 error and follows TanStack naming conventions. The JSDoc comments are clear and comprehensive.
46-126
: LGTM! Function implementation is correct.The function signature correctly uses the renamed
TanStackRouterDevtoolsOptions
type. The implementation properly manages the devtools lifecycle through React hooks and maintains type safety throughout.
View your CI Pipeline Execution ↗ for commit 637c75d
☁️ 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: 0
🧹 Nitpick comments (1)
packages/solid-router-devtools/src/TanStackRouterDevtools.tsx (1)
34-34
: Consider using a more specific type instead ofany
.The
any
type reduces type safety. Consider usingJSX.ElementType
or a union of valid container element types for better type checking.Apply this diff to improve type safety:
- containerElement?: string | any + containerElement?: JSX.ElementTypeNote: This suggestion assumes Solid's JSX types support
JSX.ElementType
. If not, consider defining a custom type that captures valid container elements.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (6)
packages/react-router-devtools/src/TanStackRouterDevtools.tsx
(2 hunks)packages/react-router-devtools/src/TanStackRouterDevtoolsPanel.tsx
(2 hunks)packages/router-devtools-core/src/TanStackRouterDevtoolsCore.tsx
(4 hunks)packages/router-devtools-core/src/TanStackRouterDevtoolsPanelCore.tsx
(2 hunks)packages/solid-router-devtools/src/TanStackRouterDevtools.tsx
(2 hunks)packages/solid-router-devtools/src/TanStackRouterDevtoolsPanel.tsx
(2 hunks)
🚧 Files skipped from review as they are similar to previous changes (5)
- packages/react-router-devtools/src/TanStackRouterDevtoolsPanel.tsx
- packages/router-devtools-core/src/TanStackRouterDevtoolsPanelCore.tsx
- packages/solid-router-devtools/src/TanStackRouterDevtoolsPanel.tsx
- packages/router-devtools-core/src/TanStackRouterDevtoolsCore.tsx
- packages/react-router-devtools/src/TanStackRouterDevtools.tsx
🧰 Additional context used
📓 Path-based instructions (2)
**/*.{ts,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
Use TypeScript in strict mode with extensive type safety across the codebase
Files:
packages/solid-router-devtools/src/TanStackRouterDevtools.tsx
packages/{router-devtools,*-router-devtools}/**
📄 CodeRabbit inference engine (AGENTS.md)
Keep router devtools packages in packages/router-devtools/ and packages/*-router-devtools/
Files:
packages/solid-router-devtools/src/TanStackRouterDevtools.tsx
🧬 Code graph analysis (1)
packages/solid-router-devtools/src/TanStackRouterDevtools.tsx (1)
packages/react-router-devtools/src/TanStackRouterDevtools.tsx (2)
TanStackRouterDevtoolsOptions
(8-44)TanStackRouterDevtools
(46-126)
🔇 Additional comments (2)
packages/solid-router-devtools/src/TanStackRouterDevtools.tsx (2)
7-43
: LGTM! Interface export fulfills PR objective.The exported
TanStackRouterDevtoolsOptions
interface is well-documented and correctly addresses the TypeScript error mentioned in the PR description (ts4023). This allows downstream consumers to reference the type without importing from the devtools package directly.
45-47
: LGTM! Component signature correctly updated.The component signature properly uses the exported
TanStackRouterDevtoolsOptions
interface, maintaining consistency with the React devtools package while using Solid-specific component types.
More templates
@tanstack/arktype-adapter
@tanstack/directive-functions-plugin
@tanstack/eslint-plugin-router
@tanstack/history
@tanstack/nitro-v2-vite-plugin
@tanstack/react-router
@tanstack/react-router-devtools
@tanstack/react-router-ssr-query
@tanstack/react-start
@tanstack/react-start-client
@tanstack/react-start-server
@tanstack/router-cli
@tanstack/router-core
@tanstack/router-devtools
@tanstack/router-devtools-core
@tanstack/router-generator
@tanstack/router-plugin
@tanstack/router-ssr-query-core
@tanstack/router-utils
@tanstack/router-vite-plugin
@tanstack/server-functions-plugin
@tanstack/solid-router
@tanstack/solid-router-devtools
@tanstack/solid-start
@tanstack/solid-start-client
@tanstack/solid-start-server
@tanstack/start-client-core
@tanstack/start-plugin-core
@tanstack/start-server-core
@tanstack/start-static-server-functions
@tanstack/start-storage-context
@tanstack/valibot-adapter
@tanstack/virtual-file-routes
@tanstack/zod-adapter
commit: |
LGTM, merging! Thank you @lachieh! |
When working with the TanStack Router Devtools, I was getting errors because the
DevtoolsOptions
type wasn't being exported from the main package. This isn't a problem when using the devtools directly from imports, but it does cause issues when trying to use the options to integrate tightly with my application.In this instance,
AppDevOptions
is the type from my application.I tried inferring the type, as well as creating a new type from the arguments, but it gives the same error:
Note
Despite what CodeRabbit says, these aren't actually breaking changes since the types were never exported in the first place. This is a minor change at best.
Summary by CodeRabbit
Breaking Changes
New Features