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

Motivating case for importNowHook #10

Open
kriskowal opened this issue May 23, 2020 · 1 comment
Open

Motivating case for importNowHook #10

kriskowal opened this issue May 23, 2020 · 1 comment

Comments

@kriskowal
Copy link
Member

Having recently implemented the first pass at supporting ESM in the SES shim (to be released next week as 0.8.0), I’m wondering what case motivates the need for importNowHook. The only case I imagine might need such a hook was built-in modules, but I found that the moduleMap constructor argument adequately served that need. The behavior of import seems to be fully fleshed in terms of moduleMap, resolveHook, and importHook.

If there is no surviving motivating case, we may have an opportunity to remove it.

@kriskowal
Copy link
Member Author

Renaming importHook to loadHook #26 clarifies its role as a function that drives the module loader but does not result in initialization of any modules (as implied by “import”). Given also that the moduleMap and moduleMapHook afford injecting built-in modules synchronously, I move that we remove importNowHook from the Compartment proposal.

I believe we would need affirmation from our collaborators at Moddable to make such a change. @phoddie @patrick-soquet. Are there objections?

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