-
Notifications
You must be signed in to change notification settings - Fork 51
feat: Combine injection snippets #853
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
feat: Combine injection snippets #853
Conversation
b8eee94 to
1d24d11
Compare
1d24d11 to
6982176
Compare
Semver Impact of This PR🟡 Minor (new features) 📋 Changelog PreviewThis is how your changes will appear in the changelog. New Features ✨
Internal Changes 🔧
🤖 This preview updates automatically when you update the PR. |
logaretm
left a comment
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.
Nice one!
Lms24
left a comment
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.
Thanks! Nice idea with the CodeInjection class!
| datasource | package | from | to | | ---------- | ------------------- | ----- | ----- | | npm | @sentry/vite-plugin | 4.7.0 | 4.8.0 | ## [v4.8.0](https://github.com/getsentry/sentry-javascript-bundler-plugins/blob/HEAD/CHANGELOG.md#480) ##### New Features ✨ - Inject component annotations into HTML elements rather than React components by [@timfish](https://github.com/timfish) in [#851](getsentry/sentry-javascript-bundler-plugins#851) - Combine injection snippets by [@timfish](https://github.com/timfish) in [#853](getsentry/sentry-javascript-bundler-plugins#853) - Use Rolldown native `MagicString` by [@timfish](https://github.com/timfish) in [#846](getsentry/sentry-javascript-bundler-plugins#846)
Since Rolldown/Vite/webpack now use a single injection plugin, its simpler to combine the injection strings to remove duplicate code.
All the injection snippets contain the same global lookup code which can be a common header. Once you are using two snippets (release injection + debug ID injection), this saves 180 bytes per chunk. If you are also using metadata injection this saves a further 180 bytes per chunk.