Skip to content

Commit 3c1d07d

Browse files
committed
exclude canvas by default (remove __RRWEB_EXCLUDE_CANVAS__)
1 parent 8352f64 commit 3c1d07d

File tree

2 files changed

+7
-12
lines changed

2 files changed

+7
-12
lines changed

.size-limit.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@ module.exports = [
66
import: '{ record }',
77
gzip: true
88
},
9+
{
10+
name: 'rrweb - record & getCanvasManager only (gzipped)',
11+
path: 'packages/rrweb/es/rrweb/packages/rrweb/src/entries/all.js',
12+
import: '{ record, getCanvasManager }',
13+
gzip: true
14+
},
915
{
1016
name: 'rrweb - record only (min)',
1117
path: 'packages/rrweb/es/rrweb/packages/rrweb/src/entries/all.js',
@@ -21,7 +27,6 @@ module.exports = [
2127
const webpack = require('webpack');
2228
config.plugins.push(
2329
new webpack.DefinePlugin({
24-
__RRWEB_EXCLUDE_CANVAS__: true,
2530
__RRWEB_EXCLUDE_SHADOW_DOM__: true,
2631
__RRWEB_EXCLUDE_IFRAME__: true,
2732
}),

packages/rrweb/src/record/index.ts

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@ function wrapEvent(e: event): eventWithTime {
6363
}
6464

6565
declare global {
66-
const __RRWEB_EXCLUDE_CANVAS__: boolean;
6766
const __RRWEB_EXCLUDE_SHADOW_DOM__: boolean;
6867
const __RRWEB_EXCLUDE_IFRAME__: boolean;
6968
}
@@ -330,16 +329,7 @@ function record<T = eventWithTime>(
330329

331330
const canvasManager: CanvasManagerInterface = customCanvasManager
332331
? customCanvasManager
333-
: typeof __RRWEB_EXCLUDE_CANVAS__ === 'boolean' && __RRWEB_EXCLUDE_CANVAS__
334-
? new CanvasManagerNoop()
335-
: getCanvasManager({
336-
recordCanvas,
337-
blockClass,
338-
blockSelector,
339-
unblockSelector,
340-
sampling,
341-
dataURLOptions,
342-
});
332+
: new CanvasManagerNoop();
343333

344334
const shadowDomManager: ShadowDomManagerInterface =
345335
typeof __RRWEB_EXCLUDE_SHADOW_DOM__ === 'boolean' &&

0 commit comments

Comments
 (0)