Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Web Workers importmap field #11002

Copy link
Copy link
Closed
Closed
Copy link
@WebReflection

Description

@WebReflection
Issue body actions

What is the issue with the HTML Standard?

I am not sure this is the place to discuss such feature request but basically Workers and importmap don't cope well with each other.

The idea here is that, given a single <script type="importmap"> and its JSON context, such JSON context can be forwarded to either Worker or SharedWorker constructors through their initialization options parameter.

const w = new Worker('./worker.js', { type: 'module', importmap: { ...that_one } })

As long story short, it's unfortunate only the main thread can benefit from importmap but there's no way to propagate that map elsewhere, or create ad-hoc importmap for detached threads so I hope this issue/feature-request will be somehow addressed sooner than later, also because polyfills around this issue look ugly and full of 3rd party dependencies that do a bit too much to make bare imports work in environments where static import is allowed, but no way to dictate how that works, is available as API.

Thanks

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

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.