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 Support for Top Level Await inside CJS #350

Closed
frank-dspeed opened this issue Sep 28, 2020 · 2 comments
Closed

Add Support for Top Level Await inside CJS #350

frank-dspeed opened this issue Sep 28, 2020 · 2 comments
Assignees

Comments

@frank-dspeed
Copy link
Contributor

when i do require('myFile')

there is no top level await support inside myFile when running in a context with ecma script 2021 and commonjs-require

Top Level Await works Inside ESM.

@eleinadani
Copy link
Contributor

Hi @frank-dspeed top-level await (see e.g., https://github.com/tc39/proposal-top-level-await and https://tc39.es/proposal-top-level-await/ ) is designed to work with ES modules, but it does not work with CommonJS modules (they are not part of the ECMA spec). This is why top-level await does not work in your case.

@frank-dspeed
Copy link
Contributor Author

frank-dspeed commented Dec 4, 2022

@eleinadani REOPEN!
@wirthi

nodejs/modules#351 <= as part of loader hooks

nodejs got a new flag --import[] that means you can define one or more import at load time that loads before intrinsics get frozzen that means

it implements js loader hooks and atomic ESM so Sync i need that most best also directly supported in graaljs without node to create a share able module standard and ecosystem for the web i call it web-modules

nodejs/node#43942

that uses a indipendent worker for that.

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

2 participants