Skip to content

Reference for stage 3 source-phase-imports - #44638

Draft
Josh-Cena wants to merge 2 commits into
mdn:mainfrom
Josh-Cena:source-phase-import
Draft

Reference for stage 3 source-phase-imports#44638
Josh-Cena wants to merge 2 commits into
mdn:mainfrom
Josh-Cena:source-phase-import

Conversation

@Josh-Cena

Copy link
Copy Markdown
Member

Part of #44475

@github-actions github-actions Bot added Content:JS JavaScript docs Content:wasm WebAssembly docs size/m [PR only] 51-500 LoC changed labels Jul 3, 2026
@github-actions

github-actions Bot commented Jul 3, 2026

Copy link
Copy Markdown
Contributor
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: /en-US/docs/Web/JavaScript/Reference
Title: JavaScript reference
Flaw count: 4

  • macros:
    • Macro jsxref produces link /en-US/docs/Web/JavaScript/Reference/this which is a redirect
    • Macro jsxref produces link /en-US/docs/Web/JavaScript/Reference/new which is a redirect
    • Macro jsxref produces link /en-US/docs/Web/JavaScript/Reference/delete which is a redirect
    • Macro jsxref produces link /en-US/docs/Web/JavaScript/Reference/instanceof which is a redirect

URL: /en-US/docs/Web/JavaScript/Reference/Global_Objects
Title: Standard built-in objects
Flaw count: 1

  • macros:
    • Macro jsxref produces link /en-US/docs/Web/JavaScript/Reference/this which is a redirect

URL: /en-US/docs/Web/JavaScript/Reference/Operators
Title: Expressions and operators
Flaw count: 5

  • macros:
    • Macro jsxref produces link /en-US/docs/Web/JavaScript/Reference/this which is a redirect
    • Macro jsxref produces link /en-US/docs/Web/JavaScript/Reference/new which is a redirect
    • Macro jsxref produces link /en-US/docs/Web/JavaScript/Reference/new which is a redirect
    • Macro jsxref produces link /en-US/docs/Web/JavaScript/Reference/delete which is a redirect
    • Macro jsxref produces link /en-US/docs/Web/JavaScript/Reference/instanceof which is a redirect
External URLs (3)

URL: /en-US/docs/Web/JavaScript/Reference/Global_Objects/AbstractModuleSource
Title: AbstractModuleSource


URL: /en-US/docs/Web/JavaScript/Reference/Operators/import/source
Title: import.source()


URL: /en-US/docs/Web/JavaScript/Reference/Statements/import/source
Title: import source

(comment last updated: 2026-07-22 12:14:10)

@Josh-Cena
Josh-Cena force-pushed the source-phase-import branch from 8d98853 to d835b28 Compare July 3, 2026 21:01

{{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.

@hamishwillee hamishwillee Jul 13, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

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

@Josh-Cena Josh-Cena Jul 18, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

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.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Fair enough. Given there is a behind pref implementation, its going to appear at some point.

@Josh-Cena

Copy link
Copy Markdown
Member Author

I had a tiny obstacle. I will come back to this in less than a week, hoping that obstacle gets unblocked soon.

@hamishwillee

Copy link
Copy Markdown
Collaborator

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.

@Josh-Cena

Copy link
Copy Markdown
Member Author

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.

@hamishwillee

Copy link
Copy Markdown
Collaborator

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.

@Josh-Cena

Copy link
Copy Markdown
Member Author

I agree; leaving the links hanging in the release notes doesn't seem too bad at this point.

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

Labels

Content:JS JavaScript docs Content:wasm WebAssembly docs size/m [PR only] 51-500 LoC changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants