Skip to content

Commit 90c9d7e

Browse files
authored
chore(replay): Update worker example & script (#13882)
This should not have changed fundamentally since v7, but it is confusing that it says v7.xxx in the header, so updating this to be current again. Closes #13878
1 parent c2c8be9 commit 90c9d7e

File tree

3 files changed

+15
-6
lines changed

3 files changed

+15
-6
lines changed

packages/replay-worker/examples/worker.js

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
1-
/*! Sentry Replay Worker 7.77.0 (cce7d5ecf) | https://github.com/getsentry/sentry-javascript */
1+
/*! Sentry Replay Worker 8.33.1 (c992b3fad) | https://github.com/getsentry/sentry-javascript */
22
// DEFLATE is a complex format; to read this code, you should probably check the RFC first:
3+
// https://tools.ietf.org/html/rfc1951
4+
// You may also wish to take a look at the guide I made about this program:
5+
// https://gist.github.com/101arrowz/253f31eb5abc3d9275ab943003ffecad
6+
// Some of the following code is similar to that of UZIP.js:
7+
// https://github.com/photopea/UZIP.js
8+
// However, the vast majority of the codebase has diverged from UZIP.js to increase performance and reduce bundle size.
9+
// Sometimes 0 will appear where -1 would be more appropriate. This is because using a uint
10+
// is better for memory in most engines (I *think*).
311

412
// aliases for shorter compressed code (most minifers don't do this)
513
var u8 = Uint8Array,
@@ -849,12 +857,13 @@ function compress(data) {
849857
function mergeUInt8Arrays(chunks) {
850858
// calculate data length
851859
let len = 0;
852-
for (let i = 0, l = chunks.length; i < l; i++) {
853-
len += chunks[i].length;
860+
for (const chunk of chunks) {
861+
len += chunk.length;
854862
}
855863
// join chunks
856864
const result = new Uint8Array(len);
857865
for (let i = 0, pos = 0, l = chunks.length; i < l; i++) {
866+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
858867
const chunk = chunks[i];
859868
result.set(chunk, pos);
860869
pos += chunk.length;

0 commit comments

Comments
 (0)