-
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
Improvements to bundling. #3965
Conversation
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, I defer to @ry to land
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good.
It would be useful to have the test case from #3825 in the integration tests. (Note we already have //cli/tests/circular1.js
, maybe that can be reused...)
Oops, I tried removing bundle_loader.js but it's used by mksnapshot_bundle... I wonder if mksnapshot_bundle couldn't also use this new system bundler? |
This reverts commit 13ace67.
@ry no... mentioned in the comments above:
In particular, the way we deal with I will add a test case for #3825. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM - thanks kitson!
* master: v0.33.0 fix: appended CRLF to end of trailer headers (denoland#3989) Clean up fmt flags and path handling (denoland#3988) Improvements to bundling. (denoland#3965) fix: Correctly determine a --cached-only error (denoland#3979) chore: share HTTP server between tests (denoland#3966) dont use env vars in multiple installer tests (denoland#3967) feat(node): add EventEmitter.errorMonitor (denoland#3960) fix(file_server): don't crash on "%" pathname (denoland#3953) update references to testing/mod.ts in manual (denoland#3973)
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.
It is worth noting that this cannot be used for the internal snapshot bundles, because it turns the whole instantiation process into an async process which executes out of turn, which causes some problems in setting up the runtime environment. The long term plan though for the snapshots is not to use a "bundle" at all, but instead to inject each module into the isolate.
Fixes #2553
Fixes #3559
Fixes #3751
Fixes #3825
Refs #3301