Skip to content

refac: migrate to nextjs #52

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

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open

refac: migrate to nextjs #52

wants to merge 9 commits into from

Conversation

sdankel
Copy link
Member

@sdankel sdankel commented Apr 18, 2025

This pull request introduces significant changes to migrate the project to Next.js, improve bundle size management, and enhance code quality. Key updates include configuring Next.js, adding a bundle size analysis workflow, and replacing react-router-dom with Next.js routing. Additionally, ESLint and Prettier configurations were updated to align with the new setup.

Migration to Next.js:

  • Added a next.config.mjs file with configurations for strict mode, SWC minification, custom distDir, and environment variables (app/next.config.mjs).
  • Replaced react-router-dom navigation with Next.js routing (useRouter and router.push) in components like PackageDashboard and App (app/src/features/dashboard/components/PackageDashboard.tsx, app/src/App.tsx). [1] [2]

Bundle size management:

  • Added a GitHub Actions workflow to analyze and check bundle size during pull requests (.github/workflows/frontend-bundle-size-check.yml).
  • Introduced a script to enforce bundle size limits (app/scripts/check-bundle-size.js).

Code quality improvements:

  • Configured ESLint with rules for TypeScript, React, and Prettier integration (app/.eslintrc).
  • Updated package.json to include Next.js-specific scripts and dependencies, removing unused libraries and adding new ones like cross-env and @next/eslint-plugin-next (app/package.json). [1] [2]

Component updates:

  • Added use client directive to several components to enable client-side rendering with Next.js (app/src/app/page.tsx, app/src/features/detail/components/AbiContent.tsx). [1] [2]
  • Refactored AbiContent to dynamically import ReactJsonView for server-side rendering compatibility (app/src/features/detail/components/AbiContent.tsx).

Miscellaneous:

  • Added .next directory to .gitignore to exclude Next.js build artifacts (app/.gitignore).
  • Updated .env.example with a new environment variable for the backend API URL (app/.env.example).

Copy link

vercel bot commented Apr 18, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
forc-pub ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 26, 2025 0:34am

@sdankel sdankel marked this pull request as ready for review April 23, 2025 21:53
@sdankel sdankel requested a review from a team April 26, 2025 00:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant