Skip to content

Commit 9168894

Browse files
scttcperanonrig
andauthored
build(ui): Add rspack as webpack alternative (#77077)
Building off the work done in #61475 I think the plan would be to use this as a dev-ui replacement until we're more confident and can setup the getsentry repo as well (if you aren't familiar we have another repo with billing pages etc). Potential adoption roadmap 1. merge rspack as optional dev only command yarn dev-ui-rspack 1. make rspack default for dev-ui 1. use rspack for acceptance tests 1. build production with rspack 1. remove webpack ## Summary | | Webpack | Rspack | | ---------------- | ----------- | ----------- | | HMR Time | 4s | 607ms | | Dev Memory Usage | 3.85 GB | 2.8 GB | | Build Production | 131.53s | 39.42s | --------- Co-authored-by: Yagiz Nizipli <yagiz@nizipli.com>
1 parent 1e2f45f commit 9168894

File tree

6 files changed

+1112
-81
lines changed

6 files changed

+1112
-81
lines changed

build-utils/last-built-plugin.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import fs from 'node:fs';
22
import path from 'node:path';
3-
import type webpack from 'webpack';
3+
import type {Compiler} from 'webpack';
44

55
type Options = {
66
basePath: string;
@@ -15,7 +15,7 @@ class LastBuiltPlugin {
1515
this.isWatchMode = false;
1616
}
1717

18-
apply(compiler: webpack.Compiler) {
18+
apply(compiler: Compiler) {
1919
compiler.hooks.watchRun.tapAsync('LastBuiltPlugin', (_, callback) => {
2020
this.isWatchMode = true;
2121
callback();

package.json

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,10 @@
5151
"@react-stately/tabs": "^3.6.9",
5252
"@react-stately/tree": "^3.8.4",
5353
"@react-types/shared": "^3.24.1",
54-
"@rsdoctor/webpack-plugin": "1.0.1",
54+
"@rsdoctor/webpack-plugin": "1.1.2",
55+
"@rspack/cli": "1.3.10",
56+
"@rspack/core": "1.3.10",
57+
"@rspack/plugin-react-refresh": "1.4.3",
5558
"@sentry-internal/global-search": "^1.0.0",
5659
"@sentry-internal/rrweb": "2.34.0",
5760
"@sentry-internal/rrweb-player": "2.34.0",
@@ -182,6 +185,7 @@
182185
"@sentry/jest-environment": "6.0.0",
183186
"@sentry/profiling-node": "9.16.1",
184187
"@styled/typescript-styled-plugin": "^1.0.1",
188+
"@swc/plugin-emotion": "9.0.4",
185189
"@tanstack/eslint-plugin-query": "^5.66.1",
186190
"@testing-library/dom": "10.4.0",
187191
"@testing-library/jest-dom": "6.6.3",
@@ -246,18 +250,25 @@
246250
"fix:prettier": "prettier \"**/*.md\" \"**/*.yaml\" \"**/*.[jt]s(x)?\" --write --log-level=error",
247251
"dev": "(yarn check --verify-tree || yarn install --check-files) && sentry devserver",
248252
"dev-ui": "SENTRY_UI_DEV_ONLY=1 SENTRY_WEBPACK_PROXY_PORT=7999 SENTRY_UI_HOT_RELOAD=1 webpack serve",
253+
"dev-ui-rspack": "SENTRY_UI_DEV_ONLY=1 SENTRY_WEBPACK_PROXY_PORT=7999 SENTRY_UI_HOT_RELOAD=1 rspack serve",
249254
"dev-ui-admin": "SENTRY_ADMIN_UI_DEV=1 yarn dev-ui",
255+
"dev-ui-admin-rspack": "SENTRY_ADMIN_UI_DEV=1 yarn dev-ui-rspack",
250256
"dev-ui-storybook": "STORYBOOK_TYPES=1 yarn dev-ui",
251257
"dev-acceptance": "NO_DEV_SERVER=1 NODE_ENV=development webpack --watch",
258+
"dev-acceptance-rspack": "NO_DEV_SERVER=1 NODE_ENV=development rspack --watch",
252259
"webpack-profile": "NO_TS_FORK=1 webpack --profile --json > stats.json",
260+
"webpack-profile-rspack": "NO_TS_FORK=1 rspack build --json > stats.json",
253261
"install-api-docs": "yarn install --cwd ./api-docs",
254262
"build-deprecated-docs": "yarn install-api-docs && ts-node api-docs/index.ts api-docs/openapi.json tests/apidocs/openapi-deprecated.json",
255263
"diff-docs": "yarn install-api-docs && ts-node api-docs/openapi-diff.ts",
256264
"deref-api-docs": "ts-node api-docs/index.ts tests/apidocs/openapi-spectacular.json tests/apidocs/openapi-derefed.json",
257265
"build-chartcuterie-config": "node --experimental-strip-types config/build-chartcuterie.ts",
266+
"build-acceptance-rspack": "CODECOV_ENABLE_BA=false IS_ACCEPTANCE_TEST=1 NODE_ENV=production rspack",
258267
"build-acceptance": "CODECOV_ENABLE_BA=false IS_ACCEPTANCE_TEST=1 NODE_ENV=production webpack",
259268
"build-production": "NODE_ENV=production webpack --mode production",
269+
"build-production-rspack": "NODE_ENV=production rspack --mode production",
260270
"build": "NODE_OPTIONS=--max-old-space-size=4096 webpack",
271+
"build-rspack": "NODE_OPTIONS=--max-old-space-size=4096 rspack",
261272
"build-js-loader": "ts-node scripts/build-js-loader.ts",
262273
"build-js-po": "node --experimental-strip-types build-utils/ts-extract-gettext.ts",
263274
"validate-api-examples": "yarn --cwd api-docs openapi-examples-validator ../tests/apidocs/openapi-derefed.json --no-additional-properties",

0 commit comments

Comments
 (0)