-
Notifications
You must be signed in to change notification settings - Fork 26
Support multiple runtimes #397
Comments
I suggest we ship the following runtimes:
This should allow us to cover most of the interesting cases highlighted in this doc. We should bundle the generated SDK sources as resources, so as to cover the other cases on the fly and to allow DDC to perform "whole-world" tree-shaking. Proposed layout:
|
Nice writeup :)
I hope we can get rid of "legacy" in favor of one of the browser-friendly JS module patterns. I like the "proposed layout" ... here's a few small tweaks:
the idea is "lib/runtime" for our JS pre-compiled files (we may be able to get rid of this at some point, and use caching instead.) "lib/sdk" is for the SDK sources. Aside, I'm starting to wonder if we'll want to move those into https://github.com/dart-lang/sdk. Some work to do on merging first, though. |
BTW, I presume "lib/sdk" is the current "tool/generated_sdk", not "tool/input_sdk", which is different. To use "tool/input_sdk" we'd have to teach DDC how to handle _patch files. Which is doable, but not something that DDC currently understands (see tool/patch_sdk). |
Yes, shortened |
FYI, I'm going to take a look at this. DDC almost doesn't care at all what module format you use until the very end. I think it's doable to have it emit the SDK in all formats. Shouldn't add much (if any) to the build time. |
Fixed :) |
When #310 is done, we'll be able to target different module systems. The runtime files will need to match those targets, and more generally we may want a runtime built with the same flags as the user code.
An option we discussed is to checkin the code for a couple of "predefined" major runtimes (e.g. one with ES6 modules, another with our current module system, etc), but we may also need a way to serialize the codegen options and lazily create a adhoc version of the runtime with those options.
The text was updated successfully, but these errors were encountered: