feat: support TC39 import defer proposal#1280
Closed
bartlomieju wants to merge 5 commits intodenoland:mainfrom
Closed
feat: support TC39 import defer proposal#1280bartlomieju wants to merge 5 commits intodenoland:mainfrom
bartlomieju wants to merge 5 commits intodenoland:mainfrom
Conversation
Adds initial support for the TC39 "Deferred Module Evaluation" proposal (https://github.com/tc39/proposal-defer-import-eval). Changes: - Enable V8 `--js-defer-import-eval` flag for parser support - Separate `ModuleImportPhase::Defer` handling from `Evaluation` phase - Add integration test (disabled until V8 runtime support is complete) The `import defer` syntax allows loading modules without immediate execution. The module evaluates synchronously on first property access. Note: V8 14.5 (rusty_v8 145) has parser support but incomplete runtime support. The test is disabled until a future V8 version completes the implementation. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
V8 14.6 (rusty_v8 146) now has complete runtime support for the `import defer` proposal. Enable the previously disabled integration test and remove outdated V8 version notes. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1280 +/- ##
==========================================
- Coverage 81.43% 77.61% -3.82%
==========================================
Files 97 105 +8
Lines 23877 26813 +2936
==========================================
+ Hits 19445 20812 +1367
- Misses 4432 6001 +1569 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
bartlomieju
added a commit
to bartlomieju/deno
that referenced
this pull request
Feb 27, 2026
Adds support for the TC39 "Deferred Module Evaluation" proposal (https://github.com/tc39/proposal-defer-import-eval, Stage 3). Changes: - Enable V8 `--js-defer-import-eval` flag for parser/runtime support - Separate `ModuleImportPhase::Defer` handling from `Evaluation` phase: deferred modules are instantiated but not evaluated, letting V8 create a deferred namespace that triggers evaluation on first property access - Add integration test validating deferred evaluation semantics Ported from denoland/deno_core#1280 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Member
Author
|
Closing in favor of denoland/deno#32360 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
--js-defer-import-evalflagModuleImportPhase::Deferhandling fromEvaluationphase in module loadingBackground
The
import deferproposal (Stage 3) allows loading modules without immediate execution:Changes
core/runtime/setup.rs--js-defer-import-evalV8 flagcore/modules/map.rstesting/lib.rsimport_deferintegration testtesting/integration/import_defer/*Test plan
cargo test -p deno_core_testing- 55 tests)import_defertest passes with V8 14.6 (rusty_v8 146) runtime support🤖 Generated with Claude Code