Skip to content
Source
Sign inSign up
TanStack/cli

fix(create): upgrade to Vite 8 and fix useStore selector in AI add-on #428

Mergedjherrmerged 1 commit intomain fromrefs/pull/428/headmerged by schiller-manuel(GitHub profile, opens in a new tab)

jherrcommented

Summary

  • Upgrade to Vite 8: Bumps vite from ^7.3.1 to ^8.0.0 and @vitejs/plugin-react from ^5.1.4 to ^6.0.1
  • Remove vite-tsconfig-paths: Replaced with Vite 8's native resolve: { tsconfigPaths: true } option, eliminating an extra dependency
  • Fix useStore crash in AI add-on: The useStore call in demo-AIAssistant.tsx was missing the required selector function, causing a TypeError: selector is not a function at runtime. Added (state) => state as the selector.

Test plan

  • pnpm build passes
  • pnpm test (unit + e2e) all green
  • Verified manually with node packages/cli/dist/index.js dev test-app --framework React --add-ons ai

Made with Cursor

Summary by CodeRabbit

  • Dependencies

    • Upgraded Vite from v7.3.1 to v8.0.0
    • Updated @vitejs/plugin-react from v5.1.4 to v6.0.1
    • Removed vite-tsconfig-paths dependency
  • Configuration Updates

    • Switched from the external vite-tsconfig-paths plugin to Vite's native built-in TypeScript path resolution configuration
  • Bug Fixes

    • Corrected the AI assistant component's store state selection to properly initialize component state
    1. coderabbitai[bot](GitHub profile, opens in a new tab)commented

      No actionable comments were generated in the recent review. 🎉

      ℹ️ Recent review info
      ⚙️ Run configuration

      Configuration used: defaults

      Review profile: CHILL

      Plan: Pro

      Run ID: 4f9aaedb-eaf8-4545-8c5b-39e4df8dd2a6

      📥 Commits

      Reviewing files that changed from the base of the PR and between 44ef1ad64a8d475e39f78033b2186b262143a741 and b549f9595726cf8339803a592c20295dab18bdfe.

      📒 Files selected for processing (4)
      • .changeset/vite8-usestore-fix.md
      • packages/create/src/frameworks/react/add-ons/ai/assets/src/components/demo-AIAssistant.tsx
      • packages/create/src/frameworks/react/project/base/package.json
      • packages/create/src/frameworks/react/project/base/vite.config.ts.ejs

      📝 Walkthrough

      Walkthrough

      Upgrades Vite from 7.3.1 to 8.0.0 and updates related React tooling. Migrates from the vite-tsconfig-paths plugin to Vite's native resolve.tsconfigPaths configuration option. Fixes AI assistant component's useStore hook to explicitly pass a selector function.

      Changes

      Cohort / File(s)Summary
      Changeset Documentation
      .changeset/vite8-usestore-fix.md
      New changeset file documenting patch release: Vite 8 upgrade, vite-tsconfig-paths plugin replacement, and useStore usage correction in AI add-on.
      Dependency & Configuration Updates
      packages/create/src/frameworks/react/project/base/package.json, packages/create/src/frameworks/react/project/base/vite.config.ts.ejs
      Updated vite to ^8.0.0 and @vitejs/plugin-react to ^6.0.1; removed vite-tsconfig-paths dependency; migrated from explicit plugin invocation to Vite's built-in resolve.tsconfigPaths configuration; reformatted pnpm.onlyBuiltDependencies array.
      Component Hook Fix
      packages/create/src/frameworks/react/add-ons/ai/assets/src/components/demo-AIAssistant.tsx
      Updated useStore invocation to explicitly pass selector function: useStore(showAIAssistant, (state) => state) for correct state mapping.

      Estimated code review effort

      🎯 2 (Simple) | ⏱️ ~12 minutes

      Poem

      🐰 Hop along, dear Vite takes flight, Eight's the version, shining bright! Plugin paths now native-bound, useStore hooks sing a cleaner sound, Updates smooth, the build's delight! 🚀

      🚥 Pre-merge checks | ✅ 2 | ❌ 1

      ❌ Failed checks (1 warning)

      Check nameStatusExplanationResolution
      Docstring Coverage⚠️ WarningDocstring coverage is 0.00% which is insufficient. The required threshold is 80.00%.Write docstrings for the functions missing them to satisfy the coverage threshold.
      ✅ Passed checks (2 passed)
      Check nameStatusExplanation
      Description Check✅ PassedCheck skipped - CodeRabbit’s high-level summary is enabled.
      Title check✅ PassedThe title clearly and concisely summarizes the main changes: upgrading to Vite 8 and fixing the useStore selector in the AI add-on.
      ✏️ Tip: You can configure your own custom pre-merge checks in the settings.
      ✨ Finishing Touches
      📝 Generate docstrings
      • Create stacked PR
      • Commit on current branch
      🧪 Generate unit tests (beta)
      • Create PR with unit tests
      • Commit unit tests in branch `fix/vite8-usestore-selector`

      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.

Sign in to join this conversation.