ref(replay): Extract worker into dedicated package#7139
Conversation
|
Note: I've actually extracted the code to get the worker URL into the worker package. This way, we should be able to do any refactorings/experimentation etc. purely in that package, and replay itself doesn't really care what worker type you use, it just wants to get the appropriate URL and use it, done. Where |
| @@ -0,0 +1,6 @@ | |||
| import workerString from './worker'; | |||
There was a problem hiding this comment.
Not sure if vendor is the best name, but these are basically pre-built files.
We need this because workerString is built by rollup at build-time, so we can't reference it at dev-time. I figured this is simple enough code to just pipe this through without any build step for now.
Note that this is transparent for the replay package, it doesn't really care about how we build stuff here.
There was a problem hiding this comment.
static? not sure if that's any better
There was a problem hiding this comment.
I'll just merge it as vendor for now and we can revisit this later, this is purely internal anyhow.
size-limit report 📦
|
| @@ -0,0 +1,6 @@ | |||
| import workerString from './worker'; | |||
There was a problem hiding this comment.
static? not sure if that's any better
89130d5 to
201fad3
Compare

This supersedes #6665 and extracts part of #7025.
This moves the worker into a dedicated (private) @sentry-internal/replay-worker package. For now, this still builds the worker the same way as before (as a string).
It also adds the new
compress()stateless function, but doesn't use it yet.