Skip to content

Fine-grained modules compatibility #4819

@guybedford

Description

@guybedford

I found myself putting together a fine-grained table of ES module features in https://github.com/guybedford/es-module-shims/#browser-support.

I thought it would be worth creating an issue here to share the fine-grained behaviours that have turned out necessary to test, as it's already become a process checking this data. If any of these are tracked in separate issues this can certainly be broken up and closed. Also if this falls outside of the existing process please let me know how I can better frame these points.

It's also worth specifically noting there are compatibility bugs where modules support isn't a simple yes or no - see the problems in Edge and Safari mentioned below.

To summarize the fine-grained metrics and compatibility adjustments:

  1. Basic Modules Support (Current HTML feature, Edge has a bug where modules were executed in reverse order, see Modules executing in reverse post-order chakra-core/ChakraCore#6261, I haven't properly worked out which versions this applies to)
  2. Dynamic import (JavaScript feature. Note that support for dynamic import in Web Workers is also a separate question here, as only Chrome supports that currently. There is another issue as well here where dynamic import does not respect the <base> tag in Safari but does in other browsers, see https://bugs.webkit.org/show_bug.cgi?id=201692 CanIUse has a good support table for this).
  3. import.meta.url (JavaScript feature, no source of the support table yet)
  4. Module workers (HTML feature, Chrome only currently, no source of the support table yet)
  5. Import Maps (HTML feature, Experimental Web Platform in Chrome, but should be stable in the next few months)

It would be really beneficial to see these fine-grained compatibility checks being visible to help ensure clarity for users and browser vendors.

Metadata

Metadata

Assignees

No one assigned

    Labels

    data:jsCompat data for JS/ECMAScript features. https://developer.mozilla.org/docs/Web/JavaScriptidleIssues and pull requests with no recent activity

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions