Skip to content

Commit

Permalink
feat(import-bundle): Thread native flag
Browse files Browse the repository at this point in the history
  • Loading branch information
kriskowal committed Oct 18, 2024
1 parent 1e6d742 commit 8ef4eb1
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
11 changes: 11 additions & 0 deletions packages/import-bundle/NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
User-visible changes to `@endo/import-bundle`:

# Next release

Experimental:

- Adds a `__native__: true` option that indicates that the application will
fall through to the native implementation of Compartment, currently only
available on XS, which lacks support for precompiled module sources (as exist
in many archived applications, particularly Agoric smart contract bundles)
and instead supports loading modules from original sources (which is not
possible at runtime on XS).

# v1.3.0 (2024-10-10)

- Adds support for `endoScript` format bundles.
Expand Down
2 changes: 2 additions & 0 deletions packages/import-bundle/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export async function importBundle(bundle, options = {}, powers = {}) {
transforms = [],
inescapableTransforms = [],
inescapableGlobalProperties = {},
__native__ = false,
expectedSha512 = undefined,
} = options;
const {
Expand Down Expand Up @@ -71,6 +72,7 @@ export async function importBundle(bundle, options = {}, powers = {}) {
const { namespace } = await archive['import']({
globals: endowments,
__shimTransforms__: transforms,
__native__,
// @ts-expect-error TS2740 missing properties from type
Compartment: CompartmentToUse,
});
Expand Down

0 comments on commit 8ef4eb1

Please sign in to comment.