Skip to content

Commit 834acbd

Browse files
kriskowalclaude
andcommitted
fix(deps): patch @endo/compartment-mapper to strip __createdBy from bundles
The new @endo/compartment-mapper@2.0.0 adds __createdBy metadata to module configurations in digested compartment maps. This causes bundle validation failures when bundles built with the new version are loaded by older runtimes (e.g. a3p pre-upgrade proposals) that reject unknown properties. Strip __createdBy from digest output for compatibility. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 06ec284 commit 834acbd

3 files changed

Lines changed: 67 additions & 2 deletions

File tree

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
diff --git a/src/digest.js b/src/digest.js
2+
index 14358421b31a421272b65cb14a19bf5ab88401af..38002d7b127ac1b47688729222f6bf197e25f2da 100644
3+
--- a/src/digest.js
4+
+++ b/src/digest.js
5+
@@ -179,21 +179,18 @@ const translateCompartmentMap = (
6+
location,
7+
parser,
8+
sha512,
9+
- __createdBy: 'digest',
10+
};
11+
} else if (isExitModuleSource(source)) {
12+
const { exit } = source;
13+
/** @type {ExitModuleConfiguration} */
14+
modules[name] = {
15+
exit,
16+
- __createdBy: 'digest',
17+
};
18+
} else if (isErrorModuleSource(source)) {
19+
const { deferredError } = source;
20+
/** @type {ErrorModuleConfiguration} */
21+
modules[name] = {
22+
deferredError,
23+
- __createdBy: 'digest',
24+
};
25+
} else {
26+
throw new TypeError(
27+
diff --git a/src/import-hook.js b/src/import-hook.js
28+
index 061ba13e9d2a350e474f0550e13162d30bb95869..3b18d0f3cb5ff2326e3efa4c8de1d334b3e86544 100644
29+
--- a/src/import-hook.js
30+
+++ b/src/import-hook.js
31+
@@ -449,7 +449,6 @@ function* chooseModuleDescriptor(
32+
retained: true,
33+
module: candidateSpecifier,
34+
compartment: packageLocation,
35+
- __createdBy: 'import-hook',
36+
};
37+
}
38+
/** @type {StaticModuleType} */
39+
diff --git a/src/link.js b/src/link.js
40+
index 7f0e42fb595db0975de5b3e64d05e01afdd70fd1..15158724adb521556f686759ba15d4d2a8535c61 100644
41+
--- a/src/link.js
42+
+++ b/src/link.js
43+
@@ -209,7 +209,6 @@ const makeModuleMapHook = (
44+
retained: true,
45+
compartment: foreignCompartmentName,
46+
module: foreignModuleSpecifier,
47+
- __createdBy: 'link',
48+
};
49+
// actual module descriptor
50+
return {

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,8 @@
9999
"rxjs@npm:^6.4.0": "patch:rxjs@npm%3A7.5.5#~/.yarn/patches/rxjs-npm-7.5.5-d0546b1ccb.patch",
100100
"rxjs@npm:^7.5.5": "patch:rxjs@npm%3A7.5.5#~/.yarn/patches/rxjs-npm-7.5.5-d0546b1ccb.patch",
101101
"@endo/far": "patch:@endo/far@npm%3A1.1.14#~/.yarn/patches/@endo-far-npm-1.1.14-ef03a62612.patch",
102-
"@endo/pass-style": "patch:@endo/pass-style@npm%3A1.7.0#~/.yarn/patches/@endo-pass-style-npm-1.7.0-7dc50195b4.patch"
102+
"@endo/pass-style": "patch:@endo/pass-style@npm%3A1.7.0#~/.yarn/patches/@endo-pass-style-npm-1.7.0-7dc50195b4.patch",
103+
"@endo/compartment-mapper@npm:^2.0.0": "patch:@endo/compartment-mapper@npm%3A2.0.0#~/.yarn/patches/@endo-compartment-mapper-npm-2.0.0-4a851a2702.patch"
103104
},
104105
"dependenciesMeta": {
105106
"better-sqlite3@10.1.0": {

yarn.lock

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2427,7 +2427,7 @@ __metadata:
24272427
languageName: node
24282428
linkType: hard
24292429

2430-
"@endo/compartment-mapper@npm:^2.0.0":
2430+
"@endo/compartment-mapper@npm:2.0.0":
24312431
version: 2.0.0
24322432
resolution: "@endo/compartment-mapper@npm:2.0.0"
24332433
dependencies:
@@ -2441,6 +2441,20 @@ __metadata:
24412441
languageName: node
24422442
linkType: hard
24432443

2444+
"@endo/compartment-mapper@patch:@endo/compartment-mapper@npm%3A2.0.0#~/.yarn/patches/@endo-compartment-mapper-npm-2.0.0-4a851a2702.patch":
2445+
version: 2.0.0
2446+
resolution: "@endo/compartment-mapper@patch:@endo/compartment-mapper@npm%3A2.0.0#~/.yarn/patches/@endo-compartment-mapper-npm-2.0.0-4a851a2702.patch::version=2.0.0&hash=8a3a65"
2447+
dependencies:
2448+
"@endo/cjs-module-analyzer": "npm:^1.0.11"
2449+
"@endo/module-source": "npm:^1.4.0"
2450+
"@endo/path-compare": "npm:^1.1.0"
2451+
"@endo/trampoline": "npm:^1.0.5"
2452+
"@endo/zip": "npm:^1.1.0"
2453+
ses: "npm:^1.15.0"
2454+
checksum: 10c0/d791273f70c1e50682fa366e778e1e68e5c8c9b3fd80cea5da13921d80f8fb5615a4701f59740ebd246709d6e413b6ddb4fbf414b4263316c478127729e7cc9d
2455+
languageName: node
2456+
linkType: hard
2457+
24442458
"@endo/env-options@npm:^1.1.11":
24452459
version: 1.1.11
24462460
resolution: "@endo/env-options@npm:1.1.11"

0 commit comments

Comments
 (0)