Repository navigation
perf(ext/node): convert validators.mjs and dependencies to lazy-loaded scripts - #33821
Merged
Merged
Conversation
…d scripts Converts the following ext/node polyfill files from ESM to IIFE-wrapped lazy-loaded scripts (lazy_loaded_js): - internal/validators.mjs - internal/error_codes.ts - internal/hide_stack_frames.ts - internal/util/types.ts - internal/crypto/_keys.ts - internal/crypto/constants.ts - internal_binding/types.ts Updates ~100 consumer files to use core.loadExtScript() instead of ESM imports. Breaks circular dependency between validators.mjs and util.mjs via deferred loading in validateEncoding().
validators.mjs cannot core.loadExtScript() from util.mjs because util.mjs is still in the esm list. Instead, load normalizeEncoding from its actual source (normalize_encoding.ts) which is now also converted to lazy_loaded_js. Also removes redundant `const core = globalThis.Deno.core` in x509.ts that shadowed the imported core binding.
2 of 3 tasks
littledivy
pushed a commit
to crowlKats/deno
that referenced
this pull request
Jun 10, 2026
…d scripts (denoland#33821) Converts the first batch of ext/node polyfill files from ESM to IIFE-wrapped lazy-loaded scripts (`lazy_loaded_js`): - `internal/validators.mjs` (89 consumers) - `internal/error_codes.ts` - `internal/hide_stack_frames.ts` - `internal/util/types.ts` - `internal/crypto/_keys.ts` - `internal/crypto/constants.ts` - `internal_binding/types.ts` Updates ~100 consumer files to use `core.loadExtScript()` instead of ESM imports. Breaks the circular dependency between `validators.mjs` and `util.mjs` via deferred loading in `validateEncoding()`. This is the first step toward converting ext/node internals bottom-up by dependency order. `validators.mjs` is one of the most widely imported modules, so converting it (and its dependency chain) unblocks many future conversions.
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
Converts the first batch of ext/node polyfill files from ESM to IIFE-wrapped lazy-loaded scripts (
lazy_loaded_js):internal/validators.mjs(89 consumers)internal/error_codes.tsinternal/hide_stack_frames.tsinternal/util/types.tsinternal/crypto/_keys.tsinternal/crypto/constants.tsinternal_binding/types.tsUpdates ~100 consumer files to use
core.loadExtScript()instead of ESM imports. Breaks the circular dependency betweenvalidators.mjsandutil.mjsvia deferred loading invalidateEncoding().This is the first step toward converting ext/node internals bottom-up by dependency order.
validators.mjsis one of the most widely imported modules, so converting it (and its dependency chain) unblocks many future conversions.Test plan
cargo checkpasses