Skip to content
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

Migrate to next.js #112

Merged
merged 110 commits into from
Apr 16, 2022
Merged

Migrate to next.js #112

merged 110 commits into from
Apr 16, 2022

Conversation

htbkoo
Copy link
Owner

@htbkoo htbkoo commented Apr 14, 2022

And as a bonus, this will upgrade react to v18.0.0 as well

And this will fix #109, fix #103, close #85, close #62 and close #108

TODO checklist:

  1. add next.js dependencies
  2. setup next.js
  3. remove create-react-app dependencies, e.g. react-scripts
  4. migrate all relevant parts to next.js (e.g. app architecture, build pipeline)
  5. fix all errors
  6. test build locally
  7. fix build and configure GitHub actions CI
  8. compare performance before and after migration
    1. Example reports:
      1. before migration (production)
        hey-personal-portfolio-prod_pagespeed-web-dev_20220415
      2. after migration (staging)
        hey-personal-portfolio-staging_pagespeed-web-dev_20220415
      3. with page split(staging)
        with-page-split-rearchitecture_hey-personal-portfolio-staging_pagespeed-web-dev_20220415
  9. fix sub-path problem after deploying to GitHub pages
  10. fix storybook
    1. extracted to Fix storybook after migration to next.js #114
  11. split web app into Home, Portfolio and Contact pages
  12. fix local dev environment (currently the styles are not applied until the toggling of dark / light mode)
  13. make sure service worker still works and can pass the lighthouse PWA check
  14. clean up and removed unused old codes / assets
    1. extracted to Miscellaneous code refactoring #71 and Review project and remove unused codes #105
  15. fix scrollspy which stops working after migration
    1. related: Migrate to @makotot/ghostui to replace usage of react-scrollspy #113

htbkoo added 30 commits April 13, 2022 19:22
…json` as there is a standalone `.eslintrc.json` from `next.js`
…xt.js` and removed leftover dependencies from `create-react-app`
…owngrade `@types/react` and `@types/react-dom` back to `v17.x.x` because of the breaking changes in version 18 that could not be fixed until either material-ui is upgraded to v5 or this PR (DefinitelyTyped/DefinitelyTyped#59751) is merged

Note this codemod (https://github.com/eps1lon/types-react-codemod) would not help because the errors are caused by library (see this facebook/react#24304 (comment) for the details)

References:
1. https://stackoverflow.com/questions/71810438/compilation-issue-with-react-typescript-and-material-ui-4
2. DefinitelyTyped/DefinitelyTyped#56210 (comment)
3. facebook/react#24304 (comment)
4. https://classic.yarnpkg.com/lang/en/docs/selective-version-resolutions/
5. facebook/react#24304 (comment)
…add module aliases in order to fix broken tests
htbkoo added 25 commits April 15, 2022 17:50
…de-in / fade-out effect when `pathname` has changed (instead of applying the effect every time when components has changed which is overkill)
…e and split pages into different component for better first load time and UX
…aterial-ui` and `next.js` styles incompatibility issue (reference: https://stackoverflow.com/a/67276953)
…terial-ui` and `next.js` by using some temporary hacks to make sure the classNames are deterministic (reference: https://v4.mui.com/styles/advanced/#class-names)
@htbkoo htbkoo merged commit 4561a43 into master Apr 16, 2022
@htbkoo htbkoo deleted the migrate-to-next-js branch April 16, 2022 01:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant