Skip to content
This repository was archived by the owner on Feb 26, 2025. It is now read-only.
This repository was archived by the owner on Feb 26, 2025. It is now read-only.

Will module specifiers support query strings? #134

@dcleao

Description

@dcleao

For example, given the import map:

{
  "imports": {
     "@my/generator": "https://my.generator.com/"
  }
}

Above, the module specifier key in the import map would not be allowed to have a query string part (but the module URL it is mapped to could).

Then, in JavaScript code, it would be possible to resolve an import URL containing a query string:

fetch("import:@my/generator?path=a/b/c").then((response) => {
  // ...
});

Would this resolve to calling the URL: https://my.generator.com/?path=a/b/c?

A similar exercise could be made for an ES6 module which the above URL would dynamically generate and that could then be loaded by the dynamic import "function".

I believe this is a compelling use case.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions