Skip to content

build(ui): Use swc-plugin-component-annotate instead of babel #92427

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
Jun 2, 2025

Conversation

scttcper
Copy link
Member

@scttcper scttcper commented May 28, 2025

currently published from my own repo https://github.com/scttcper/swc-plugin-component-annotate

Sentry webpack plugin pushes babel in front of swc to annotate components, instead this will add a plugin to the existing swc compilation process. Cuts off roughly half of the rspack production build time.

The only change from the babel version: index.tsx files include part of the path. so folder/index.tsx

On m1 pro doing yarn build-production-rspack:
before: 30.55s
after: 17.17s

todo: migrate the package into https://github.com/getsentry/sentry-javascript-bundler-plugins

Sentry webpack plugin pushes babel in front of swc to annotate components, instead this will add a plugin to the existing swc compilation process. Cuts off roughly half of the rspack production build time.

The only change from the babel version:
- index.tsx files include part of the path. so `folder/index.tsx`

On m1:
before: 30.55s
after: 17.17s
@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label May 28, 2025
@scttcper scttcper changed the title build(ui): Use swc-plugin-component-annotate insteada of babel build(ui): Use swc-plugin-component-annotate instead of babel May 28, 2025
@JonasBa JonasBa marked this pull request as ready for review May 28, 2025 18:36
@JonasBa JonasBa requested a review from a team as a code owner May 28, 2025 18:36
@JonasBa JonasBa marked this pull request as draft May 28, 2025 18:37
@JonasBa
Copy link
Member

JonasBa commented May 28, 2025

I mistakenly hit ready to review so I converted it back to draft.

This should help me a lot with tracking components down in prod as it now handled the index files better. Thanks for making the conversion 🙏🏼

@scttcper scttcper marked this pull request as ready for review May 29, 2025 01:40
@scttcper scttcper requested a review from a team May 29, 2025 01:40
@scttcper scttcper merged commit e77db06 into master Jun 2, 2025
42 checks passed
@scttcper scttcper deleted the scttcper/use-swc-annotate branch June 2, 2025 18:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Scope: Frontend Automatically applied to PRs that change frontend components
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants