-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
fix: Add optimizeDeps.entries for client and ssr environments
#5223
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
fix: Add optimizeDeps.entries for client and ssr environments
#5223
Conversation
WalkthroughAdds a router alias and simplifies entry-alias resolution in start-plugin-core, changes internal ENTRY_POINTS identifiers, adds tinyglobby as a dependency, and updates default entry file names and a comment in React/Solid Vite plugins; optimizeDeps lists now include escaped alias entries. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor Dev as Developer
participant Plugin as start-plugin-core
participant Const as ENTRY_POINTS
participant Escape as tinyglobby.escapePath
participant Vite as Vite Config
Dev->>Plugin: initialize plugin (client/server/start/router paths)
Plugin->>Const: read ENTRY_POINTS placeholders
Plugin->>Plugin: compute aliases (clientAlias, serverAlias, startAlias, routerAlias) using ?? defaults
Plugin->>Escape: escape alias entries for optimizeDeps.include
Escape-->>Plugin: escaped paths
Plugin->>Vite: inject alias map (client/server/start/router)
Plugin->>Vite: add optimizeDeps.include for client and server using escaped aliases
Vite-->>Dev: final Vite config with aliases and optimizeDeps
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested labels
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests
Comment |
|
View your CI Pipeline Execution ↗ for commit 9e29f18
☁️ 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: 2
🧹 Nitpick comments (1)
packages/start-plugin-core/src/plugin.ts (1)
136-146: Alias computation/readability looks goodThe nullish-coalescing defaults with normalizePath are clear and correct. The router alias introduction aligns with the new strategy.
Optional: factor a tiny helper to reduce repetition:
const normWithDefault = (p: string | undefined, d: string) => vite.normalizePath(p ?? d) const clientAlias = normWithDefault(clientEntryPath, corePluginOpts.defaultEntryPaths.client) const serverAlias = normWithDefault(serverEntryPath, corePluginOpts.defaultEntryPaths.server) const startAlias = normWithDefault(startFilePath, corePluginOpts.defaultEntryPaths.start)Also applies to: 153-155
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
packages/react-start/src/plugin/vite.ts(1 hunks)packages/start-plugin-core/src/plugin.ts(3 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.tspackages/start-plugin-core/src/plugin.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.tspackages/start-plugin-core/src/plugin.ts
🧠 Learnings (1)
📚 Learning: 2025-09-23T17:36:12.598Z
Learnt from: CR
PR: TanStack/router#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
⏰ 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). (2)
- GitHub Check: Test
- GitHub Check: Preview
🔇 Additional comments (1)
packages/react-start/src/plugin/vite.ts (1)
68-68: LGTM — comment tweak onlyNon-behavioral change. Safe.
604c720 to
92ce7fe
Compare
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: |
optimizeDeps.entries for client and ssr environmentsoptimizeDeps.entries for client and ssr environments
This adds
optimizeDeps.entriesfor theclientandssrenvironments so that dependencies are discovered when starting the dev server.Summary by CodeRabbit