Add replay bundles, keep standard ones without replay#1380
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR introduces a new Replay bundle to the Rollbar JavaScript SDK, allowing the Replay feature to be distributed as a separate module while keeping the standard bundles lightweight without replay functionality.
- Separated Replay functionality into dedicated bundles with their own webpack configurations
- Created new entry points and bundle files for Replay-enabled Rollbar instances
- Updated package.json to export the new Replay bundles through the "./replay" path
Reviewed Changes
Copilot reviewed 6 out of 7 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| webpack.config.cjs | Added webpack configurations for generating Replay-specific bundles (vanilla, UMD, and no-conflict variants) |
| src/browser/rollbarReplay.js | New main Rollbar instance that includes the Replay component alongside other core components |
| src/browser/rollbar.js | Removed Replay import and component registration to keep standard bundles lightweight |
| src/browser/bundles/rollbarReplay.noconflict.js | New no-conflict bundle entry point for Replay functionality |
| src/browser/bundles/rollbarReplay.js | New standard bundle entry point for Replay functionality with global setup |
| package.json | Added "./replay" export path pointing to the new Replay bundles |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| function addUMDReplayToConfig(webpackConfig, filename, extraPlugins, minimizer) { | ||
| const replayConfig = extend({}, UMDReplayConfigBase); | ||
| replayConfig.plugins = extraPlugins; | ||
| replayConfig.optimization = optimizationConfig(minimizer); | ||
| replayConfig.output = extend({ filename: filename }, replayConfig.output); | ||
| webpackConfig.push(replayConfig); | ||
| } |
There was a problem hiding this comment.
Missing name property assignment in addUMDReplayToConfig. Other similar functions like addVanillaReplayToConfig set replayConfig.name = filename which should be consistent across all config functions.
| function addNoConflictReplayToConfig(webpackConfig, filename, extraPlugins, minimizer) { | ||
| const replayConfig = extend({}, noConflictReplayConfigBase); | ||
| replayConfig.plugins = extraPlugins; | ||
| replayConfig.optimization = optimizationConfig(minimizer); | ||
| replayConfig.output = extend({ filename: filename }, replayConfig.output); | ||
| webpackConfig.push(replayConfig); | ||
| } |
There was a problem hiding this comment.
Missing name property assignment in addNoConflictReplayToConfig. Other similar functions like addVanillaReplayToConfig set replayConfig.name = filename which should be consistent across all config functions.
There was a problem hiding this comment.
We're not consistent in this regard across this config. I'll fix this in a subsequent PR where I refactor the config.
721f13b to
179cb59
Compare
Description of the change
This pull request introduces a new Replay bundle to the Rollbar JavaScript SDK, along with the necessary build configuration and package exports. The main changes add support for the Replay feature as a separately bundled module, update the build system to generate Replay-specific outputs, and adjust the main package to reference these new bundles.
Type of change