Migrate from Next.js to TanStack Start#12
Draft
Copilot wants to merge 4 commits into
Draft
Conversation
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
- Replace Next.js with TanStack Start (@tanstack/react-start@1.166.9) - Replace vinxi with Vite 7.x as the build system - Remove @vercel/analytics, @vercel/speed-insights, next-themes packages - Add vite.config.ts with tanstackStart plugin and vite-tsconfig-paths - Create app/router.tsx with getRouter() export for TanStack Start - Create app/client.tsx and app/ssr.tsx as new entry points - Create app/routes/__root.tsx as root layout with inline theme script - Create app/routes/index.tsx as home page route - Create app/routes/$region/$player.tsx with createServerFn for SSR data - Add lib/theme.ts with simple localStorage-based theme utilities - Update ThemeSwitch to use custom theme utilities (no next-themes) - Update Header to use TanStack Router's Link and useLocation - Update SearchForm to use TanStack Router's useNavigate - Update SummonerDetails and MasteryCard to use <img> instead of next/image - Update tsconfig.json for Vite/Bundler module resolution - Update eslint.config.mjs to remove next-specific rules - Update globals.css to use Google Fonts instead of next/font - Remove all 'use client' directives (not needed in TanStack Start) - Remove Next.js specific files (layout.tsx, page.tsx, next.config.ts etc.) - Add app/routeTree.gen.ts and dist/ to .gitignore - Add tsr.config.json for route tree generation configuration Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…ont, fix scale type Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Migrate Next.js project to Tanstack Start framework
Migrate from Next.js to TanStack Start
Mar 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Replaces the Next.js App Router with TanStack Start (Vite-based), removes all Vercel-specific packages, and swaps
next-themesfor a minimal localStorage-based theme solution.Framework & Build
vite.config.tsreplacesnext.config.tsusing@tanstack/react-start/plugin/vite+vite-tsconfig-pathstsr.config.jsonconfigures TanStack Router file-based routingapp/client.tsx(hydration),app/ssr.tsx(createStartHandler)vite dev / build / previewRouting
File-based routes under
app/routes/:__root.tsx— full HTML document shell (replacesapp/layout.tsx+app/providers.tsx)index.tsx— home page$region/$player.tsx— player page withcreateServerFnloader; keepsRIOT_API_KEYserver-only across both SSR and client-side navigationTheme (replaces
next-themes)lib/theme.ts—getStoredTheme/applyTheme/getCurrentThemevialocalStorage<script>in<head>prevents FOUC by applyingdarkclass before paintThemeSwitchnow uses auseEffectto sync with system preference changesRemoved Packages
next,next-themes,@vercel/analytics,@vercel/speed-insights,eslint-config-next,cross-envComponent Updates
next/link→Linkfrom@tanstack/react-router;usePathname→useLocationuseRouter(navigation) →useNavigatenext/image→<img>(images are external CDN URLs with fixed dimensions)next/font/google→ Google Fonts stylesheet link in<head>'use client'directives and Next.js server component wrappers (components/server/)Original prompt
Migrate this entire Nextjs project to Tanstack Start. Use other Tanstack libraries wherever they are applicable. Remove vercel related packages from the project. Remove next-themes and implement a simple solution for theme changing. Keep Tailwind CSS and Typescript. Since this web app heavily relies on SSR and server related features for dynamic rendering, Tanstack Start is perfect. Follow all of the best practices and guidelines from the up-to-date official documentation. Keep configurations as close to the default as possible, only deviating from the defaults if it is necessary. Configure Tanstack Router with the best settings and preferences. Lastly, make sure the web app is fully functional with Tanstack Start and all of Tanstack related libraries (if applicable).
[Chronological Review: The conversation began with the user requesting to migrate a Next.js project to Tanstack Start, emphasizing the need to remove Vercel-related packages, implement a simple theme-changing solution, and maintain Tailwind CSS and TypeScript. The user also requested adherence to best practices from the official documentation and proper configuration of Tanstack Router. The user then attempted to commit changes and delegate the task to a cloud agent, which triggered the summarization.][Intent Mapping:
[Technical Inventory:
[Code Archaeology:
[Progress Assessment:
[Context Validation: All critical information for continuation is captured, including user goals and specific requests for the migration process.]
[Recent Commands Analysis:
1. Conversation Overview: - Primary Objectives: - "Migrate this entire Nextjs project to Tanstack Start." - "Remove vercel related packages from the project." - "Remove next-themes and implement a simple solution for theme changing." - "Keep Tailwind CSS and Typescript." - "Configure Tanstack Router with the best settings and preferences." - "Delegate to cloud agent." - Session Context: The user initiated a migration of a Next.js project to Tanstack Start, specifying various requirements and configurations. The conversation progressed towards committing changes and delegating the task. - User Intent Evolution: The user maintained a clear focus on migrating to Tanstack Start while ensuring specific technologies and configurations were preserved.- Technical Foundation:
- Next.js: Framework for server-rendered React applications.
- Tanstack Start: New framework for building applications with SSR capabilities.
- Tailwind CSS: Utility-first CSS framework for styling.
- TypeScript: Superset of JavaScript for type safety.
- Codebase Status:
- File Name: package.json
- Purpose: Manage project dependencies and scripts.
- Current State: User is preparing to commit changes related to the migration.
- Key Code Segments: Dependencies related to Next.js and Vercel are to be removed.
- Dependencies: The file is central to the migration process, as it dictates the project's libraries.
- Problem Resolution:
- Issues Encountered: Need to remove unnecessary packages and implement a new theming solution.
- Solutions Implemented: User has outlined the migration steps and requirements.
- Debugging Context: No ...
Created from VS Code.
💬 Send tasks to Copilot coding agent from Slack and Teams to turn conversations into code. Copilot posts an update in your thread when it's finished.