Releases: endojs/endo
2025-03-24
ses
v1.12.0
-
The
evalTaming:
option values are renamed:- from
'safeEval'
,'unsafeEval'
, and'noEval'
- to
'safe-eval'
,'unsafe-eval'
, and'no-eval'
in order to follow the convention that lockdown option values use kebob-case rather than camelCase. To avoid breaking old programs during the transition, the old names are deprecated, but continue to work for now.
- from
-
Evaluating a non-lexical name that is also absent on the global object of a compartment no longer throws a
ReferenceError
and instead producesundefined
because it proves impossible to do so without revealing what properties exist on the hostglobalThis
to compartmentalized code with a shim. This is a divergence from the expected behavior of a native Hardened JavaScript implementation, like XS.
@endo/patterns
v1.5.0
-
New pattern:
M.containerHas(elementPatt, bound = 1n)
motivated to support want patterns in Zoe, to pull out onlybound
number of elements that matchelementPatt
.bound
must be a positive bigint. -
Closely related,
@endo/patterns
now exportscontainerHasSplit
to support ERTP's use ofM.containerHas
on non-fungible (set
,copySet
) and semifungible (copyBag
) assets, respectively. See Agoric/agoric-sdk#10952 .
@endo/import-bundle
v1.4.0
- Adds support for
test
format bundles, which simply return a promise for an object that resembles a module exports namespace with the objects specified on the symbol-named property@exports
, which is deliberately not JSON serializable or passable. - Adds a
typedImportBundle<ExpectedExportsNamespace>
function with a proper type signature, to provide a narrower signature thanany
without disrupting existing usage.
@endo/bundle-source
v4.0.0
- Replaces the implementation for the
nestedEvaluate
andgetExport
formats with one based on Endo's Compartment Mapper instead of Rollup, in order to obviate the need to reconcile source map transforms between Rollup and the underlying Babel generator. As a consequence, we no longer generate a source map for the bundle, but Babel ensures that we preserve line and column numbers between the original source and the bundled source.
@endo/compartment-mapper
v1.6.0
-
Accommodates CommonJS modules that use
defineProperty
onexports
. -
Divides the role of
makeBundle
intomakeScript
andmakeFunctor
. The newmakeScript
replacesmakeBundle
without breaking changes, producing a JavaScript string that is suitable as a<script>
tag in a web page. -
The new
makeFunctor
produces a JavaScript string that, when evaluated, produces a partially applied function, so the caller can provide runtime options. -
Both
makeScript
andmakeFunctor
now acceptformat
,useEvaluate
andsourceUrlPrefix
options. -
The functor produced by
makeFunctor
now acceptsevaluate
,require
, andsourceUrlPrefix
runtime options. -
Both
makeScript
andmakeFunctor
now accept aformat
option. Specifiying the"cjs"
format allows the bundle to exit to the host's CommonJSrequire
for host modules. -
Adds
sourceDirname
to compartment descriptors in the compartment maps generated bymapNodeModules
and uses these to provide better source URL comments for bundles generated bymakeScript
andmakeFunctor
, by default.
These changes collectively allow us to replace the implementation of nestedEvaluate
and getExports
formats in @endo/bundle-source
, including the preservation of useful line numbers and file names in stack traces.
mapNodeModules
,importLocation
andloadLocation
now accept alog
option for users to define a custom logging function. As of this writing, onlymapNodeModules
will potentially call this function if provided. Expansion of log messaging and support for thelog
option in more APIs is expected in the future.
@endo/evasive-transform
v1.4.0
- Adds a
sourceMap
option so that the generated sourcemap can project back to the original source code withoutunmapLoc
. - Removes support for sourcemap
unmapLoc
because it is not used by contemporary Endo packages. The option is now ignored.
2025-01-23
ses v1.11.0
-
Adds support for dynamic
import
in conjunction with an update to@endo/module-source
. -
Specifying the long-discontinued
mathTaming
ordateTaming
options logs a warning.
Incubating: Please do not rely on these features as they are under development and subject to breaking changes that will not be signaled by semver.
- Adds support for an XS-specific variant of the SES shim that is triggered with the
xs
package export condition. This version of SES preserves all the features ofCompartment
provided uniquely by the SES shim, but with the__native__
constructor option, loses support for importing precompiled module records and gains support for nativeModuleSource
.
@endo/module-source v1.2.0
- Supports dynamic
import
within aModuleSource
in conjunction with a related change inses
. For example,await import(specifier)
can now call through to the surrounding compartment'simportHook
to load and evaluate further modules. - Provides an XS-specific variant of
@endo/module-source
that adapts the nativeModuleSource
instead of entraining Babel.
@endo/compartment-mapper v1.5.0
mapNodeModules
and all functions that use it now tolerate the absence of expected packages. These packages are now omitted from the generated package skeleton map. So, loading a physically missing module now occurs during the load phase instead of the mapping phase.- Adds a
strict
option to all functions thatmapNodeModules
to restore old behavior, which produces an error early if, for example, a non-optional peer dependency is missing. Peer dependencies are strictly required unlesspeerDependenciesMeta
has an object with a truthyoptional
entry. Correct interpretation ofpeerDependencies
is not distributed evenly, so this behavior is no longer the default.
Incubating: Please do not rely on these features as they are under development and subject to breaking changes that will not be signaled by semver.
- The module
@endo/compartment-mapper/import-archive-parsers.js
does not support modules in archives in their original ESM (mjs
) or CommonJS (cjs
) formats because they entrain Babel and a full JavaScript lexer that are not suitable for use in all environments, specifically XS. This version introduces an elective@endo/compartment-mapper/import-archive-all-parsers.js
that has all of the precompiled module parsers (pre-cjs-json
andpre-mjs-json
) that Endo's bundler currently produces by default and additionally parsers for original sources (mjs
,cjs
). Also, provided thexs
package condition,@endo/compartment-mapper/import-archive-parsers.js
now falls through to the nativeModuleSource
and safely includesmjs
andcjs
without entraining Babel, but is only supported in conjunction with the__native__
option forCompartment
,importArchive
,parseArchive
, andimportBundle
. With thenode
package condition (present by default when running ESM onnode
),@endo/compartment-mapper/import-archive-parsers.js
also now includesmjs
andcjs
by entraining Babel, which performs adequately on that platform. - Adds a
__native__: true
option to all paths to import, 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).
2024-11-13
ses v1.10.0
-
Permit Promise.try, since it has reached Stage 4.
-
Adds a
reporting
option tolockdown
andrepairIntrinsics
.The default behavior is
"platform"
which will detect the platform and report warnings according to whether a webconsole
, Node.jsconsole
, orprint
are available. The web platform is distinguished by the existence ofwindow
orimportScripts
(WebWorker). The Node.js behavior is to report all warnings tostderr
visually consistent with use of a console group. SES will useprint
in the absence of aconsole
. Captures the platformconsole
at the timelockdown
orrepairIntrinsics
are called, not at the timeses
initializes.The
"console"
option forces the web platform behavior. On Node.js, this results in group labels being reported tostdout
.The
"none"
option mutes warnings.
@endo/bundle-source v3.5.0
- Adds support for TypeScript type erasure using
ts-blank-space
applied to TypeScript modules with.ts
,.mts
, and.cts
extensions, for any package that is not under anode_modules
directory, immitatingnode --experimental-strip-types
. As with.js
extensions, the behavior of.ts
is either consistent with.mts
or.cts
depending on thetype
inpackage.json
.
@endo/compartment-mapper v1.4.0
- Adds options
languageForExtension
,moduleLanguageForExtension
,commonjsLanguageForExtension
, andlanguages
tomapNodeModules
andcompartmentMapForNodeModules
allowing for certain mappings from extension (e.g.,ts
) to language (e.g.,mts
orcts
) to depend on the each package’stype
in the way we already varyjs
betweencjs
andmjs
. These options enter through the high level functions includingmakeArchive
andimportLocation
. - The new options
workspaceLanguageForExtension
,workspaceModuleLanguageForExtension
, andworkspaceCommonjsLanguageForExtension
apply like the above except more specifically and for packages that are not physically located under anode_modules
directory, indicating that JavaScript has not yet been generated from any non-JavaScript source files. - Omits unused module descriptors from
compartment-map.json
in archived applications, potentially reducing file sizes. - Fixes an issue where errors thrown from exit module hooks (
importHook
) would be thrown at parse-time when the parser uses heuristic import analysis instead of at runtime. Such errors will now be thrown at runtime, as originally intended. To those who expected the previous behavior: if you exist, please exercise caution when upgrading.