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

feat: upgrade rspack to 0.5 canary #1171

Merged
merged 3 commits into from
Jan 8, 2024
Merged

feat: upgrade rspack to 0.5 canary #1171

merged 3 commits into from
Jan 8, 2024

Conversation

ahabhgk
Copy link
Contributor

@ahabhgk ahabhgk commented Jan 4, 2024

Summary

Related Links

Checklist

  • Tests updated.
  • Documentation updated.

Copy link

netlify bot commented Jan 4, 2024

Deploy Preview for rsbuild ready!

Name Link
🔨 Latest commit 9891868
🔍 Latest deploy log https://app.netlify.com/sites/rsbuild/deploys/659be101d7dc420008b0453c
😎 Deploy Preview https://deploy-preview-1171--rsbuild.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@ahabhgk ahabhgk marked this pull request as draft January 4, 2024 10:27
@chenjiahan
Copy link
Member

@ahabhgk I have create an branch for 0.3.0 release, you can merge to this branch: https://github.com/web-infra-dev/rsbuild/tree/dev_0.3.0

@ahabhgk ahabhgk changed the base branch from main to dev_0.3.0 January 5, 2024 06:35
@ahabhgk ahabhgk marked this pull request as ready for review January 5, 2024 11:52
@@ -77,6 +40,8 @@ export const applyBasicReactSupport = (api: RsbuildPluginAPI) => {
return;
}

chain.resolve.alias.set('react-refresh', REACT_REFRESH_DIR_PATH);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

before this alias will be added by rspack, in 0.5 react-refresh will be a peerDependencies of @rspack/core, i'm not sure whether user need to install react-refresh by themselves when using rsbuild, but I saw react-refresh is dependencies of the plugin-react, so I add this alias at here

it's ok to remove this alias if the original intention is let user install react-refresh by themselves

Copy link
Member

Choose a reason for hiding this comment

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

@rsbuild/plugin-react already provides react-refresh, usually users do not need to install it 😄

return;
}

new compiler.webpack.EntryPlugin(compiler.context, reactRefreshEntry, {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

No need, @rspack/plugin-react-refresh will add this

if (swcConfig.jsc?.externalHelpers) {
chain.resolve.alias.set(
'@swc/helpers',
path.dirname(require.resolve('@swc/helpers/package.json')),
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@swc/helpers is a peerDependencies of @rspack/core in 0.5, before the alias is added by rspack

if (usingHMR) {
chain
.plugin(utils.CHAIN_ID.PLUGIN.HMR)
.use(utils.bundler.HotModuleReplacementPlugin);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

devServer is remove from core, now dev-server need to apply HotModuleReplacementPlugin manually

Copy link
Member

Choose a reason for hiding this comment

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

get 👌

@@ -1277,7 +1275,9 @@ exports[`applyDefaultPlugins > should apply default plugins correctly when prod
"_options": {
"compress": "{"passes":1,"pure_funcs":[],"drop_console":false}",
"exclude": undefined,
"extractComments": "true",
"extractComments": {
"condition": "@preserve|@lic|@cc_on|^/**!",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

true will be resolve to "@preserve|@lic|@cc_on|^/**!", so the minify result should be the same

> & {
import?: BuiltinsOptions['pluginImport'];
rspackExperiments?: {
relay?:
Copy link
Member

Choose a reason for hiding this comment

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

Can we import relay / emotion / import options from Rspack?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Let's do it after 0.5 release

@chenjiahan chenjiahan changed the base branch from dev_0.3.0 to main January 8, 2024 11:13
@chenjiahan
Copy link
Member

Some conflicts needs to be resolved...

And I have changed the target branch to main as the main branch is going to be used to release v0.3.0.

@chenjiahan chenjiahan changed the title feat: upgrade rspack to 0.5 feat: upgrade rspack to 0.5 canary Jan 8, 2024
@chenjiahan chenjiahan merged commit 5237f65 into main Jan 8, 2024
11 checks passed
@chenjiahan chenjiahan deleted the upgrade-rspack-0.5 branch January 8, 2024 12:06
@chenjiahan
Copy link
Member

Excellent work! ❤️

@chenjiahan chenjiahan mentioned this pull request Jan 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants