Skip to content
Brian Warner edited this page Jun 30, 2020 · 8 revisions

Compatibility notes

We'll use this page to keep reports and information about compatibility (or problems) between SES and various libraries.

  • tape 4.11.0 vs SES-0.7.7: must import tape before lockdown() (override mistake: https://github.com/Agoric/SES-shim/issues/293).
  • tape 5.0.0: must import before lockdown(), but even then t.throws fails to recognize exceptions (test always errors), maybe due to identity discontinuity
  • console (Node.js builtin): must harden(console.__proto__) before you can harden(console) or harden the global object of a new Compartment which was given console as an endowment (console inherits from an intermediate object rather than directly inheriting from Object) (https://github.com/Agoric/SES-shim/issues/292)
  • assert (Node.js builtin): no problems
  • better-assert (npm): loads after lockdown, but explodes if a test fails: callsite modifies Error.prepareStackTrace
  • insist (npm): same as better-assert
  • chai (npm assertions library): imports after lockdown() fine. No stack traces unless noTameError.
    • Unrelated to SES: running under -r esm dumps a 300KB line of esm.js source to stderr before anything else
  • node-lmdb: cannot import after lockdown(), bindings modifies Error.prepareStackTrace and Error.stackTraceLimit. Workaround is to import('node-lmdb') (for side-effects only) before lockdown(), then import it again (for the exports) later, which doesn't have any obvious identity-discontinuity problems so far.
  • brace-expansion uses Math.random (at import time) to create unlikely-to-already-exist replacement names for various punctuation marks. brace-expansion is imported by minimatch, which is imported by glob, which is imported by temp.
  • temp uses Math.random (at runtime) to generate random filenames
  • depd changes Error.prepareStackTrace (at import time) to create deprecation warnings. depd is used by the popular express web server framework, and the morgan HTTP middleware package. See #251 for an unpleasant workaround.
  • jsesc (used by babel) uses Buffer.isBuffer at import time, so it won't work in non-start-compartments unless you provide a (tamed!) endowment
  • babel uses process.env runtime, so it won't work in non-start-compartments unless you provide an endowment (an empty object is probably sufficient)
  • json-merge-patch has a dependency tree which includes define-properties, which fails at import time as it tries to add .getPolyfill to something (probably Object)
Clone this wiki locally