feat: polyfill multiple import maps #443
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This implements a polyfill for the new multiple import maps feature in Chrome (https://groups.google.com/a/chromium.org/g/blink-dev/c/4JWXZilDG6w).
I've tested this in Canary and can confirm it works correctly with the baseline passthrough mode engagement.
Multiple import maps actually flip the logic on the previous native subgraph passthrough feature that was formerly disabled in #208. With multiple import maps it is now possible to start out on baseline import maps support fully on the native loader, but then later on switch into polyfilling some graphs as needed if multiple import maps are later used.
This PR supports this new ability to "swich off" baseline passthrough as soon as multiple import maps come into play, and then in order to preserve instancing now reenables subgraph native passthrough.
The changes for this are documented in the readme and the multiple import maps feature also includes its own caveats.