SIGN IN SIGN UP
denoland / deno UNCLAIMED

A modern runtime for JavaScript and TypeScript.

0 0 54 Rust

feat(core): add async module resolution support via ModuleResolveResponse (#32432)

## Summary

- Add `ModuleResolveResponse` enum with `Sync`/`Async` variants,
mirroring the existing `ModuleLoadResponse` pattern, to support async
module resolution in Node.js-style loaders
- Change `ModuleLoader::resolve()` return type from
`Result<ModuleSpecifier, ModuleLoaderError>` to `ModuleResolveResponse`
- Add `ModuleMap::resolve_sync()` (for V8 callback path) and
`resolve_async()` (for recursive loading) helper methods
- Add `ResolvingRoot` state to `RecursiveModuleLoad` state machine for
async root resolution
- Add `needs_resolve` field to `ModuleRequest` for deferred async child
import resolution
- Update all downstream `ModuleLoader` implementations to wrap returns
in `ModuleResolveResponse::Sync(...)`

This is backward-compatible: all existing loaders use `Sync` resolution,
while new loaders can return `Async` for use cases like querying a
package registry or running user-provided JS resolve hooks.
B
Bartek Iwańczuk committed
950ca9bb7b174e90655f8a12f2b55801fed9259f
Parent: 3da98e6
Committed by GitHub <noreply@github.com> on 5/2/2026, 6:42:49 AM