Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Worker import map proposal #21

Merged
merged 2 commits into from
Jun 26, 2024
Merged

Worker import map proposal #21

merged 2 commits into from
Jun 26, 2024

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