elsaland / elsa

❄️ Elsa is a minimal runtime for JavaScript and TypeScript written in Go
MIT License
2.8k stars 62 forks source link

Top level await #26

Open littledivy opened 4 years ago

littledivy commented 4 years ago

Tracking issue for support for top level await - because, why not? :)

PS: This will be a bundling step (esbuild) rather than runtime

Waiting for esbuild to support top level await for bundling - https://github.com/evanw/esbuild/issues/253

martonlederer commented 4 years ago

As far as I can see, esbuild is not supporting this feature, because it's not compatible with commonjs. Since elsa doesn't use commonjs, wouldn't it make sense to just fork esbuild and code top level await support ourselves?

littledivy commented 4 years ago

Not that easy, esbuild does support top level await at transformation but does not support it while bundling. The author of esbuild did express that they need for top level await will arise -https://github.com/evanw/esbuild/issues/253#issuecomment-657359939

buttercubz commented 4 years ago

Not that easy, esbuild does support top level await at transformation but does not support it while bundling. The author of esbuild did express that they need for top level await will arise -evanw/esbuild#253 (comment)

I tried to do TLA on my own but it is not that easy, for that reason check in esbuild, we tend to wait for them to add TLA suppor