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

Add non-availability of importmap inside worker thread #21157

Conversation

wolframkriesing
Copy link

I saw on https://developer.mozilla.org/en-US/docs/Web/HTML/Element/script/type/importmap that in the compat table the availability in worker threads is not listed, so this adds it.

Summary

This should add the "available in worker" threads row in the importmaps compat table. And since they are not yet available all should be "No". To be honest, I am not sure what the mirror attributes mean, I just took them from the __compat section. Help appreciated.

Test results and supporting details

I only tested that the JSON is valid, by copying it into my console, but I am not sure if this is all correct. It looks good, but might be all wrong, help appreciated.

I saw on https://developer.mozilla.org/en-US/docs/Web/HTML/Element/script/type/importmap that in the compat table the availability in worker threads is not listed, so this adds it.
@github-actions github-actions bot added the data:html Compat data for HTML elements. https://developer.mozilla.org/docs/Web/HTML label Nov 3, 2023
@hamishwillee
Copy link
Contributor

@wolframkriesing Thanks, but I don't think this is correct. The browser compatibility data records compatibility differences between browsers and the specifications. As far as I can tell the specification does not indicate that importmaps are supported in workers so not supporting workers is not a compatibility issue - it is the expectation.

In addition we don't document "all false" compatibilities - we'd document when some browser was different from all the others.

While it is not a compatibility issue, we should however make it clear in the importmap docs that the feature isn't expected to work in workers. @Josh-Cena Could you please sanity check me here - the spec does not indicate support for importmap other than in the Windows / current Document context?

@Josh-Cena
Copy link
Member

Josh-Cena commented Nov 6, 2023

Hey, I'm far from being an expert in HTML, but I think the key section in the spec is https://html.spec.whatwg.org/multipage/webappapis.html#fetch-a-worklet/module-worker-script-graph, which does indeed seem to be unaware of the import map. Maybe we should tag an HTML author?

@wolframkriesing
Copy link
Author

wolframkriesing commented Nov 6, 2023

I understand the "we don't document "all false" compatibilities" of @hamishwillee, makes total sense.
While, as a user I was expecting to find that info on MDN, and since I strongly believe this is a missing feature and as I see in this issue also one that I believe will be coming, I thought it was worth adding it. At least I would have wished for that info on MDN. Besides, this info does also exist for import, which feels much like in the same realm, I believe.

@wolframkriesing
Copy link
Author

If it does not fit in the current strategy of what goes in the data, feel free to close the PR. I just don't have that many insights as you have, no worries.

@hamishwillee
Copy link
Contributor

THanks @wolframkriesing @Josh-Cena When support for importmaps comes to workers/worklets and is implemented in at least one browser then we'll definitely need an update to BCD. For now, closing this. I'll see if I can add a note somewhere in the docs to make it clear this is currently windows only.

@hamishwillee
Copy link
Contributor

OK, so added the information about importmaps and workers in mdn/content#30078

Thanks again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
data:html Compat data for HTML elements. https://developer.mozilla.org/docs/Web/HTML
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants