@rrweb/replay@2.0.0
Breaking change for <script> based usage (vs. 2.0.0-alpha.X)
While the replay package was not available in 1.x, the rrweb-replay.js script was available as a separate build output, using a rrwebReplay global.
During the alpha process, the build output changed to UMD format and the global underwent a shift to rrweb.Replayer and back again to rrwebReplay.Replayer for the final 2.0.0 release. If you were previously using a 2.0 alpha version of the replay package, you will need to use the rrwebReplay global instead of rrweb, and if using jsdelivr, need to use the 'umd' folder instead of 'dist':
<script src="https://cdn.jsdelivr.net/npm/@rrweb/replay@2.0.0/umd/replay.js">
<script>
const replayer = new rrwebReplay.Replayer()
</script>
Note: the recommended approach is now to use ES Modules as outlined in our docs.
Major Changes
-
#1762
22bc4c3Thanks @Juice10! - BREAKING CHANGE: Rename UMD global names fromrrwebtorrwebRecordfor the recorder andrrwebReplayfor the replayer. This avoids conflicts when both are loaded on the same page. -
#1497
2606a2aThanks @Juice10! - Distributed files have new filenames, paths and extensions. Important: If you reference distributed files or types directly, you might have to update your paths/filenames. E.g. you import fromrrweb/typings/...orrrdom/es. However you runimport rrweb from 'rrweb'you won't notice a difference with this change. If you include rrweb files directly in a script tag, you might have to update that path to include a the.umd.cjsfiles instead. All.jsfiles now use ES modules which can be used in modern browsers, node.js and bundlers that support ES modules. All npm packages now also ship.cjsand.umd.cjsfiles. The.umd.cjsfiles are CommonJS modules that bundle all files together to make it easy to ship one file to browser environments (similar to the previous.jsfiles). The.cjsfiles are CommonJS modules that can be used in older Node.js environments. Types should be better defined inpackage.jsonand if you need specific types they might be exported from new packages (for examplePlayerMachineStateandSpeedMachineStateare now exported from@rrweb/replay). Check thepackage.json'smainandexportsfield for the available files. -
#1497
2606a2aThanks @Juice10! - Remove the rrweb-all.js, rrweb-record.js, and rrweb-replay.js files fromrrwebpackage. Now you can use@rrweb/all,@rrweb/record, and@rrweb/replaypackages instead. Check out the README of each package for more information or check out PR #1033 to see the changes.
Patch Changes
-
db20184Thanks @Juice10! - Keep package version in sync with other packages -
#1704
33e01f5Thanks @eoghanmurray! - Provide a /umd/ output folder alongside the /dist/ one so that we can serve UMD (Universal Module Definition) files with a .js extension, without upsetting expectations set by package.json that all .js files in /dist/ are modules -
Updated dependencies [
0f0a532,7103625,a2c8a1a,3d1877c,af0962c,57a940a,e65465e,d872d28,36da39d,b5e30cf,40bbc25,22bc4c3,11f6567,490b3e2,dc20cd4,3e9e42f,f27e545,7261c43,03b5216,ae6908d,46f1b25,e0f862b,cbbd1e5,a6893f7,8aea5b0,267e990,68076b7,9c6edfe,a1ec9a2,8059d96,bfe14c5,4014305,efdc167,88ea2d0,609b7fa,f6f07e9,1e0b273,1fe39ab,490b3e2,979d2b1,1385f7a,d7c72bf,ebcbe8b,123a81e,05478c3,fc390a9,bbbfa22,e96f668,58c9104,227d43a,bc84246,d2582e9,aa79db7,82f6fec,2606a2a,980a38c,2606a2a,a225d8e,a82a3b4,5c27b76,b149cf3,a2be77b,227d43a,527d9d3,79837ac,a7c33f2,43e4f5b,3cc4323,d38893f,6f4e691,d7cf8dd,335639a,123a81e,04ee6ed,5fbb904,1e6f71b,d08624c,2606a2a,123a81e,314a8dd,5a78938,3416c3a,7c0dc9d,8e47ca1,53b83bb,9cd28b7,07ac5c9,33e01f5,02f50d2,502d15d,d0fbe23,a3de582,e08706a,8d209a6,be6bf52,aaabdbd,1e6f71b,6388fb5,c278d06,4cb4d0e,5e6c132]:- @rrweb/types@2.0.0
- rrweb@2.0.0