Skip to content

Commit f388ca5

Browse files
committed
feat(import-bundle): Thread native flag
1 parent 8c2629e commit f388ca5

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

packages/import-bundle/NEWS.md

+11
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
11
User-visible changes to `@endo/import-bundle`:
22

3+
# Next release
4+
5+
Experimental:
6+
7+
- Adds a `__native__: true` option that indicates that the application will
8+
fall through to the native implementation of Compartment, currently only
9+
available on XS, which lacks support for precompiled module sources (as exist
10+
in many archived applications, particularly Agoric smart contract bundles)
11+
and instead supports loading modules from original sources (which is not
12+
possible at runtime on XS).
13+
314
# v1.3.0 (2024-10-10)
415

516
- Adds support for `endoScript` format bundles.

packages/import-bundle/src/index.js

+2
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ export async function importBundle(bundle, options = {}, powers = {}) {
2424
transforms = [],
2525
inescapableTransforms = [],
2626
inescapableGlobalProperties = {},
27+
__native__ = false,
2728
expectedSha512 = undefined,
2829
} = options;
2930
const {
@@ -71,6 +72,7 @@ export async function importBundle(bundle, options = {}, powers = {}) {
7172
const { namespace } = await archive['import']({
7273
globals: endowments,
7374
__shimTransforms__: transforms,
75+
__native__,
7476
// @ts-expect-error TS2740 missing properties from type
7577
Compartment: CompartmentToUse,
7678
});

0 commit comments

Comments
 (0)