-
-
Notifications
You must be signed in to change notification settings - Fork 115
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
♻️ Full migration from app router PLUS next15/react19 #450
♻️ Full migration from app router PLUS next15/react19 #450
Conversation
Screenshot all 4 GET image api endpoints with complex config per viewport type (Chrome and Mobile Chrome) in preparation for migration. Also updated TailwindCSS config from .js to .ts.
Followed nextjs official docs and best practices, backed by Playwright behavior regression test passing. Upated unit tests to reflect the new framework.
🦋 Changeset detectedLatest commit: b809885 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
✅ Deploy Preview for github-socialify ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is wonderful 💯! I see so many great improvements.
I left a few questions above please review and lmk your thoughts.
I'll conduct a more thorough review when I'm on my computer tomorrow. 🙌
Upgraded using the official NextJS codemod. No file modded by the codemod. Updated types and deps. Fully compatible with exising behavior tests, all passed.
b0e8cca
to
d00a7b9
Compare
Regressively tested all the requested changes, and determined safe to keep them. Added server-only prod dep to explicitly limit code involving GITHUB_TOKEN to only run server-side.
I'll let you ultimately decide whether to keep it. It's extremely light-weight w/ no versioning/upgrade needed. |
👍 server-only is definitely a good DX and build time improvement. https://nextjs.org/docs/app/building-your-application/rendering/composition-patterns#keeping-server-only-code-out-of-the-client-environment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you apply these two changes for Next15 upgrade?
Hi @wei , I used P.S. It's a known issue that their site's |
I also found this unexpected behavior where the import breaks for the I suspect this is related to how next caches/imports? |
@KemingHe That all sounds and looks great! I was previewing the feature branch and noticed the selected font is not loaded for the preview. Everything else is working well. Could you help confirm the font is loaded correctly? |
Hi @wei , assuming you are referring to the latest
I have a few ideas on the root cause, but before we get into that, what if you try to create a branch off the current working If so I argue that we are actually good to merge to |
@KemingHe good point! I just checked the master branch deployment: https://master--github-socialify.netlify.app I can confirm the other fonts are working correctly on the preview page there but not in this pull request preview url. |
Wait, @wei , I meant the difference between Edit: typo On top of such, I also noticed that a This is not the |
I believe the permalink act the same as the pull request preview deployments. Image APIs add fonts within the svg so it's slightly different: socialify/common/renderSVG.tsx Line 25 in 811ccd2
Whereas the preview page loads font here: socialify/src/components/preview/preview.tsx Lines 129 to 140 in 811ccd2
I noticed in master, these two font stylesheet links are added to head, but not in the pull request preview domain: I see no changes around these lines in this PR so it might be related to how RE: font fallback. Fallback is not used as defined in root layout as the font family was overwritten without a fallback: |
It is bad practice to have two |
I propose we (I) modify the current Playwright |
Confirmed I'm working on an alternative. |
Sounds good! I will make an update to fix this and will let you update the snapshot. Please stay tuned~ |
Replaced next <Head> with html <head> in preview to resolve font not updating issue. Updated Playwright user story regressing test and snapshot to cover this weak point. Updated select wrapper component to be more accessible and compatible with Playwright. Not sure why config panel width changed after editing component, thus had to update one UI snapshot as well. Further polished pnpm scripts to better match actual flag name, i.e. pnpm test:e2e:update-snapshots to match playwright test --update-snapshots (with an 's')
@wei , my latest commit is a (like you said) "bad practice" fix, as it uses the html |
797d168
to
4030c8e
Compare
4030c8e
to
b809885
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@KemingHe ✅ Approved!! I'm so excited.
Completes #375
Part 1/2 Page Router -> App Router
Part 2/2 -> Next15/React19 via Official Codemod
Thank you @wei for your tremendous support; I look forward to replying to your review.
Edit: additional context