Skip to content

Commit

Permalink
fix dep and add comment
Browse files Browse the repository at this point in the history
  • Loading branch information
mydea committed Oct 27, 2023
1 parent 0ad353f commit bc641d1
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 13 deletions.
2 changes: 1 addition & 1 deletion packages/replay-worker/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,10 @@
},
"homepage": "https://docs.sentry.io/platforms/javascript/session-replay/",
"devDependencies": {
"@rollup/plugin-commonjs": "^21.0.1",
"@types/pako": "^2.0.0"
},
"dependencies": {
"@rollup/plugin-commonjs": "25.0.7",
"pako": "2.1.0"
},
"engines": {
Expand Down
5 changes: 5 additions & 0 deletions packages/replay-worker/src/Compressor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@ import type * as PakoTypes from 'pako';
// @ts-expect-error no types here
import * as pako from 'pako/lib/deflate.js';

// NOTE: We have to do this weird workaround because by default,
// pako does not treeshake when importing from 'pako'.
// In order to get proper tree shaking, we have to import from 'pako/lib/deflate.js',
// Which is not great but works
// types come from @types/pako, so we can safely use them by casting
const Deflate = (pako as typeof PakoTypes).Deflate;
const deflate = (pako as typeof PakoTypes).deflate;
const constants = (pako as typeof PakoTypes).constants;
Expand Down
12 changes: 0 additions & 12 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4753,18 +4753,6 @@
is-reference "1.2.1"
magic-string "^0.27.0"

"@rollup/plugin-commonjs@25.0.7":
version "25.0.7"
resolved "https://registry.yarnpkg.com/@rollup/plugin-commonjs/-/plugin-commonjs-25.0.7.tgz#145cec7589ad952171aeb6a585bbeabd0fd3b4cf"
integrity sha512-nEvcR+LRjEjsaSsc4x3XZfCCvZIaSMenZu/OiwOKGN2UhQpAYI7ru7czFvyWbErlpoGjnSX3D5Ch5FcMA3kRWQ==
dependencies:
"@rollup/pluginutils" "^5.0.1"
commondir "^1.0.1"
estree-walker "^2.0.2"
glob "^8.0.3"
is-reference "1.2.1"
magic-string "^0.30.3"

"@rollup/plugin-commonjs@^15.0.0":
version "15.1.0"
resolved "https://registry.yarnpkg.com/@rollup/plugin-commonjs/-/plugin-commonjs-15.1.0.tgz#1e7d076c4f1b2abf7e65248570e555defc37c238"
Expand Down

0 comments on commit bc641d1

Please # to comment.