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

Revert "feat(node): Rework ANR to use worker script via an integration (#9823)" #9931

Merged
merged 2 commits into from
Dec 20, 2023

Conversation

lforst
Copy link
Member

@lforst lforst commented Dec 20, 2023

This reverts commit ce9efc7.

Things we need to change before adding back:

  • Find a way not to emit files in our src folder but in the build/esm and build/cjs folders. Otherwise, we mess up nx caching which only caches stuff in the build folders.
  • Find a way to emit the worker file as CJS and ESM.
  • Find a way not to statically (via import) depend on the worker file that does potentially not exist.
  • The worker should probably not be bundled with all of its dependencies.

Copy link
Contributor

github-actions bot commented Dec 20, 2023

size-limit report 📦

Path Size
@sentry/browser (incl. Tracing, Replay, Feedback) - Webpack (gzipped) 75.39 KB (+0.06% 🔺)
@sentry/browser (incl. Tracing, Replay) - Webpack (gzipped) 66.79 KB (+0.06% 🔺)
@sentry/browser (incl. Tracing, Replay) - Webpack with treeshaking flags (gzipped) 60.39 KB (+0.06% 🔺)
@sentry/browser (incl. Tracing) - Webpack (gzipped) 31.39 KB (0%)
@sentry/browser (incl. Feedback) - Webpack (gzipped) 30.04 KB (0%)
@sentry/browser - Webpack (gzipped) 21.69 KB (0%)
@sentry/browser (incl. Tracing, Replay, Feedback) - ES6 CDN Bundle (gzipped) 72.79 KB (+0.02% 🔺)
@sentry/browser (incl. Tracing, Replay) - ES6 CDN Bundle (gzipped) 64.51 KB (+0.02% 🔺)
@sentry/browser (incl. Tracing) - ES6 CDN Bundle (gzipped) 30.71 KB (0%)
@sentry/browser - ES6 CDN Bundle (gzipped) 22.77 KB (0%)
@sentry/browser (incl. Tracing, Replay) - ES6 CDN Bundle (minified & uncompressed) 202.36 KB (+0.01% 🔺)
@sentry/browser (incl. Tracing) - ES6 CDN Bundle (minified & uncompressed) 92.28 KB (0%)
@sentry/browser - ES6 CDN Bundle (minified & uncompressed) 67.34 KB (0%)
@sentry/browser (incl. Tracing) - ES5 CDN Bundle (gzipped) 33.62 KB (0%)
@sentry/react (incl. Tracing, Replay) - Webpack (gzipped) 67.17 KB (+0.06% 🔺)
@sentry/react - Webpack (gzipped) 21.72 KB (0%)
@sentry/nextjs Client (incl. Tracing, Replay) - Webpack (gzipped) 83.93 KB (+0.05% 🔺)
@sentry/nextjs Client - Webpack (gzipped) 48.57 KB (0%)
@sentry-internal/feedback - Webpack (gzipped) 16.35 KB (0%)

Copy link
Member

@mydea mydea left a comment

Choose a reason for hiding this comment

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

@timfish we could do the same as we do for replay - which is have the worker in a separate package (replay-worker in that case) which builds the worker correctly. This may also work for this use case - in the case of replay we build it into a plain string worker instead of a base64 one, which is also more efficient possibly.

@lforst lforst merged commit fdd4c62 into develop Dec 20, 2023
95 checks passed
@lforst lforst deleted the lforst-revert-worker-pr branch December 20, 2023 13:45
@timfish
Copy link
Collaborator

timfish commented Dec 20, 2023

have the worker in a separate package

@sentry-internal/replay-worker works as a dev dependency of @sentry/replay because Replay is bundled (ie. preserveModules: false). I don't think we can do that with @sentry/node.

@lforst is right though, there's no reason the worker can't be outputted into build/*...

in the case of replay we build it into a plain string worker instead of a base64 one

How do you deal with escaping the quotes or did the replay worker not have that issue? The ANR worker ended up with every possible quote character in the source code which made it more complex.

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