Skip to content

build(ui): Add rspack as webpack alternative #77077

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 54 commits into from
May 15, 2025
Merged

build(ui): Add rspack as webpack alternative #77077

merged 54 commits into from
May 15, 2025

Conversation

scttcper
Copy link
Member

@scttcper scttcper commented Sep 6, 2024

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
  2. make rspack default for dev-ui
  3. use rspack for acceptance tests
  4. build production with rspack
  5. remove webpack

Summary

Webpack Rspack
HMR Time 4s 607ms
Dev Memory Usage 3.85 GB 2.8 GB
Build Production 131.53s 39.42s

RSPACK + SENTRY TODO (updated Oct 7th, 2024)

  • Investigate emotion autoLabel in development mode. Currently set to autoLabel: 'always', Could just set label setting based on node_env.
  • Add back webpack in order to merge (getsentry repo will block until it can accept a rspack file instead of webpack)
  • Figure out a path forward for translation string extraction that use webpack + babel's AST make build-js-po
  • Chartcuterie is failing for some reason

Thanks @hardfist for helping with this PR!

anonrig and others added 3 commits December 11, 2023 20:03
# Conflicts:
#	build-utils/last-built-plugin.ts
#	config/rspack.chartcuterie.config.ts
#	package.json
#	rspack.config.ts
#	yarn.lock
@github-actions github-actions bot added Scope: Frontend Automatically applied to PRs that change frontend components Scope: Backend Automatically applied to PRs that change backend components labels Sep 6, 2024
Copy link
Contributor

github-actions bot commented Sep 6, 2024

🚨 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 #discuss-dev-infra channel.

@scttcper
Copy link
Member Author

scttcper commented Sep 6, 2024

Just realized its working for me locally because i fixed platformicons locally will need to publish a fix to the svg paths there

# Conflicts:
#	package.json
#	rspack.config.ts
#	yarn.lock
Copy link

codecov bot commented Sep 26, 2024

❌ 1 Tests Failed:

Tests completed Failed Passed Skipped
10290 1 10289 9
View the full list of 1 ❄️ flaky tests
Sentry Application Details Editing an existing public Sentry App with a scope error handles client secret rotation

Flake rate in main: 18.18% (Passed 9 times, Failed 2 times)

Stack Traces | 0.405s run time
TestingLibraryElementError: Unable to find an element with the text: This will be the only time your client secret is visible!. This could be because the text is broken up by multiple elements. In this case, you can provide a function for your text matcher to make your matcher more flexible.

Ignored nodes: comments, script, style
...
    at Object.getElementError (.../sentry/sentry/node_modules/@.../dom/dist/config.js:37:19)
    at .../sentry/sentry/node_modules/@.../dom/dist/query-helpers.js:76:38
    at .../sentry/sentry/node_modules/@.../dom/dist/query-helpers.js:52:17
    at .../sentry/sentry/node_modules/@.../dom/dist/query-helpers.js:95:19
    at Object.<anonymous> (.../settings/organizationDeveloperSettings/sentryApplicationDetails.spec.tsx:591:42)

To view more test analytics, go to the Test Analytics Dashboard
📋 Got 3 mins? Take this short survey to help us improve Test Analytics.

@scttcper scttcper marked this pull request as ready for review May 9, 2025 20:12
@scttcper scttcper requested review from a team as code owners May 9, 2025 20:12
@scttcper scttcper requested a review from a team May 9, 2025 20:12
Copy link
Member

@evanpurkhiser evanpurkhiser left a comment

Choose a reason for hiding this comment

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

slam it

Copy link
Member

@JonasBa JonasBa left a comment

Choose a reason for hiding this comment

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

Those HMR numbers look 🔥

supported_locales: string[];
};

const localeCatalog: LocaleCatalog = JSON.parse(
Copy link
Member

Choose a reason for hiding this comment

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

Outside of the scope of this PR, but it would be interesting if we could time this locale procedure to see how much it contributes to the startup cost.

@scttcper scttcper merged commit 9168894 into master May 15, 2025
41 checks passed
@scttcper scttcper deleted the scttcper/rspack branch May 15, 2025 16:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Scope: Backend Automatically applied to PRs that change backend components Scope: Frontend Automatically applied to PRs that change frontend components WIP
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants