Releases: endojs/endo
Release list
@endo/pass-style@2.0.1
Patch Changes
- #3343
c0f60b4Thanks @boneskull! - Version bump forlatestdist-tag only. This is the same version as v1.8.2.
@endo/evasive-transform@2.3.1
Patch Changes
- #3344
cafd9fcThanks @boneskull! - Bump for release only.
ses@2.3.0
Minor Changes
-
#3308
4da9a99Thanks @kriskowal! - Drop the immutable-ArrayBuffer pseudo-prototype.Emulated immutable
ArrayBuffers produced by@endo/immutable-arraybuffernow inherit directly fromArrayBuffer.prototyperather than from an intermediate prototype.Object.getPrototypeOf(immuAB) === ArrayBuffer.prototypefor both emulated immutable and genuine buffers; the brand check is the newimmutableaccessor onArrayBuffer.prototypeinstalled by the shim.The
[Symbol.toStringTag]slot is preserved as an own property on each emulated immutable buffer (not on the shared prototype), soObject.prototype.toString.call(immuAB)continues to return'[object ImmutableArrayBuffer]'(as in master) while genuine ArrayBuffers continue to read as'[object ArrayBuffer]'. This keepsconcordance(and any other downstream consumer that sniffs the toStringTag to decide whether the value is a genuine exotic) from misrouting an emulated immutable through Node'sBuffer.from, which throws because the emulated immutable is not an exotic object.@endo/immutable-arraybufferis now a side-effect-only package: its sole public export is./shim.js. Theindex.jsand the package's.entry are removed; the previously exported names (isBufferImmutable,sliceBufferToImmutable,optTransferBufferToImmutable) are no longer reachable from outside the package. Callers detect immutability via theArrayBuffer.prototype.immutableaccessor (orObject.prototype.toString.call(buffer) === '[object ImmutableArrayBuffer]'when the shim has not been loaded) and convert viabuffer.sliceToImmutable(...)andbuffer.transferToImmutable(...)on the prototype. The break is a major bump for the@endo/immutable-arraybufferpackage.@endo/bytes'sto-immutable.jsimports@endo/immutable-arraybuffer/shim.js(triggering the shim install) and callsbuffer.sliceToImmutable(...)onArrayBuffer.prototypeinstead of the previously exportedsliceBufferToImmutablefree function.The shim's install policy is now detect-then-skip rather than warn-and-overwrite: the Immutable ArrayBuffer proposal has reached stage 3, so any prior installation (native or previously loaded shim) wins. If
'sliceToImmutable' in ArrayBuffer.prototypeis already true when the shim loads, the shim does nothing.sesdrops the%ImmutableArrayBufferPrototype%permits entry, which no longer has a referent. The three permits lines inside%ArrayBufferPrototype%that declare the shim-installed methods (transferToImmutable,sliceToImmutable,immutable) stay as-is.@endo/pass-style'sbyteArraybrand check no longer routes through an intermediate prototype; it consults theimmutableaccessor onArrayBuffer.prototypedirectly. The check also tolerates the[Symbol.toStringTag]own-property on emulated immutable buffers and verifies that its value is a non-enumerable data property with a string value. -
#3322
eeefaa0Thanks @kriskowal! - PermitTextEncoderandTextDecoderas universal intrinsics.TextEncoderandTextDecoderare pure transformations betweenstringandUint8Arraywith no static side channels, so they are now permitted on every compartment (start compartment and every compartment created after lockdown, identity-equal). Their prototypes are frozen alongside the other tamed primordials. On hosts that do not provide them (XS), lockdown proceeds without them and compartments observe their absence as before.Code that monkey-patches
TextEncoder.prototypeorTextDecoder.prototypeafterlockdown()will now throw, because the prototypes are frozen. Such mutations must happen before lockdown, the same rule that already applies to every other intrinsic. -
#3220
d47d74fThanks @boneskull! - Exposes__noNamespaceBox__getter onCompartment. -
#3316
71cbdb9Thanks @boneskull! -makeError()now allows acode?: stringoption, which sets acodeproperty on the resultingError, if so desired.
Patch Changes
-
#3306
a85b212Thanks @gibson042! - -consoleTaming: 'safe'prevents Node.js console logging from invoking custom inspect methods -
#3307
c69eb03Thanks @gibson042! - The console format specifier%cis for consuming a CSS style string and applying that style to the rendering of the remaining arguments. Node.js and browsers both parse%cthe same way and have it consume one argument.- Browsers actually make use of the CSS, leading to security problems (e.g., https://issues.chromium.org/40056332 ).
- Node.js ignores the
%cand its corresponding argument, which is allowed by the WHATWG Console specification.
To avoid the CSS security problems on all platforms, under the defaut
consoleTaming: 'safe', we now sanitize out the%cand corresponding argument, emulating the allowed current Node.js behavior on all platforms. This fixes this CSS vulnerability while maintaining compatibility with the specification. We also treat unknown specifiers in a future-proof manner. -
#3309
bfa149bThanks @boneskull! -makeErrornow narrows type of return instance whenerrConstructorprovided. -
Updated dependencies [
4da9a99]:- @endo/immutable-arraybuffer@2.0.0
@endo/patterns@2.1.0
Minor Changes
- #3287
d54fad3Thanks @boneskull! - Bump version for publishing only.
Patch Changes
- Updated dependencies [
4da9a99]:- @endo/pass-style@1.8.2
@endo/pass-style@1.8.2
Patch Changes
-
#3308
4da9a99Thanks @kriskowal! - Drop the immutable-ArrayBuffer pseudo-prototype.Emulated immutable
ArrayBuffers produced by@endo/immutable-arraybuffernow inherit directly fromArrayBuffer.prototyperather than from an intermediate prototype.Object.getPrototypeOf(immuAB) === ArrayBuffer.prototypefor both emulated immutable and genuine buffers; the brand check is the newimmutableaccessor onArrayBuffer.prototypeinstalled by the shim.The
[Symbol.toStringTag]slot is preserved as an own property on each emulated immutable buffer (not on the shared prototype), soObject.prototype.toString.call(immuAB)continues to return'[object ImmutableArrayBuffer]'(as in master) while genuine ArrayBuffers continue to read as'[object ArrayBuffer]'. This keepsconcordance(and any other downstream consumer that sniffs the toStringTag to decide whether the value is a genuine exotic) from misrouting an emulated immutable through Node'sBuffer.from, which throws because the emulated immutable is not an exotic object.@endo/immutable-arraybufferis now a side-effect-only package: its sole public export is./shim.js. Theindex.jsand the package's.entry are removed; the previously exported names (isBufferImmutable,sliceBufferToImmutable,optTransferBufferToImmutable) are no longer reachable from outside the package. Callers detect immutability via theArrayBuffer.prototype.immutableaccessor (orObject.prototype.toString.call(buffer) === '[object ImmutableArrayBuffer]'when the shim has not been loaded) and convert viabuffer.sliceToImmutable(...)andbuffer.transferToImmutable(...)on the prototype. The break is a major bump for the@endo/immutable-arraybufferpackage.@endo/bytes'sto-immutable.jsimports@endo/immutable-arraybuffer/shim.js(triggering the shim install) and callsbuffer.sliceToImmutable(...)onArrayBuffer.prototypeinstead of the previously exportedsliceBufferToImmutablefree function.The shim's install policy is now detect-then-skip rather than warn-and-overwrite: the Immutable ArrayBuffer proposal has reached stage 3, so any prior installation (native or previously loaded shim) wins. If
'sliceToImmutable' in ArrayBuffer.prototypeis already true when the shim loads, the shim does nothing.sesdrops the%ImmutableArrayBufferPrototype%permits entry, which no longer has a referent. The three permits lines inside%ArrayBufferPrototype%that declare the shim-installed methods (transferToImmutable,sliceToImmutable,immutable) stay as-is.@endo/pass-style'sbyteArraybrand check no longer routes through an intermediate prototype; it consults theimmutableaccessor onArrayBuffer.prototypedirectly. The check also tolerates the[Symbol.toStringTag]own-property on emulated immutable buffers and verifies that its value is a non-enumerable data property with a string value.
@endo/parser-pipeline@0.1.0
Minor Changes
-
#3158
1fa6c22Thanks @boneskull! - Introduces@endo/parser-pipeline, a new package that eliminates redundant Babel AST parsing when multiple consumers need to analyze or transform the same JavaScript module source.The core problem: tools built on
@endo/compartment-mapper(such as LavaMoat) have historically parsed each module two or three times — once for import/export analysis, once for evasive transforms, and once for policy-relevant globals analysis. This package composes those passes into a single parse-traverse-generate cycle.createParsers(config?)is the primary entry point. It accepts a single flat configuration object that combines pipeline options (visitorFactories, per-languagemjs/cjsoverrides, lifecycle hooks) with worker-pool options (workerScript,workerData,maxWorkers,idleTimeout). It returns{ sync, async }parser maps that are drop-in replacements forparserForLanguagein@endo/compartment-mapper. The module-source analysis step is handled implicitly by the pipeline; consumers only supply user-defined visitor factories.Each entry in
visitorFactoriesis aVisitorPassFactory: a function called once per module that returns aVisitorPass— an object with a requiredvisitorand an optionaldone()method. Read-only "analyzer" passes and mutating "transform" passes are unified under this single type. Passes run in array order between the implicit module-source analyzer (first) and the implicit module-source transform (last). Each pass'sdone()fires immediately after its own traversal, so later passes see any AST mutations made by earlier ones. Passes that omitdonecontributeundefinedto theirvisitorResultsslot. Source maps are generated whenever the consumer provides asourceMapHook, since the implicit module-source transform always rewrites the AST.Async-only consumers (e.g. policy generation) need only supply the worker/pool options and lifecycle hooks — they do not need to pass factory configs that only run inside the worker.
runPipelineInWorker(port, config)powers the async path. It accepts the same pre-mergePipelineConfigshape ascreateParsers, performing the merge internally. Consumer-provided worker scripts call this to listen for parse tasks dispatched by the worker pool, run the full pipeline in a worker thread, and post results back. The worker pool (WorkerParserPool) manages spawning, queuing, idle timeouts, and unref'd workers so the process can exit cleanly once all in-flight dispatches settle.
Patch Changes
@endo/module-source@1.5.0
Minor Changes
-
#3220
8906393Thanks @boneskull! - Exposes AST-based parser for CJS, as well as ananalyzeCjsfunction from theanalyzer.jssubpath export. -
#3218
dfdfa08Thanks @boneskull! - Fixes the type ofSourceMapHookand introduces proper.tstype sources checked bytsc. Types that were previously inlined as JSDoc typedefs (SourceMapHook,SourceMapHookDetails,SourceMapObject,ModuleSourceOptions,TransformSourceParams) are now defined insrc/types/module-source.tsand re-exported from the package root via a newsrc/external.types.d.tsentry.Adds a
./analyzer.jssubpath export withanalyzeModule(options?). The returned context object exposesanalyzePassandtransformPass(plain{ visitor }objects) and abuildRecord()function. This is the primitive that@endo/parser-pipelineuses to drive module analysis; it is also used internally by theModuleSourceconstructor, so the exported API is not specific to the pipeline.Removes the
PluginFactoryabstraction andvisitorFromPluginhelper: Babel plugins now return plain{ visitor }objects directly, with@babel/typesimported at module scope.
Patch Changes
@endo/immutable-arraybuffer@2.0.0
Major Changes
-
#3308
4da9a99Thanks @kriskowal! - Drop the immutable-ArrayBuffer pseudo-prototype.Emulated immutable
ArrayBuffers produced by@endo/immutable-arraybuffernow inherit directly fromArrayBuffer.prototyperather than from an intermediate prototype.Object.getPrototypeOf(immuAB) === ArrayBuffer.prototypefor both emulated immutable and genuine buffers; the brand check is the newimmutableaccessor onArrayBuffer.prototypeinstalled by the shim.The
[Symbol.toStringTag]slot is preserved as an own property on each emulated immutable buffer (not on the shared prototype), soObject.prototype.toString.call(immuAB)continues to return'[object ImmutableArrayBuffer]'(as in master) while genuine ArrayBuffers continue to read as'[object ArrayBuffer]'. This keepsconcordance(and any other downstream consumer that sniffs the toStringTag to decide whether the value is a genuine exotic) from misrouting an emulated immutable through Node'sBuffer.from, which throws because the emulated immutable is not an exotic object.@endo/immutable-arraybufferis now a side-effect-only package: its sole public export is./shim.js. Theindex.jsand the package's.entry are removed; the previously exported names (isBufferImmutable,sliceBufferToImmutable,optTransferBufferToImmutable) are no longer reachable from outside the package. Callers detect immutability via theArrayBuffer.prototype.immutableaccessor (orObject.prototype.toString.call(buffer) === '[object ImmutableArrayBuffer]'when the shim has not been loaded) and convert viabuffer.sliceToImmutable(...)andbuffer.transferToImmutable(...)on the prototype. The break is a major bump for the@endo/immutable-arraybufferpackage.@endo/bytes'sto-immutable.jsimports@endo/immutable-arraybuffer/shim.js(triggering the shim install) and callsbuffer.sliceToImmutable(...)onArrayBuffer.prototypeinstead of the previously exportedsliceBufferToImmutablefree function.The shim's install policy is now detect-then-skip rather than warn-and-overwrite: the Immutable ArrayBuffer proposal has reached stage 3, so any prior installation (native or previously loaded shim) wins. If
'sliceToImmutable' in ArrayBuffer.prototypeis already true when the shim loads, the shim does nothing.sesdrops the%ImmutableArrayBufferPrototype%permits entry, which no longer has a referent. The three permits lines inside%ArrayBufferPrototype%that declare the shim-installed methods (transferToImmutable,sliceToImmutable,immutable) stay as-is.@endo/pass-style'sbyteArraybrand check no longer routes through an intermediate prototype; it consults theimmutableaccessor onArrayBuffer.prototypedirectly. The check also tolerates the[Symbol.toStringTag]own-property on emulated immutable buffers and verifies that its value is a non-enumerable data property with a string value.
@endo/eslint-plugin@3.0.0
Major Changes
-
#3319
e352f0fThanks @boneskull! - Breaking: Backwards compatibility with legacy ESLint config files is provided on a best-effort basis, given ESLint's deprecation of rules and third-party replacements. Recommended rules from ESLint 9+ have also been configured.Breaking: Minimum supported Node.js version is now v22.12.0.
Breaking:
@jessie.js/eslint-pluginis no longer a dependency of@endo/eslint-plugin. This removes a cyclic dependency (@jessie.js/eslint-plugindepends on@endo/eslint-plugin, and vice versa).eslint-plugin-unicornis no longer a peer dependency of@endo/eslint-pluginand can be safely removed from yourdevDependencies(unless you consume it directly, of course).- The
flat/recommendedconfig no longer registers the@jessie.jsplugin, applies@jessie.js/safe-await-separator, or installs theuse-jessieprocessor. The legacyrecommendedandinternalconfigs likewise no longer extendplugin:@jessie.js/recommendedor set the@jessie.js/use-jessieprocessor. See "Migration" below for more details. - New rules have been added from
@eslint/js'recommendedconfiguration, includingno-assign-to-exported-let-var-or-functionandno-harden-pattern-maker, which may or may not already be handled by your existing configuration.
Migration: Consumers that rely on the rules and processor provided by
@jessie.js/eslint-pluginmust install@jessie.js/eslint-pluginmanually and wire it up alongside@endo/eslint-plugin:import jessie from '@jessie.js/eslint-plugin'; import endo from '@endo/eslint-plugin'; export default [ ...endo.configs['flat/recommended'], ...jessie.configs['flat/recommended'], { processor: jessie.processors['use-jessie'] }, ];
Furthermore, the new rules will need to be addressed as appropriate for your project.
-
#3325
ac72fcaThanks @boneskull! - Certain tags are no longer allowed by ourjsdoc/check-tag-namesrule configuration, including@code.The new rules
jsdoc/reject-any-typeandjsdoc/ts-no-empty-object-typehave been disabled.
Patch Changes
- #3305
6d6160dThanks @turadg! - Republish with resolved dependency versions. The 2.6.0 manifest on npm shippedcatalog:protocol specifiers foreslint-plugin-importandtypescript, which npm cannot resolve; the publish toolchain now resolves thecatalog:protocol to concrete version ranges at pack time. Fixes #3304.
@endo/compartment-mapper@2.4.0
Minor Changes
-
#3221
e054d1aThanks @boneskull! - ExposefindUnknownCanonicalNames()from new export@endo/compartment-mapper/policy.js. -
#3338
34da8b4Thanks @boneskull! - Added support for dynamicimport()of absolute paths (POSIX/Win32). Added support for absolute Win32 paths to dynamicrequire().Dynamic
import()of absolute paths in a POSIX environment requires aReadPowersobject containing anisAbsolutefunction (IsAbsoluteFn). ApathToFileURLfunction (PathToFileURLFn) is strongly recommended.For absolute path support in a Windows environment (for both dynamic
import()andrequire()), aReadPowersobject must supplyisAbsoluteandpathToFileURL.Dynamic
require()support for absolute paths retains the current baselineReadPowersobject requirements; seeREADME.mdfor details. -
#3220
be222eeThanks @boneskull! - Expose Babel-based CJS parser,parse-cjs-babel. Expose shared functionality for wrapping CJS functors with__dirname,__filename, etc. Add support for dynamicimport()(parse-cjs-babelonly). Fix incorrect typings ofPackageDataHook's parameter.
Patch Changes
-
#3247
73e03aaThanks @boneskull! - FixesCompartmentDescriptorso that it is generic on thePackagePolicy; externally-definedParseFns can now refer to the specific contents of a customPackagePolicypresent in aCompartmentDescriptor.Introduces
ParseSourceMapHook; differentiated from@endo/module-source'sSourceMapHook.Fixes type of
PolicyItem; eliminates confusion betweenvoid(no extra union members) andany(SomePackagePolicy). -
Updated dependencies [
4da9a99,eeefaa0,d47d74f,a85b212,8906393,c69eb03,dfdfa08,71cbdb9,bfa149b]:- ses@2.3.0
- @endo/module-source@1.5.0