Skip to content

Conversation

@eve0415
Copy link

@eve0415 eve0415 commented Nov 20, 2025

Tanstack Form has silently created a new package named @tanstack/react-form-start recently. Branch

The usage example is in this docs.

This PR, also optimize deps for @tanstack/react-form-start to fix vite not resolving the use-sync-external-store package.

Summary by CodeRabbit

  • Chores
    • Updated Vite plugin to improve dependency optimization handling for TanStack React Start packages, adding a conditional inclusion for the "start" form package.
    • Adjusted Cloudflare environment typings to preserve literal value types and improve formatting of the declared environment mapping.

✏️ Tip: You can customize this high-level summary in your review settings.

Copilot AI review requested due to automatic review settings November 20, 2025 23:54
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 20, 2025

Walkthrough

Adds a conditional transitive include to the Vite optimizeDeps list for the react-start plugin and adjusts Cloudflare Env typing in an e2e declaration, preserving literal types and formatting.

Changes

Cohort / File(s) Summary
Vite plugin optimizeDeps configuration
packages/react-start/src/plugin/vite.ts
Add conditional spread that includes '@tanstack/react-form-start > @tanstack/react-store' in optimizeDeps.include when '@tanstack/react-form-start' appears in optimizeDeps.exclude, mirroring the existing pattern for '@tanstack/react-form'.
Cloudflare Env typings (e2e)
e2e/solid-start/basic-cloudflare/worker-configuration.d.ts
Adjust formatting and literal typing: change MY_VAR string literal quoting/formatting; update StringifyValues<M> to preserve EnvType[Binding] when a bound is a string (instead of forcing string); update NodeJS.ProcessEnv pick to reflect the preserved literal type.

Sequence Diagram(s)

N/A — changes are configuration and type adjustments that don't modify runtime control flow.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Review Vite plugin conditional logic to ensure pattern matches existing implementation.
  • Verify the d.ts typing changes preserve intended literal types and don't widen types unexpectedly.
  • Check e2e typing formatting for consistency with surrounding declarations.

Possibly related PRs

Poem

🐰 I hopped through configs, tidy and smart,
Mirrored a rule for the form-start part.
Typings trimmed neat, includes set just right,
Bundles hum softly into the night. ✨

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'fix: optimizeDeps for react-form-start' directly and clearly describes the main change: adding optimizeDeps configuration for the react-form-start package to resolve Vite dependency issues.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 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 61db78a and a27bfbf.

📒 Files selected for processing (1)
  • e2e/solid-start/basic-cloudflare/worker-configuration.d.ts (1 hunks)
🧰 Additional context used
🧠 Learnings (1)
📓 Common learnings
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.
🔇 Additional comments (1)
e2e/solid-start/basic-cloudflare/worker-configuration.d.ts (1)

5-7: Env/StringifyValues typing change is sound and improves literal safety

Defining MY_VAR as the literal 'Hello from Cloudflare' and updating StringifyValues to preserve literal string types while collapsing non‑string env bindings to string makes ProcessEnv more precise without breaking the string-only runtime contract. The Pick<Cloudflare.Env, 'MY_VAR'> usage ensures process.env.MY_VAR is correctly typed to that literal in this e2e setup.

Only minor thing to keep in mind: if StringifyValues is reused elsewhere with union types like string | undefined or string | number, those will now fall back to string, which still matches how environment variables behave but slightly changes previous type inferences. If that’s intentional, this looks good to ship.

Also applies to: 11-14, 16-17


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.

Copilot finished reviewing on behalf of eve0415 November 20, 2025 23:55
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds Vite dependency optimization support for the newly released @tanstack/react-form-start package. The change ensures that when users opt to exclude @tanstack/react-form-start from optimization, its nested @tanstack/react-store dependency is properly included for CJS to ESM conversion, resolving issues with use-sync-external-store.

Key changes:

  • Added conditional optimization for @tanstack/react-form-start > @tanstack/react-store following the same pattern as @tanstack/react-form

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@nx-cloud
Copy link

nx-cloud bot commented Nov 21, 2025

View your CI Pipeline Execution ↗ for commit a27bfbf

Command Status Duration Result
nx affected --targets=test:eslint,test:unit,tes... ⛔ Cancelled 22s View ↗
nx run-many --target=build --exclude=examples/*... ✅ Succeeded 10s View ↗

☁️ Nx Cloud last updated this comment at 2025-11-21 13:55:36 UTC

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.

1 participant