Import maps currently have to load before any ES module and there can only be a single import map per document. That makes them fragile and potentially slow to use in real-life scenarios: Any module that loads before them breaks the entire app, and in apps with many modules they become a large blocking resource, as the entire map for all possible modules needs to load first. This feature is to enable multiple import maps per document, by merging them in a consistent and deterministic way.
This feature changes the existing behavior of import maps, but does so in a backwards compatible way. Sites that have working import maps right now will continue to work. The main compatibility risk may come from sites with import maps that aren't working today (either defined after module loads or multiple of them) that would start working after this feature ships. As such maps are currently throwing errors, I wouldn't expect them to be common in functioning sites, and there's even a chance that this change will fix such sites.
One thing to note is that we haven't defined a non-destructive way to feature-detect this change. I believe this is fine, as (similar to JS language features) sites would need to use UA version sniffing to know if they can deliver multiple (smaller) import maps or a single large one.
In terms of interop risk, WebKit has expressed a positive position, and I'm planning to implement the feature there as well.
Does this intent deprecate or change behavior of existing APIs, such that it has potentially high risk for Android WebView-based applications?
None
None
https://wpt.fyi/results/import-maps/multiple-import-maps?label=experimental&label=master&aligned https://wpt.fyi/results/import-maps/not-overridden?label=master&label=experimental&aligned
Shipping on desktop | 133 |
Shipping on Android | 133 |
Shipping on WebView | 133 |
Open questions about a feature may be a source of future web compat or interop issues. Please list open issues (e.g. links to known github issues in the project for the feature specification) whose resolution may introduce web compat/interop risk (e.g., changing to naming or structure of the API in a non-backward-compatible way).
--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
To view this discussion visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/db5e53f9-9abf-49a0-a0bd-4b7be197c527n%40chromium.org.
In future, I'd like to see the TAG push back on things like Import Maps and Speculation Rules that use `<script type="...">` as a semantic black box. These features need to:
- Compose consistently, or at least sanely (as this Intent proposes)
- Expose mutation events that aren't just "some text content changed"
- Provide proper DOM traversal and manipulation APIs
- Generally be expressible in ways that aren't just inline JSON blobs
It's bad enough that we are still awash in `<script type="application/ld+json">` as barnacle on HTML semantics, but we shouldn't keep adding to the damage.
LGTM2
To view this discussion visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/b5151ff9-7080-489a-8b8d-a7029886717b%40chromium.org.