Skip to content

refac: migrate to nextjs#52

Merged
sdankel merged 9 commits intomasterfrom
sophie/nextjs
Apr 30, 2025
Merged

refac: migrate to nextjs#52
sdankel merged 9 commits intomasterfrom
sophie/nextjs

Conversation

@sdankel
Copy link
Copy Markdown
Contributor

@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).

@vercel
Copy link
Copy Markdown

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
Copy link
Copy Markdown
Member

@JoshuaBatty JoshuaBatty left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Copy Markdown
Contributor

@zees-dev zees-dev left a comment

Choose a reason for hiding this comment

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

LGTM 👍

A few nits and/or minor issues.
The only potential higher-priority issue is using potentially unsupported/deprecated version node to build in CI - not a blocker though; can be addressed in future PRs.

@sdankel
Copy link
Copy Markdown
Contributor Author

sdankel commented Apr 30, 2025

LGTM 👍

A few nits and/or minor issues. The only potential higher-priority issue is using potentially unsupported/deprecated version node to build in CI - not a blocker though; can be addressed in future PRs.

Thanks! I will address your comments in a future PR.

@sdankel sdankel merged commit 2846204 into master Apr 30, 2025
11 checks passed
@sdankel sdankel deleted the sophie/nextjs branch April 30, 2025 20:03
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.

3 participants