Skip to content

Worker import map proposal#21

Merged
guybedford merged 2 commits intomasterfrom
worker-import-map
Jun 26, 2024
Merged

Worker import map proposal#21
guybedford merged 2 commits intomasterfrom
worker-import-map

Conversation

@guybedford
Copy link
Owner

This adds a new proposal for worker import maps (WICG/import-maps#2), as a commonly requested feature for import maps.

The setImportMap design is also described in the alternatives, but the primary proposal just describes supporting importMap attribute option for worker construction.

@kungfooman
Copy link

I'm following your proposal here: https://github.com/kungfooman/worker-with-import-map/

There are two polyfills for making a Worker with import maps and one polyfill uses your ESM shim 😅

Comment on lines +80 to +81
The proposal is to allow supporting import maps in workers, with a new `importMap` attribute for the worker instantiation options, where the
import map for the worker can be provided explicitly:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inheriting the import map should be the default? That's what I expected and then went down the rabbit hole...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants