-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
TLA not supported in bundles #3301
Comments
TLA has landed in TS 3.8. So when that gets released (early Feb 2020) we will be able to resolve this. |
Since we use TS as a git submodule we could actually upgrade already... but maybe it’s better to wait for release. |
I would say we would want to at least wait for the RC. Master can be a bit of a wild ride. |
Moves to using a minimal System loader for bundles generated by Deno. TypeScript in 3.8 will be able to output TLA for modules, and the loader is written to take advantage of that as soon as we update Deno to TS 3.8. System also allows us to support `import.meta` and provide more ESM aligned assignment of exports, as well as there is better handling of circular imports. The loader is also very terse versus to try to save overhead. Also, fixed an issue where abstract classes were not being rexported. Fixes denoland#2553 Fixes denoland#3559 Fixes denoland#3751 Fixes denoland#3825 Refs denoland#3301
Moves to using a minimal System loader for bundles generated by Deno. TypeScript in 3.8 will be able to output TLA for modules, and the loader is written to take advantage of that as soon as we update Deno to TS 3.8. System also allows us to support `import.meta` and provide more ESM aligned assignment of exports, as well as there is better handling of circular imports. The loader is also very terse versus to try to save overhead. Also, fixed an issue where abstract classes were not being rexported. Fixes denoland#2553 Fixes denoland#3559 Fixes denoland#3751 Fixes denoland#3825 Refs denoland#3301
Moves to using a minimal System loader for bundles generated by Deno. TypeScript in 3.8 will be able to output TLA for modules, and the loader is written to take advantage of that as soon as we update Deno to TS 3.8. System also allows us to support `import.meta` and provide more ESM aligned assignment of exports, as well as there is better handling of circular imports. The loader is also very terse versus to try to save overhead. Also, fixed an issue where abstract classes were not being re-exported. Fixes #2553 Fixes #3559 Fixes #3751 Fixes #3825 Refs #3301
The improvements to bundling is part of the solution for top level await. And #3937 will automatically close this without further work. |
In regards to top-level-await, TypeScript will throw if the input does not look like a module (as top-level-await is not supported in scripts). TypeScript recommends adding `export {};` to the file, which is the current idomatic way of identifying a module as a module that otherwise has no imports or exports. Resolves denoland#3937 Resolves denoland#3301 Resolves denoland#3391
Currently, TypeScript does not support TLA (including 3.7). This means when we emit a bundle, we depend on the TypeScript compiler to generate the modules as AMD modules, and it does not realise that it needs to turn the define callback into an async function, meaning the
await
that was previously top level now is in a function that isn't async, throwing a syntax error at runtime.We will need TLA formally supported in TypeScript, instead of just ignoring the error to resolve this.
The text was updated successfully, but these errors were encountered: