-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
build(replay): Use Monorepo's rollup config to build Replay #6343
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
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
size-limit report 📦
|
bea29c4
to
33fd89f
Compare
33fd89f
to
a93cd23
Compare
This was referenced Nov 30, 2022
mydea
approved these changes
Nov 30, 2022
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.
AMAZING! Great work, this will simplify everything going forward 🎉
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR updates Replay's build config to use our monorepo's rollup config for building and transpiling the Replay integration. With this PR, we're introducing a breaking change because the tarball structure is going to change. However, this only breaks users who imported from package-internal paths directly and not from the top-level package.
More specifically, these are the changes:
./config/rollup.config.core.ts
to./rollup.npm.config.js
which now uses ourmakeNPMConfigVariants
andmakeBaseNPMConfig
rollup config helper functions to create ESM and CJS transpiled JS, just like in all our other packages. For now we have to change this to JavaScript but we can ofc revisit having TS-based rollup configs in the future.index.js
files, this config now just transpiles the individual modules. This is how we do it in all our other packages. We might have to revisit this strategy for vendoring rrweb and bundling but we can build on top of this PR to do so../config/rollup.worker.config.ts
to./rollup.worker.config.js
(no changes)package.json
scripts so that they are in line with the scripts of our other packages. This should simplify the scripts a little.__DEBUG_BUILD__
withtrue
#6341 as the__SENTRY_DEBUG__
flag is now set in our rollup helper functionsBesides executing unit tests and manually inspecting the transpiled output, I also tested these changes with a plain-js test app and it still seems to work.
ref: #6280