Skip to content

feat: migrate from Vite and React Routre to the Next.js#1260

Open
nekofar wants to merge 478 commits intonounsDAO:masterfrom
nekofar:feature/migrate-from-vite-to-next
Open

feat: migrate from Vite and React Routre to the Next.js#1260
nekofar wants to merge 478 commits intonounsDAO:masterfrom
nekofar:feature/migrate-from-vite-to-next

Conversation

@nekofar
Copy link
Contributor

@nekofar nekofar commented Aug 13, 2025

We ditched Vite and react-router and moved the whole web app over to Next.js App Router. Now it actually plays nice with SSR/SSG, has proper file-system routing, and doesn’t fall apart when you open a modal. Netlify config’s updated too; publishes from .next with the Next.js plugin.

What changed

  • Build/setup: swapped Vite junk for next.config.ts, Next scripts, polyfills, SVGR loader, Lingui SWC, the works.
  • Routing: goodbye react-router; everything’s next/link + next/navigation. Added redirects so old paths don’t break (/auction/:id → /noun/:id).
  • Env: all VITE_* vars are dead; long live NEXT_PUBLIC_*. Update your .env or nothing works.
  • Codebase: standardized kebab-case, killed case-sensitivity issues, reorganized components, trimmed react-bootstrap fat.
  • Extras: type safety and a11y tightened up, asset imports fixed, workspace config cleaned.

Breaking stuff

  • Env vars need the NEXT_PUBLIC_* prefix. Old ones won’t load.
  • Routes are now file-system based; check any deep links or automation.
  • No more react-router. Update downstream code/tests.
  • Some things default to server components now; if you assumed browser-only, you’ll need to adjust.

How to test

  • pnpm installpnpm --filter @nouns/webapp dev (or dev:sepolia).
  • Make sure .env uses the NEXT_PUBLIC_* vars.
  • Click around: navigation, auctions, proposals, candidates, forks. Open modals. Check translations. No SSR errors should pop up.

Deployment

  • Netlify: .next + @netlify/plugin-nextjs with updated vars.
  • Prod: pnpm --filter @nouns/webapp build && pnpm --filter @nouns/webapp start.

@vercel
Copy link

vercel bot commented Aug 13, 2025

@nekofar is attempting to deploy a commit to the Nouns Team on Vercel.

A member of the Team first needs to authorize it.

@nekofar nekofar force-pushed the feature/migrate-from-vite-to-next branch 2 times, most recently from 32a41f8 to 0701920 Compare August 14, 2025 18:21
@volkyeth volkyeth moved this from Backlog to In progress in Nouns dev Aug 15, 2025
@volkyeth
Copy link
Member

@nekofar fyi I'll be migrating nouns.wtf from netlify to vercel soon™, so mind that during your testing

@nekofar
Copy link
Contributor Author

nekofar commented Aug 15, 2025

@nekofar fyi I'll be migrating nouns.wtf from netlify to vercel soon™, so mind that during your testing

Yeah, noticed that too. Turns out Netlify and Vercel get along just fine, so no extra adapter hassle and the same code ships on both without a fuss.

@nekofar nekofar force-pushed the feature/migrate-from-vite-to-next branch from b5b925a to 819f64f Compare August 16, 2025 02:49
nekofar added 20 commits August 16, 2025 07:16
Align props for better readability and maintainability. Improves code consistency and visual clarity.
Standardize and update import paths to ensure consistent casing. Improves readability and helps prevent potential issues across environments.
Ensure localized strings are displayed correctly for users. Improves user experience in `zh-CN` and `ja-JP` locales.
Add new dependencies to `onlyBuiltDependencies` for build optimization. Improves build performance and ensures required dependencies are prioritized.
Move `onlyBuiltDependencies` and `overrides` from package.json to pnpm-workspace.yaml. Simplifies dependency management and improves configuration clarity.
Replace `VITE_` prefixes with `NEXT_PUBLIC_` for consistency. Ensures alignment with Next.js conventions and improves maintainability.
Enable client-side rendering explicitly for `nav-bar`. Ensures compatibility with React Server Components and improves rendering clarity.
Simplify component structure for improved clarity and maintainability. Enhances overall readability and prepares for potential future updates.
Update import paths to use consistent kebab-case formatting. Improves readability, prevents potential case-sensitivity issues, and ensures uniformity across the codebase.
Ensure consistent casing across import paths for uniformity and to prevent potential case-sensitivity issues.
Ensure consistent casing for import paths across utils. Improves readability and prevents case-sensitivity issues in different environments.
Improve import order across components for better readability and maintainability. This aligns with established project conventions and ensures a clean structure.
Improve code robustness by adding explicit null checks and better error handling. Ensures stability across utilities, state slices, and wrappers while enhancing readability and maintainability.
Increase robustness by using `isNullish` for null checks. Improves code readability and ensures better handling of undefined or null values in auction data.
Consolidate `.npmrc` config into `pnpm-workspace.yaml` for better config management. Simplifies project setup and aligns with pnpm conventions.
Ensure compatibility and resolve potential bugs by upgrading dev dependencies. Keeps the codebase up-to-date and aligns with latest improvements.
Standardize formatting and improve dependency management in `pnpm-workspace.yaml`. Enhances readability and aligns with project conventions.
Align versions with other dependencies to ensure compatibility. Resolves potential issues caused by version mismatch in `pnpm-workspace.yaml`.
Align with the latest stable release and improve compatibility. This ensures the project benefits from new features and resolved issues in the updated version.
Ensure `imgPath` is trimmed to avoid unexpected whitespace issues. Improves reliability in resolving the correct image source.
nekofar added 30 commits August 26, 2025 23:55
This change simplifies styling by inlining former CSS module styles and replacing them with Tailwind classes for improved maintainability and consistency.
Replaced CSS module styles with Tailwind utilities for cleaner and more consistent styling. This removes unnecessary legacy CSS files and simplifies style management.
Improved readability and consistency across components and hooks. Removed redundant props, updated typings, and refined state management for better maintainability.
simplified imports by removing unnecessary `index` files, improving code organization and maintainability. This aligns with the goal of a cleaner and more streamlined structure.
streamlined imports by reorganizing component folders. This improves maintainability and reduces nested paths for cleaner code structure.
streamlined imports and relocated assets for cleaner structure and improved maintainability.
updated import paths to use absolute paths, improving readability and maintainability by standardizing the import structure.
Deleted legacy CSS module files after migrating styles to Tailwind. This simplifies the codebase and reduces unused assets.
moved and streamlined component for improved structure and clarity. This promotes better organization and reduces complexity in file paths.
standardized conditions by replacing `Boolean` with `isTruthy` for improved readability and consistency.
standardized and updated relative imports to absolute paths for improved readability and maintainability. Replaced `Boolean` with `isTruthy` where applicable for consistency.
streamlined test coverage by removing an unnecessary test case. This improves maintainability and reduces redundant assertions.
streamlined the test suite by eliminating a redundant test case. This improves maintainability and aligns with recent updates to the component behavior.
replaced inline prop definition with `SectionProps`. This improves readability, enforces consistency, and aligns with TypeScript practices.
added test coverage for `Link`, `ModalSubTitle`, `ModalTextPrimary`, `ModalTitle`, `Section`, `ModalLabel`, and `NavBarItem`. This ensures component behavior is verified and improves reliability.
migrated remaining components and utilities to Next.js routing. This removes legacy dependencies and ensures consistency with Next.js routing conventions.
aligned paths with pluralized structure for consistency. Updated references and routing to match new convention and added redirection for backward compatibility.
moved `NavBar`, `Footer`, and `Toaster` to `layout.tsx` for better organization. Simplified `Providers` structure to improve readability and maintainability.
reduced noise in eslint outputs by suppressing warnings. This ensures clearer focus on errors and improves log readability.
enabled client-side rendering for the `footer` component. This ensures compatibility with client-dependent features and improves clarity in rendering behavior.
moved `Toaster` from `layout.tsx` to `Providers` for better separation of concerns. This enhances maintainability and ensures consistent placement within the app hierarchy.
refined `NavBar` styling with improved alignment and spacing. Enhances visual consistency and user experience.
aligned utility checks and routing logic with pluralized paths. This ensures consistent path structure and adherence to naming conventions.
introduced `useShouldUseStateBg` hook for clarity and reuse. This simplifies logic, improves readability, and reduces redundancy in state checks.
replaced custom utility classes with reusable variants. Improves maintainability, reduces redundancy, and enhances consistency in styles.
standardized color styles by replacing inline values with brand tokens. Enhances maintainability, consistency, and alignment with design system.
simplified className handling by using the `cn` utility. This reduces redundancy, improves readability, and ensures consistent class composition.
Replace ad-hoc responsive variants with Tailwind-style max-<screen> based on configured screens.\n\n- Auto-generate max-<screen> for xs, sm, md, md-lg, lg, xl, 2xl.\n- Retain existing custom min-1400 container variant.\n- Keep tokens and utilities (brand colors, shadows, bg images, radii).\n- Prepares codebase to replace arbitrary pixel breakpoints with named variants.
Unify responsive naming to Tailwind defaults and standardize class composition.\n\n- Replace legacy lg-max/xl-max with max-lg/max-xl.\n- Map arbitrary pixel breakpoints (e.g., 1040/660/568/414) to nearest screens.\n- Switch remaining template/variable className usage to cn() and group utilities.\n- Preserve visuals, dark mode, and aria/data variants.\n- Align codebase to the generated max-<screen> variants and md-lg screen.
improved flex and spacing consistency by refining class usage. Enhances readability, aligns with responsive patterns, and ensures design coherence.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: In progress

Development

Successfully merging this pull request may close these issues.

2 participants