Skip to content

Commit 1403e08

Browse files
chore(snaps): drop XMLSerializer/DOMParser yarn patch on snaps-execution-environments
The .yarn patch on @metamask/snaps-execution-environments@11.0.2 added "XMLSerializer" and "DOMParser" to the LavaMoat scuttleGlobalThis exceptions list inside dist/webpack/webview/index.html. Verified the patch was solving a phantom problem: nothing on the iframe path actually reads either global at runtime. Empirical check (literal grep for "XMLSerializer"/"DOMParser"): - @metamask/snaps-execution-environments@11.0.2 bundle 0 hits - ses 0 hits - @metamask/snaps-controllers@20.0.3 0 hits - @metamask/post-message-stream@10.0.0 0 hits - @metamask/react-native-webview@14.6.0 0 hits - @metamask/bitcoin-wallet-snap@1.10.1 dist/bundle.js 0 hits - @metamask/tron-wallet-snap@1.25.3 dist/bundle.js 0 hits - app code on the snap WebView path 0 hits Snaps run successfully on main against the same @MetaMask/snaps- execution-environments@11.0.2 with the same allow-list and no patch, which is the strongest possible evidence the entry was unnecessary. Pin the dep to "11.0.2" exact (matching main's resolved version in yarn.lock) so the descriptor differs from main's "^11.0.2" only in the caret. Resolution, transitive graph, and installed bytes are identical to main for this package. If snap E2Es regress in CI on this branch, capture the actual WebView console stack trace from the failing spec — the LavaMoat error names the offending property in its message — and re-introduce a targeted allow-list change with concrete evidence behind it. Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent 44bfa43 commit 1403e08

3 files changed

Lines changed: 2 additions & 32 deletions

File tree

.yarn/patches/@metamask-snaps-execution-environments-npm-11.0.2-83df58c486.patch

Lines changed: 0 additions & 12 deletions
This file was deleted.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@
330330
"@metamask/slip44": "^4.2.0",
331331
"@metamask/smart-transactions-controller": "^24.0.0",
332332
"@metamask/snaps-controllers": "^20.0.3",
333-
"@metamask/snaps-execution-environments": "patch:@metamask/snaps-execution-environments@npm%3A11.0.2#~/.yarn/patches/@metamask-snaps-execution-environments-npm-11.0.2-83df58c486.patch",
333+
"@metamask/snaps-execution-environments": "11.0.2",
334334
"@metamask/snaps-rpc-methods": "^15.1.1",
335335
"@metamask/snaps-sdk": "^11.1.0",
336336
"@metamask/snaps-utils": "^12.2.0",

yarn.lock

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -10157,24 +10157,6 @@ __metadata:
1015710157
languageName: node
1015810158
linkType: hard
1015910159

10160-
"@metamask/snaps-execution-environments@patch:@metamask/snaps-execution-environments@npm%3A11.0.2#~/.yarn/patches/@metamask-snaps-execution-environments-npm-11.0.2-83df58c486.patch":
10161-
version: 11.0.2
10162-
resolution: "@metamask/snaps-execution-environments@patch:@metamask/snaps-execution-environments@npm%3A11.0.2#~/.yarn/patches/@metamask-snaps-execution-environments-npm-11.0.2-83df58c486.patch::version=11.0.2&hash=63f4dc"
10163-
dependencies:
10164-
"@metamask/json-rpc-engine": "npm:^10.2.3"
10165-
"@metamask/object-multiplex": "npm:^2.1.0"
10166-
"@metamask/post-message-stream": "npm:^10.0.0"
10167-
"@metamask/providers": "npm:^22.1.1"
10168-
"@metamask/rpc-errors": "npm:^7.0.3"
10169-
"@metamask/snaps-sdk": "npm:^11.0.0"
10170-
"@metamask/snaps-utils": "npm:^12.1.2"
10171-
"@metamask/superstruct": "npm:^3.2.1"
10172-
"@metamask/utils": "npm:^11.10.0"
10173-
readable-stream: "npm:^3.6.2"
10174-
checksum: 10/089284a0dcaebffaaf6c696593069a7bd039f0b46929e74b520b2017665f6cd5fa36e9579a678ac46dd6bc878d0ba49ca40e42614028ec16931feb0c410a1dac
10175-
languageName: node
10176-
linkType: hard
10177-
1017810160
"@metamask/snaps-registry@npm:^4.0.0":
1017910161
version: 4.0.0
1018010162
resolution: "@metamask/snaps-registry@npm:4.0.0"
@@ -35964,7 +35946,7 @@ __metadata:
3596435946
"@metamask/slip44": "npm:^4.2.0"
3596535947
"@metamask/smart-transactions-controller": "npm:^24.0.0"
3596635948
"@metamask/snaps-controllers": "npm:^20.0.3"
35967-
"@metamask/snaps-execution-environments": "patch:@metamask/snaps-execution-environments@npm%3A11.0.2#~/.yarn/patches/@metamask-snaps-execution-environments-npm-11.0.2-83df58c486.patch"
35949+
"@metamask/snaps-execution-environments": "npm:11.0.2"
3596835950
"@metamask/snaps-rpc-methods": "npm:^15.1.1"
3596935951
"@metamask/snaps-sdk": "npm:^11.1.0"
3597035952
"@metamask/snaps-utils": "npm:^12.2.0"

0 commit comments

Comments
 (0)