Repository navigation
Add support for import defer proposal - #60757
Merged
Wesley Wigham (weswigham) merged 25 commits intoJun 6, 2025
Merged
Conversation
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This proposal is currently at Stage 3.
This PR only needs to add parsing support for the proposal:
import defer * as nsis meant to "look like" the one created byimport * as nsAs you'll see from the code, whether a module is deferred or not is not a boolean but an enum. That's because of the
import sourceproposal: there is no PR for it yet, but once it will be implemented it should be done by adding one more possible "import phase" to this enum. A question I have is if that should be an enum, or just an union ofundefined | DeferKeyword(which will one day becomeundefined | DeferKeyword | SourceKeyword).Fixes #59391
This patch was originally written by Ujjwal Sharma (@ryzokuken)