Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: upgrade rrweb to alpha.17 #1488

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@
"@rollup/plugin-node-resolve": "^15.3.0",
"@rollup/plugin-terser": "^0.4.4",
"@rollup/plugin-typescript": "^12.1.1",
"@rrweb/types": "2.0.0-alpha.16",
"@rrweb/rrweb-plugin-console-record": "2.0.0-alpha.17",
"@rrweb/types": "2.0.0-alpha.17",
"@sentry/types": "8.7.0",
"@testing-library/dom": "^9.3.0",
"@testing-library/jest-dom": "^6.5.0",
Expand Down Expand Up @@ -103,9 +104,8 @@
"rollup": "^4.24.0",
"rollup-plugin-dts": "^6.1.1",
"rollup-plugin-visualizer": "^5.12.0",
"rrweb": "2.0.0-alpha.16",
"@rrweb/rrweb-plugin-console-record": "2.0.0-alpha.15",
"rrweb-snapshot": "2.0.0-alpha.16",
"rrweb": "2.0.0-alpha.17",
"rrweb-snapshot": "2.0.0-alpha.17",
"sinon": "9.0.2",
"testcafe": "1.19.0",
"testcafe-browser-provider-browserstack": "1.14.0",
Expand All @@ -127,7 +127,7 @@
],
"pnpm": {
"patchedDependencies": {
"[email protected].16": "patches/[email protected].16.patch"
"[email protected].17": "patches/[email protected].17.patch"
}
}
}
37 changes: 10 additions & 27 deletions patches/[email protected] → patches/[email protected]
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
diff --git a/dist/rrweb.js b/dist/rrweb.js
index 1db2d08b2fe9a73521001c3aa88b1a64d1b3e71a..5a3ea8410b0f1dfa7248b9cb9752c04eea7b3ad3 100644
index 12f4ad3c7f897fe8a9ee2f4595dcf37f302d17c5..43f6bd95676c456e187b7bd68ba7af56e7b09f29 100644
--- a/dist/rrweb.js
+++ b/dist/rrweb.js
@@ -85,6 +85,9 @@ function isCSSImportRule(rule) {
function isCSSStyleRule(rule) {
return "selectorText" in rule;
@@ -246,6 +246,9 @@ function isCSSImportRule(rule2) {
function isCSSStyleRule(rule2) {
return "selectorText" in rule2;
}
+function findStylesheet(doc, href) {
+ return Array.from(doc.styleSheets).find((s) => s.href === href);
+}
class Mirror {
constructor() {
__publicField$1(this, "idNodeMap", /* @__PURE__ */ new Map());
@@ -661,9 +664,14 @@ function serializeElementNode(n2, options) {
@@ -821,9 +824,14 @@ function serializeElementNode(n2, options) {
}
}
if (tagName === "link" && inlineStylesheet) {
Expand All @@ -22,15 +22,15 @@ index 1db2d08b2fe9a73521001c3aa88b1a64d1b3e71a..5a3ea8410b0f1dfa7248b9cb9752c04e
+ const href = n2.href;
+ let stylesheet = findStylesheet(doc, href);
+ if (!stylesheet && href.includes('.css')) {
+ const rootDomain = window.location.origin
+ const stylesheetPath = href.replace(window.location.href, '')
+ const potentialStylesheetHref = rootDomain + '/' + stylesheetPath
+ const rootDomain = window.location.origin;
+ const stylesheetPath = href.replace(window.location.href, '');
+ const potentialStylesheetHref = rootDomain + '/' + stylesheetPath;
Comment on lines -25 to +27
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No real difference here, just added ; at the end of each line

+ stylesheet = findStylesheet(doc, potentialStylesheetHref);
+ }
let cssText = null;
if (stylesheet) {
cssText = stringifyStylesheet(stylesheet);
@@ -5016,11 +5024,19 @@ class CanvasManager {
@@ -13276,11 +13284,19 @@ class CanvasManager {
let rafId;
const getCanvas = () => {
const matchedCanvas = [];
Expand All @@ -55,7 +55,7 @@ index 1db2d08b2fe9a73521001c3aa88b1a64d1b3e71a..5a3ea8410b0f1dfa7248b9cb9752c04e
return matchedCanvas;
};
const takeCanvasSnapshots = (timestamp) => {
@@ -5041,13 +5057,20 @@ class CanvasManager {
@@ -13301,13 +13317,20 @@ class CanvasManager {
context.clear(context.COLOR_BUFFER_BIT);
}
}
Expand All @@ -79,20 +79,3 @@ index 1db2d08b2fe9a73521001c3aa88b1a64d1b3e71a..5a3ea8410b0f1dfa7248b9cb9752c04e
dataURLOptions: options.dataURLOptions
},
[bitmap]
@@ -9805,6 +9828,7 @@ class Replayer {
}
const { addCustomEvent } = record;
const { freezePage } = record;
+const version = "2.0.0-alpha.16"
export {
EventType,
IncrementalSource,
@@ -9816,6 +9840,7 @@ export {
freezePage,
_mirror as mirror,
record,
- utils
+ utils,
+ version,
};
//# sourceMappingURL=rrweb.js.map
53 changes: 27 additions & 26 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading