-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
build: replace webpack with rspack #61475
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
ca7f991
to
39a73e2
Compare
rspack.config.ts
Outdated
: []), | ||
// ...(SHOULD_FORK_TS | ||
// ? [ | ||
// new ForkTsCheckerWebpackPlugin({ |
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.
Fork TS is very slow, will be the bottleneck of rspack build speeds. If you can run tsc as a separate command, it will keep the builds very fast.
@anonrig do you know how to setup devenv for outside contributors, I'm not sure how should i setup the environment, I can't launch the server so I can't verify whether the migration runs successfully |
@Hardist You don't need devenv for the frontend app. Cloning, installing dependencies and running "yarn dev-ui" is sufficient for running the frontend. The public documentation is available at https://develop.sentry.dev/environment/ |
no need for homepage but seems needed for login page,but i will verify homepage first |
You can use mkert command in package.json with cookie sync chrome extension. https://chrome.google.com/webstore/detail/sentry-cookie-sync/kchlmkcdfohlmobgojmipoppgpedhijh |
🚨 Warning: This pull request contains Frontend and Backend changes! It's discouraged to make changes to Sentry's Frontend and Backend in a single pull request. The Frontend and Backend are not atomically deployed. If the changes are interdependent of each other, they must be separated into two pull requests and be made forward or backwards compatible, such that the Backend or Frontend can be safely deployed independently. Have questions? Please ask in the |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #61475 +/- ##
=======================================
Coverage 81.14% 81.14%
=======================================
Files 5191 5192 +1
Lines 228290 228333 +43
Branches 38279 38280 +1
=======================================
+ Hits 185239 185284 +45
Misses 37433 37433
+ Partials 5618 5616 -2 |
b040b5c
to
dcbfadb
Compare
dcbfadb
to
326c892
Compare
326c892
to
f44fcd7
Compare
@@ -42,55 +42,55 @@ section.org-login { | |||
background-size: cover; | |||
|
|||
&.google { | |||
background-image: url(~sentry-logos/logo-google.svg); |
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.
no need to change this for rspack, you can use alias to workaround this, but it's better to change since ~ is deprecated in latest less-loader both for webpack and rspack
}, | ||
{ | ||
test: /\.css/, | ||
use: ['style-loader', 'css-loader'], | ||
type: 'css', | ||
}, |
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'm curious why sentry use style-loader to handle css and use minicssExtractPlugin to handle less before?
@@ -376,13 +293,13 @@ const appConfig: Configuration = { | |||
* Without this, webpack will still output all of the unused locale files despite | |||
* the application never loading any of them. | |||
*/ | |||
new webpack.ContextReplacementPlugin( | |||
new ContextReplacementPlugin( |
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.
not sure Rspack supports webpack.ContextReplacementPlugin now
}, | ||
|
||
// This only runs in production mode | ||
// Grabbed this example from https://github.com/webpack-contrib/css-minimizer-webpack-plugin | ||
minimizer: ['...', new CssMinimizerPlugin()], | ||
minimizer: [ |
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 actually no needed and enabled by default in production mode
This issue has gone three weeks without activity. In another week, I will close it. But! If you comment or otherwise update it, I will reset the clock, and if you remove the label "A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀 |
This issue has gone three weeks without activity. In another week, I will close it. But! If you comment or otherwise update it, I will reset the clock, and if you remove the label "A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀 |
This issue has gone three weeks without activity. In another week, I will close it. But! If you comment or otherwise update it, I will reset the clock, and if you remove the label "A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀 |
This issue has gone three weeks without activity. In another week, I will close it. But! If you comment or otherwise update it, I will reset the clock, and if you remove the label "A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀 |
bump |
This pull request has gone three weeks without activity. In another week, I will close it. But! If you comment or otherwise update it, I will reset the clock, and if you add the label "A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀 |
This issue has gone three weeks without activity. In another week, I will close it. But! If you comment or otherwise update it, I will reset the clock, and if you remove the label "A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀 |
@ScriptedAlchemy @hardfist thanks for your time looking at this. I've opened #77077 to startup the investigation with rspack v1. Congrats on the launch btw |
@scttcper thanks, if you met any problems, please ping me |
Summary
This pull-request removes babel and Webpack in favor of Rspack and SWC. This change comes with a significant performance boost and improves our productivity. Currently, it takes 14 seconds to build Sentry. Prior to this PR, it took 58 seconds.
Before
We are using Babel and Webpack for building our frontend application. It took almost 58 seconds on my M2 machine to run
yarn build-production
command.After
We removed 14 dependencies and added 3 new dependencies. Depending on Babel and Jest, we can remove more. Currently it takes 14 seconds to build, minify both JS and CSS files.
TODOs:
--output-path
CLI option web-infra-dev/rspack#4977build-js-loader.ts
script since it brings an unnecessary dependency:terser
babel.config
.tsc
child process DX a little bit better.downsample
npm library in production buildThanks @hardfist for helping with this PR!