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

add importNowHook to SES Compartment #2201

Open
naugtur opened this issue Apr 5, 2024 · 0 comments
Open

add importNowHook to SES Compartment #2201

naugtur opened this issue Apr 5, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@naugtur
Copy link
Member

naugtur commented Apr 5, 2024

What is the Problem Being Solved?

Any level of dynamic behavior for CJS require() in endo implemented on top of Compartment requires either preloading all dynamically requested modules or adding importNowHook - the synchronous version of importHook.

Description of the Design

Provide synchronous module loading facilities in SES by analogy to what already exists.

Security Considerations

TBD, none that I'm aware of.

Scaling Considerations

Test Plan

  • port some unit tests to synchronous flow
  • test with dynamic require in compartment-mapper

Compatibility Considerations

  • This will never work with top-level await anywhere in the tree starting at the specifier being passed to importNow.

Upgrade Considerations

  • We might have depended on a missing specifier causing a specific error from importNow (seems unlikely)
@naugtur naugtur added the enhancement New feature or request label Apr 5, 2024
@naugtur naugtur mentioned this issue Apr 5, 2024
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant