Reference for stage 3 source-phase-imports - #44638
Conversation
Preview URLs (11 pages)
Flaws (10)Note! 8 documents with no flaws that don't need to be listed. 🎉 Found an unexpected or unresolvable flaw? Please report it here. URL:
URL:
URL:
External URLs (3)URL:
URL:
URL:
(comment last updated: 2026-07-22 12:14:10) |
8d98853 to
d835b28
Compare
|
|
||
| {{jsSidebar("Statements")}} | ||
|
|
||
| The **`import source`** statement behaves like regular [`import`](/en-US/docs/Web/JavaScript/Reference/Statements/import) statements, but it can only import a module using the default import syntax, and results in an object representing the module's unevaluated source code. The module can be imperatively evaluated later using a method provided by the source code object. |
There was a problem hiding this comment.
FYI @Josh-Cena In case you didn't see the response from Dan, the syntax is supported but right now you can't actually import anything: the ability to import WASM modules is still behind a pref and not public on Chrome or FF
I'm not sure how that affects rollout of this doc
There was a problem hiding this comment.
If the only thing shipped is parsing and there's no valid use case, then I'd not document that at all at this point, or point out that the WASM source capability does exist but is behind a pref. In either case, it wouldn't change what I have written a great deal as I'd still pretend that WASM source capability exists.
There was a problem hiding this comment.
Fair enough. Given there is a behind pref implementation, its going to appear at some point.
|
I had a tiny obstacle. I will come back to this in less than a week, hoping that obstacle gets unblocked soon. |
|
Hi @Josh-Cena So where are we with timing for this now? If we want these docs in then I think I should update BCD with the support for WASM modules behind a pref. It isn't really "ready for testing" IMO, but this would allow us to make it clear that nothing supports the feature in the wild. Either way, ping me when you're wanting a new review. |
|
Yeah I'm mostly done; the only thing lacking is examples, which I'm not sure if I should have if the feature isn't actually useful (because, above all else, I can't actually test it). I'm not even sure if any documentation is necessary if it's not practically usable anywhere. But BCD should definitely be added anyway to record whatever the support status is. I'll leave the judgment call to you. |
Thanks @Josh-Cena . I've added BCD in mdn/browser-compat-data#30136 I'm conflicted about progressing these docs. There's a link to them in the release note that will remain unfulfilled, so it would suit me to have them in. But objectively it is confusing to talk about a feature that doesn't exist yet. I also think we should have examples, but there is no point until it is testable. If it is up to me I propose you get this as far as you can, leave it in draft, and we wait until this has progressed enough for examples to be written before merging. |
|
I agree; leaving the links hanging in the release notes doesn't seem too bad at this point. |
Part of #44475