-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
fix: optimizeDeps for react form #5726
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
|
Caution Review failedThe pull request is closed. WalkthroughAdds conditional logic in the Vite plugin to include the transitive dependency Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant VitePlugin
participant Config
participant OptimizeDeps
Note over VitePlugin,Config: Vite plugin build-time configuration
VitePlugin->>Config: read optimizeDeps.exclude
alt running in client
Config->>VitePlugin: returns excludes
alt '@tanstack/react-form' in excludes
VitePlugin->>OptimizeDeps: add "@tanstack/react-form > @tanstack/react-store" to include
OptimizeDeps-->>VitePlugin: include updated
else
VitePlugin-->>OptimizeDeps: leave include unchanged
end
else running in server
VitePlugin-->>OptimizeDeps: keep include/exclude as server defaults
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes
Possibly related PRs
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
Comment |
|
View your CI Pipeline Execution ↗ for commit 2be138c
☁️ Nx Cloud last updated this comment at |
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-router-ssr-query
@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: |
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
🧹 Nitpick comments (1)
packages/react-start/src/plugin/vite.ts (1)
82-86: Logic correctly fixes the CommonJS import issue.This conditional inclusion of
@tanstack/react-form > @tanstack/react-storemirrors the existing pattern at line 81 and correctly ensures that when users exclude@tanstack/react-form, the transitive dependency@tanstack/react-storeis still optimized to convert its CommonJS dependency (use-sync-external-store) to ESM.Consider using
includes()instead offind()for a clearer intent:- ...(options.optimizeDeps?.exclude?.find( - (x) => x === '@tanstack/react-form', - ) + ...(options.optimizeDeps?.exclude?.includes( + '@tanstack/react-form', + ) ? ['@tanstack/react-form > @tanstack/react-store'] : []),
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
packages/react-start/src/plugin/vite.ts(2 hunks)
🧰 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-start/src/plugin/vite.ts
packages/{*-start,start-*}/**
📄 CodeRabbit inference engine (AGENTS.md)
Name and place Start framework packages under packages/-start/ or packages/start-/
Files:
packages/react-start/src/plugin/vite.ts
🧠 Learnings (2)
📓 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/{react-router,solid-router}/** : Implement React and Solid bindings/components only in packages/react-router/ and packages/solid-router/
📚 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-start/src/plugin/vite.ts
🧬 Code graph analysis (1)
packages/react-start/src/plugin/vite.ts (1)
packages/start-plugin-core/src/constants.ts (1)
VITE_ENVIRONMENT_NAMES(1-6)
⏰ 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
2a00e18 to
2be138c
Compare
fixes #5717
Summary by CodeRabbit