Skip to content

Attempt: Upgrade to NextJS version 13 #645

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

Merged
merged 5 commits into from
Oct 24, 2023
Merged

Conversation

JiaeK
Copy link
Contributor

@JiaeK JiaeK commented Jan 27, 2023

This PR is an attempt to upgrade this repo’s NextJS version to the latest (v.13).
The idea stemmed from the talk which initially desired to integrate the internationalization function for rescript-lang.org. I remember the ReScript team wanted the NextJS upgrade to happen with the i8n, so we (with @namenu & @mununki) thought why don’t we help?

Up to NextJS version 12, the upgrade was decently successful. And to version 13, it’s not completely done since there're a few hydration errors that still exist. Hope this is somewhat helpful to initiate the idea.

This PR,

  • Updates NextJS to v.13 (ref)
  • Adjusts transpileModules in next.config.js (ref)
  • Removes esbuild-loader, path, fs, target, future in next.config.js
  • Adds SWC in next.config.js
  • Removes .babelrc file
  • Switches to @next/mdx
  • Removes child <a> tags of <link>

JiaeK and others added 5 commits January 4, 2023 16:42
- Update next-transpile-modules to version 9
- Remove .babelrc file
- Remove esbuild-loader, path, fs, target, future from next.config.js
- Add SWC in next.config.js
* Update next-transpile-modules to v.10
* Switch to @next/mdx
* Adjust transpileModules
* Remove child <a> tags of <link>
…-lang.org into nextjs-12"

This reverts commit 5334930, reversing
changes made to 25d4a35.
@ryyppy
Copy link
Member

ryyppy commented Feb 3, 2023

Just as a side-note, the frontmatter parsing seems to be broken as well:
image

But this is a good start!

@@ -1,7 +1,7 @@
---
title: Migrate from JSX v3
description: "Migrate from JSX v3"
canonical: "/docs/react/latest/migrate-react"
canonical: "/docs/react/latest/migrate-from-v3"
Copy link
Member

@ryyppy ryyppy Feb 3, 2023

Choose a reason for hiding this comment

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

I am very confused by this change. Current master has a latest/migrate-react. So this change is essentially adding a new page migrate-from-v3 (which I agree is a way better url, although I'd probably call it migrate-from-jsx-3 instead).

Now migrate-react is a thing for quite a while, ppl may still refer to it, so we might need a redirection to this page via the nextjs config to not break urls.

This is quite an unrelated change, so I'd want this to be a separate PR to master.

@aspeddro aspeddro mentioned this pull request May 30, 2023
2 tasks
@ryyppy ryyppy merged commit 90baa7a into rescript-lang:master Oct 24, 2023
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.

2 participants