Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Notes for ES6 import support #3

Open
dead-claudia opened this issue Jun 3, 2018 · 0 comments
Open

Notes for ES6 import support #3

dead-claudia opened this issue Jun 3, 2018 · 0 comments

Comments

@dead-claudia
Copy link
Owner

General API sketch:

  • invoke.import(import.meta, mod, opts).then(...) = ES6 import
    • I can't do the magic wrapping I do for CommonJS, since I can't access the cache, much less modify it.
  • Calling methods are just as normal.
  • Requires library to be compiled to two separate targets (main and worker).
  • Worker methods are loaded as modules and exported.
  • Note: import isn't a valid variable binding, but it is a valid export name.
  • Shouldn't require a major amount of work short of just re-implementing Node's ESM lookup algorithm.
  • Optional loader hook that allows you to do import {...} from "worker.js#parallel" using the global pool. (easy)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant