Skip to content
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: Use globalThis for code injection #2162

Closed

Conversation

timfish
Copy link
Contributor

@timfish timfish commented Sep 23, 2024

Since v8 of the JavaScript SDKs we dropped Node v12 support which means all the platforms we support have globalThis.

This saves ~90 bytes every time debug IDs are injected.

@lforst points out that this would require a major version bump of both the CLI and the bundler plugins so these bumps would likely need to occur at the same time and it might not be a priority to merge this straight away!

@JakeShirley
Copy link

I just re-implemented this in #2271 before seeing this. I'd love this change, as this would allow us to use Sentry in QuickJS contexts. Without this QuickJS cannot use the debug injection (global, window, and self do not exist in ES2023 which is what QuickJS supports).

@szokeasaurusrex
Copy link
Member

szokeasaurusrex commented Dec 5, 2024

#2301 should allow globalThis to be used, and it is backwards compatible, unlike this change. Therefore, I am closing this PR in favor of #2301 for now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants