Skip to content

Conversation

@Sheraff
Copy link
Contributor

@Sheraff Sheraff commented Aug 17, 2025

Based on the current usage of pick, directly addinf the picked keys to the objects will be less overhead with the same result.

Summary by CodeRabbit

  • Refactor
    • Simplified internal routing logic related to navigation options; no change to runtime behavior.
  • Chores
    • Removed an internal utility no longer used.
  • Public API
    • One non-essential utility export was removed from package entry points, slightly reducing the public API surface.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Aug 17, 2025

Walkthrough

Removed the exported helper pick and its usage: deleted the pick function from utils, removed its re-exports, and replaced two occurrences of spread ...pick(opts, ['from']) with an explicit from: opts.from in router internals. No public runtime API behavior changed.

Changes

Cohort / File(s) Summary
Router internals
packages/router-core/src/router.ts
Replaced two occurrences of ...pick(opts, ['from']) with from: opts.from; removed pick import.
Utils removal
packages/router-core/src/utils.ts
Removed exported pick<TValue, TKey extends keyof TValue>(parent: TValue, keys: Array<TKey>) implementation and export.
Core exports update
packages/router-core/src/index.ts
Removed pick from re-export list from ./utils.
React package exports
packages/react-router/src/index.tsx
Removed re-export of pick from @tanstack/router-core.
Solid package exports
packages/solid-router/src/index.tsx
Removed re-export of pick from @tanstack/router-core.

Sequence Diagram(s)

sequenceDiagram
  participant Caller
  participant Router
  participant Mask

  Caller->>Router: buildWithMatches(opts, mask?)
  Router->>Mask: if mask found -> construct maskedDest
  Note right of Router: previously used ...pick(opts,['from'])\nnow uses from: opts.from
  Router-->>Caller: return dest/maskedDest (uses dest.from when truthy)
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Suggested labels

package: router-core, package: react-router, package: solid-router

Poem

A rabbit hops through code so slick,
Plucks out "pick" with a single flick.
From fields named clear, the routes proceed,
Simpler lines, no extra seed.
A tiny hop — commit, and quick! 🥕


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 3a8fdfd and 934e4c9.

📒 Files selected for processing (3)
  • packages/react-router/src/index.tsx (0 hunks)
  • packages/router-core/src/index.ts (0 hunks)
  • packages/solid-router/src/index.tsx (0 hunks)
💤 Files with no reviewable changes (3)
  • packages/solid-router/src/index.tsx
  • packages/react-router/src/index.tsx
  • packages/router-core/src/index.ts
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Test
✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch refactor-router-core-remove-pick-utility

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@nx-cloud
Copy link

nx-cloud bot commented Aug 17, 2025

View your CI Pipeline Execution ↗ for commit 934e4c9

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

☁️ Nx Cloud last updated this comment at 2025-08-17 19:15:40 UTC

@pkg-pr-new
Copy link

pkg-pr-new bot commented Aug 17, 2025

More templates

@tanstack/arktype-adapter

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

@tanstack/directive-functions-plugin

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

@tanstack/eslint-plugin-router

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

@tanstack/history

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

@tanstack/react-router

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

@tanstack/react-router-devtools

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

@tanstack/react-router-ssr-query

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

@tanstack/react-start

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

@tanstack/react-start-client

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

@tanstack/react-start-plugin

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

@tanstack/react-start-server

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

@tanstack/router-cli

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

@tanstack/router-core

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

@tanstack/router-devtools

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

@tanstack/router-devtools-core

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

@tanstack/router-generator

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

@tanstack/router-plugin

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

@tanstack/router-ssr-query-core

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

@tanstack/router-utils

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

@tanstack/router-vite-plugin

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

@tanstack/server-functions-plugin

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

@tanstack/solid-router

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

@tanstack/solid-router-devtools

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

@tanstack/solid-start

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

@tanstack/solid-start-client

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

@tanstack/solid-start-plugin

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

@tanstack/solid-start-server

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

@tanstack/start-client-core

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

@tanstack/start-plugin-core

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

@tanstack/start-server-core

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

@tanstack/start-server-functions-client

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

@tanstack/start-server-functions-fetcher

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

@tanstack/start-server-functions-server

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

@tanstack/start-storage-context

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

@tanstack/valibot-adapter

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

@tanstack/virtual-file-routes

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

@tanstack/zod-adapter

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

commit: 934e4c9

@Sheraff Sheraff merged commit a7b1667 into main Aug 17, 2025
6 checks passed
@Sheraff Sheraff deleted the refactor-router-core-remove-pick-utility branch August 17, 2025 19:26
tannerlinsley pushed a commit that referenced this pull request Aug 26, 2025
…manipulation (#4983)

Based on the current usage of `pick`, directly addinf the picked keys to
the objects will be less overhead with the same result.

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

- Refactor
- Simplified internal routing logic related to navigation options; no
change to runtime behavior.
- Chores
  - Removed an internal utility no longer used.
- Public API
- One non-essential utility export was removed from package entry
points, slightly reducing the public API surface.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
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