Improvements to bundling. (#3965)

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
This commit is contained in:
Kitson Kelly 2020-02-13 08:41:51 +11:00 committed by GitHub
parent 3563ab4c53
commit 6bd846a780
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 161 additions and 25 deletions

View file

@ -245,7 +245,7 @@ pub fn get_asset(name: &str) -> Option<&'static str> {
};
}
match name {
"bundle_loader.js" => Some(include_str!("bundle_loader.js")),
"system_loader.js" => Some(include_str!("system_loader.js")),
"bootstrap.ts" => Some("console.log(\"hello deno\");"),
"typescript.d.ts" => inc!("typescript.d.ts"),
"lib.esnext.d.ts" => inc!("lib.esnext.d.ts"),