Skip to content

build(ui): Use rspack to build production #92493

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 4 commits into from
May 29, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 10 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@
"@emotion/is-prop-valid": "^1.3.0",
"@emotion/react": "^11.14.0",
"@emotion/styled": "^11.14.0",
"@mdx-js/loader": "^3.1.0",
"@mdx-js/mdx": "^3.1.0",
"@pmmmwh/react-refresh-webpack-plugin": "0.5.16",
"@popperjs/core": "^2.11.5",
"@react-aria/button": "^3.9.8",
"@react-aria/combobox": "^3.10.3",
Expand Down Expand Up @@ -74,6 +77,7 @@
"@sentry/status-page-list": "^0.6.0",
"@sentry/webpack-plugin": "^3.4.0",
"@spotlightjs/spotlight": "^2.0.0-alpha.1",
"@swc/plugin-emotion": "9.0.4",
"@tanstack/query-async-storage-persister": "^5.72.1",
"@tanstack/react-query": "^5.72.1",
"@tanstack/react-query-devtools": "^5.72.1",
Expand All @@ -84,7 +88,7 @@
"@types/gtag.js": "^0.0.12",
"@types/history": "^3.2.5",
"@types/invariant": "^2.2.35",
"@types/jest": "29.5.12",
"@types/jest": "29.5.14",
"@types/js-beautify": "^1.14.3",
"@types/js-cookie": "^3.0.2",
"@types/lodash": "^4.14.182",
Expand Down Expand Up @@ -130,6 +134,7 @@
"fuse.js": "^6.6.2",
"gettext-parser": "7.0.1",
"gl-matrix": "^3.4.3",
"html-webpack-plugin": "5.6.3",
"idb-keyval": "^6.2.1",
"invariant": "^2.2.4",
"jed": "^1.1.0",
Expand Down Expand Up @@ -192,14 +197,10 @@
"@eslint/compat": "^1.2.7",
"@eslint/eslintrc": "^3.3.0",
"@eslint/js": "^9.22.0",
"@mdx-js/loader": "^3.1.0",
"@mdx-js/mdx": "^3.1.0",
"@pmmmwh/react-refresh-webpack-plugin": "0.5.16",
"@sentry-internal/rrweb-types": "2.34.0",
"@sentry/jest-environment": "6.0.0",
"@sentry/profiling-node": "9.16.1",
"@styled/typescript-styled-plugin": "^1.0.1",
"@swc/plugin-emotion": "9.0.4",
"@tanstack/eslint-plugin-query": "^5.66.1",
"@testing-library/dom": "10.4.0",
"@testing-library/jest-dom": "6.6.3",
Expand All @@ -225,7 +226,6 @@
"eslint-plugin-typescript-sort-keys": "^3.3.0",
"eslint-plugin-unicorn": "^57.0.0",
"globals": "^15.14.0",
"html-webpack-plugin": "5.6.3",
"jest": "29.7.0",
"jest-canvas-mock": "^2.5.2",
"jest-environment-jsdom": "29.7.0",
Expand Down Expand Up @@ -279,10 +279,11 @@
"diff-docs": "yarn install-api-docs && ts-node api-docs/openapi-diff.ts",
"deref-api-docs": "ts-node api-docs/index.ts tests/apidocs/openapi-spectacular.json tests/apidocs/openapi-derefed.json",
"build-chartcuterie-config": "node --experimental-strip-types config/build-chartcuterie.ts",
"build-acceptance-rspack": "CODECOV_ENABLE_BA=false IS_ACCEPTANCE_TEST=1 NODE_ENV=production rspack",
"build-acceptance-webpack": "CODECOV_ENABLE_BA=false IS_ACCEPTANCE_TEST=1 NODE_ENV=production webpack",
"build-acceptance": "yarn build-acceptance-rspack",
"build-production": "NODE_ENV=production webpack --mode production",
"build-acceptance-webpack": "CODECOV_ENABLE_BA=false IS_ACCEPTANCE_TEST=1 NODE_ENV=production webpack",
"build-acceptance-rspack": "CODECOV_ENABLE_BA=false IS_ACCEPTANCE_TEST=1 NODE_ENV=production rspack",
"build-production": "yarn build-production-rspack",
Copy link
Member

Choose a reason for hiding this comment

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

woo!

"build-production-webpack": "NODE_ENV=production webpack --mode production",
"build-production-rspack": "NODE_ENV=production rspack --mode production",
"build": "NODE_OPTIONS=--max-old-space-size=4096 webpack",
"build-rspack": "NODE_OPTIONS=--max-old-space-size=4096 rspack",
Expand Down
3 changes: 3 additions & 0 deletions rspack.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,9 @@ const swcReactLoaderConfig: RuleSetRule['options'] = {
const appConfig: Configuration = {
mode: WEBPACK_MODE,
target: 'browserslist',
// Fail on first error instead of continuing to build
// https://rspack.rs/config/other-options#bail
bail: IS_PRODUCTION,
entry: {
/**
* Main Sentry SPA
Expand Down
4 changes: 2 additions & 2 deletions src/sentry/build/_static_assets.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ def _cmd(*cmd: str) -> None:

_cmd("yarn", "install", "--production", "--frozen-lockfile", "--quiet")
_cmd("yarn", "tsc", "-p", "config/tsconfig.build.json")
_cmd("yarn", "build-production", "--bail")
_cmd("yarn", "build-chartcuterie-config", "--bail")
_cmd("yarn", "build-production")
_cmd("yarn", "build-chartcuterie-config")


def main() -> int:
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4374,10 +4374,10 @@
dependencies:
"@types/istanbul-lib-report" "*"

"@types/jest@29.5.12":
version "29.5.12"
resolved "https://registry.yarnpkg.com/@types/jest/-/jest-29.5.12.tgz#7f7dc6eb4cf246d2474ed78744b05d06ce025544"
integrity sha512-eDC8bTvT/QhYdxJAulQikueigY5AsdBRH2yDKW3yveW7svY3+DzN84/2NUgkw10RTiJbWqZrTtoGVdYlvFJdLw==
"@types/jest@29.5.14":
version "29.5.14"
resolved "https://registry.yarnpkg.com/@types/jest/-/jest-29.5.14.tgz#2b910912fa1d6856cadcd0c1f95af7df1d6049e5"
integrity sha512-ZN+4sdnLUbo8EVvVc2ao0GFW6oVrQRPn4K2lglySj7APvSrgzxHiNNK99us4WDMi57xxA2yggblIAMNhXOotLQ==
dependencies:
expect "^29.0.0"
pretty-format "^29.0.0"
Expand Down
Loading