JSPM

@agoric/import-manager

0.2.11
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 5255
  • Score
    100M100P100Q117985F
  • License Apache-2.0

Share code across vat boundaries

Package Exports

  • @agoric/import-manager

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@agoric/import-manager) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Import Manager

ImportManager allows a package to make some code available that can be run locally by a calling vat without requiring a remote round trip to the hosting vat. Remote code can indicate what function to run using a key.

Long term, we may want to import from a well-known repository, and manage version upgrades, but for now, we just import the code from the file system.

A package that wanted to export some code for clients to run in their own vat would import or define some functions, then call

  const mgr = importManager();
  return mgr.addExports(
    {
       'usefulFn', export1,
       'helpfulFn', export2,
     });

then it could pass strings like 'usefulFn' to clients, who could import the manager above, then call

const genericFn = importer.lookupImport(name);