Skip to content

A reactive notebook for Python — run reproducible experiments, query with SQL, execute as a script, deploy as an app, and version with git. Stored as pure Python. All in a modern, AI-native editor.

fix: patch html-to-image to avoid duplicate iframe in screenshot (#7998)

Myles Scolnickcb8914791a55
diff --git a/.github/workflows/dev_build.yaml b/.github/workflows/dev_build.yaml
index 9d02f7df0d..4e743bbee4 100644
--- a/.github/workflows/dev_build.yaml
+++ b/.github/workflows/dev_build.yaml
@@ -22,7 +22,7 @@ jobs:
pixi-version: v0.62.2
locked: false
frozen: false
- cache: true
+ cache: false
- run: pixi run make check-prereqs
- run: pixi run make fe
- run: pixi run make py
diff --git a/package.json b/package.json
index 53207d25f4..5bb48a243b 100644
--- a/package.json
+++ b/package.json
@@ -22,7 +22,8 @@
"packageManager": "[email protected]",
"pnpm": {
"patchedDependencies": {
- "react-plotly.js": "patches/react-plotly.js.patch"
+ "react-plotly.js": "patches/react-plotly.js.patch",
},
"overrides": {
"react": "^19.2.3",
diff --git a/patches/[email protected] b/patches/[email protected]
new file mode 100644
index 0000000000..9756ae96ef
--- /dev/null
+++ b/patches/[email protected]
@@ -0,0 +1,46 @@
+diff --git a/es/clone-node.js b/es/clone-node.js
+index 114cbf214f65cda237dbba67458c2b68fadf421e..f6194624c9fcb8b57eb72f445277b6cd14d31c6d 100644
+--- a/es/clone-node.js
++++ b/es/clone-node.js
+@@ -59,10 +59,6 @@ async function cloneChildren(nativeNode, clonedNode, options) {
+ if (isSlotElement(nativeNode) && nativeNode.assignedNodes) {
+ children = toArray(nativeNode.assignedNodes());
+ }
+- else if (isInstanceOfElement(nativeNode, HTMLIFrameElement) &&
+- ((_a = nativeNode.contentDocument) === null || _a === void 0 ? void 0 : _a.body)) {
+- children = toArray(nativeNode.contentDocument.body.childNodes);
+- }
+ else {
+ children = toArray(((_b = nativeNode.shadowRoot) !== null && _b !== void 0 ? _b : nativeNode).childNodes);
+ }
+diff --git a/lib/clone-node.js b/lib/clone-node.js
+index 214f4d30a50baae7f007d2399eeac298366538c7..a81d0e313ace6c50ce1652c4deb0dc8df3e073a8 100644
+--- a/lib/clone-node.js
++++ b/lib/clone-node.js
+@@ -134,10 +134,6 @@ function cloneChildren(nativeNode, clonedNode, options) {
+ if (isSlotElement(nativeNode) && nativeNode.assignedNodes) {
+ children = (0, util_1.toArray)(nativeNode.assignedNodes());
+ }
+- else if ((0, util_1.isInstanceOfElement)(nativeNode, HTMLIFrameElement) &&
+- ((_a = nativeNode.contentDocument) === null || _a === void 0 ? void 0 : _a.body)) {
+- children = (0, util_1.toArray)(nativeNode.contentDocument.body.childNodes);
+- }
+ else {
+ children = (0, util_1.toArray)(((_b = nativeNode.shadowRoot) !== null && _b !== void 0 ? _b : nativeNode).childNodes);
+ }
+diff --git a/src/clone-node.ts b/src/clone-node.ts
+index 5dfcd117a1dd3d3d5cfb7c98ead3eb828085337a..8aa85ca88f84e8e64297673dcff36b21d48a95b4 100644
+--- a/src/clone-node.ts
++++ b/src/clone-node.ts
+@@ -88,11 +88,6 @@ async function cloneChildren<T extends HTMLElement>(
+
+ if (isSlotElement(nativeNode) && nativeNode.assignedNodes) {
+ children = toArray<T>(nativeNode.assignedNodes())
+- } else if (
+- isInstanceOfElement(nativeNode, HTMLIFrameElement) &&
+- nativeNode.contentDocument?.body
+- ) {
+- children = toArray<T>(nativeNode.contentDocument.body.childNodes)
+ } else {
+ children = toArray<T>((nativeNode.shadowRoot ?? nativeNode).childNodes)
+ }
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 0a9a60e0f7..b8a7be8a88 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -11,6 +11,9 @@ overrides:
form-data: '>=4.0.5'
patchedDependencies:
+ hash: eced1b085df9a49a9c81d730049c8285c754fc89e68672c14722337c75d72eaf
+ path: patches/[email protected]
react-plotly.js:
hash: e65888c226f3ef8f42923cbb3b026d2f4811da3e96fa0d7dee3cb62df02c6189
path: patches/react-plotly.js.patch
@@ -360,7 +363,7 @@ importers:
version: 5.2.11(@types/[email protected])([email protected])
html-to-image:
specifier: ^1.11.13
- version: 1.11.13
+ version: 1.11.13(patch_hash=eced1b085df9a49a9c81d730049c8285c754fc89e68672c14722337c75d72eaf)
humanize-duration:
specifier: ^3.33.2
version: 3.33.2
@@ -17455,7 +17458,7 @@ snapshots:
+ [email protected](patch_hash=eced1b085df9a49a9c81d730049c8285c754fc89e68672c14722337c75d72eaf): {}