-
-
Notifications
You must be signed in to change notification settings - Fork 32.6k
[examples] Upgrade Remix to v2 #39229
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
Conversation
Netlify deploy previewhttps://deploy-preview-39229--material-ui.netlify.app/ Bundle size report |
@@ -4,16 +4,17 @@ | |||
"private": true, | |||
"scripts": { | |||
"build": "remix build", | |||
"dev": "remix dev", | |||
"postinstall": "remix setup node", |
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 line should be removed on v2.
$ npx remix setup node
WARNING: The setup command is no longer necessary as of v2. This is a no-op. Please remove this from your dev and CI scripts, as it will be removed in v3.
/** | ||
* @type {import('@remix-run/dev/config').AppConfig} | ||
*/ | ||
/** @type {import('@remix-run/dev').AppConfig} */ | ||
module.exports = { | ||
appDirectory: 'app', | ||
browserBuildDirectory: 'public/build', |
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.
'browserBuildDirectory' to 'assetsBuildDirectory'
https://remix.run/docs/en/main/start/v2#browserbuilddirectory
/** | ||
* @type {import('@remix-run/dev/config').AppConfig} | ||
*/ | ||
/** @type {import('@remix-run/dev').AppConfig} */ | ||
module.exports = { | ||
appDirectory: 'app', | ||
browserBuildDirectory: 'public/build', | ||
publicPath: '/build/', | ||
serverBuildDirectory: 'build', |
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.
'serverBuildDirectory' to 'serverBuildPath'
https://remix.run/docs/en/main/start/v2#serverbuilddirectory
/** | ||
* @type {import('@remix-run/dev/config').AppConfig} | ||
*/ | ||
/** @type {import('@remix-run/dev').AppConfig} */ | ||
module.exports = { | ||
appDirectory: 'app', | ||
browserBuildDirectory: 'public/build', | ||
publicPath: '/build/', | ||
serverBuildDirectory: 'build', | ||
devServerPort: 8002, |
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.
'devServerPort: 8002,' to
future: {
dev: {
port: 8002,
},
},
@@ -1,20 +1,22 @@ | |||
{ |
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.
add "module": "CommonJS",
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.
I can't find anything missing. This is one of the best community contributions I've seen recently, offering a great PR description and well documentation of each change. Very well done, especially considering it is a first contribution to the project! I hope to see many more in the future 👌
🚀 Overview
I've updated the Remix framework version to v2 in the Remix sample of MUI's
examples
.🌱 Background and Purpose
Remix officially released its v2 version on September 14th. In line with this, the environment setup tool,
create-remix
, now creates projects based on the v2 template. This necessitated updating the MUI Remix sample to be compatible with v2. Additionally, this sample has@remix-run/react
set tolatest
, which resulted in it being non-functional. This is another reason prompting the update.🛠 Key Changes
ES2019
=>ES2022
, the others just changed the orderpostinstall
is no longer necessary as of v2 (I also commented inline)meta
function to match the latest version.routes/
directory to v2 conventions.CatchBoundary
component into the newErrorBoundary
component.remix.config.js
.📷 Captures
Main Page

About Page

Movie
2023-09-30.21.27.56.mov