summaryrefslogtreecommitdiff
path: root/ext/node/polyfill.rs
AgeCommit message (Collapse)Author
2024-08-22fix(ext/node): register `node:wasi` built-in (#25134)Divy Srivastava
Fixes https://github.com/denoland/deno/issues/23531
2024-08-14fix: `node:inspector` not being registered (#25007)Marvin Hagemeister
For some reason we didn't register the `node:inspector` module, which lead to a panic when trying to import it. This PR registers it. Related: https://github.com/denoland/deno/issues/25004
2024-07-25refactor: decouple node resolution from deno_core (#24724)David Sherret
2024-06-25fix(node): add missing readline/promises module (#24336)Bartek Iwańczuk
Fixes https://github.com/jsr-io/jsr-npm/issues/91
2024-01-01chore: update copyright to 2024 (#21753)David Sherret
2023-12-14fix(node): support resolving a package.json import to a builtin node module ↵David Sherret
(#21576) Closes https://github.com/denoland/deno/issues/21501
2023-08-04fix(node): repl._builtinLibs (#20046)Bartek Iwańczuk
Ref https://github.com/denoland/deno/issues/19733
2023-08-02feat(node): add polyfill for node:test module (#20002)Bartek Iwańczuk
This commit provides basic polyfill for "node:test" module. Currently only top-level "test" function is polyfilled, all remaining functions from that module throw not implemented errors.
2023-07-02refactor: rename built-in node modules from ext:deno_node/ to node: (#19680)Bartek Iwańczuk
Closes https://github.com/denoland/deno/issues/19510
2023-05-28refactor(core): remove ext: modules from the module map (#19040)Nayeem Rahman
Rather than disallowing `ext:` resolution, clear the module map after initializing extensions so extension modules are anonymized. This operation is explicitly called in `deno_runtime`. Re-inject `node:` specifiers into the module map after doing this. Fixes #17717.
2023-05-17fix(node): export diagnostics_channel module (#19167)Bartek Iwańczuk
Closes https://github.com/denoland/deno/issues/19166
2023-05-17fix(node): export punycode module (#19151)Bartek Iwańczuk
Closes https://github.com/denoland/deno/issues/19147
2023-05-11fix(npm): make http2 module available, make 'nodeGlobalThisName' writable ↵Bartek Iwańczuk
(#19092)
2023-04-21refactor(node): move most of cli/node to ext/node (#18797)David Sherret
This is just a straight refactor and I didn't do any cleanup in ext/node. After this PR we can start to clean it up and make things private that don't need to be public anymore.
2023-03-20refactor(ext/node): untangle dependencies between js files (#18284)Bartek Iwańczuk
Moving some code around in `ext/node` is it's a bit better well defined and makes it possible for others to embed it. I expect to see no difference in startup perf with this change.
2023-03-08refactor: rename InternalModuleLoader to ExtModuleLoader, use ext: scheme ↵Bartek Iwańczuk
for snapshotted modules (#18041) This commit renames "deno_core::InternalModuleLoader" to "ExtModuleLoader" and changes the specifiers used by the modules loaded from this loader to "ext:". "internal:" scheme was really ambiguous and it's more characters than "ext:", which should result in slightly smaller snapshot size. Closes https://github.com/denoland/deno/issues/18020
2023-03-05refactor(core): include_js_files! 'dir' option doesn't change specifiers ↵Bartek Iwańczuk
(#18019) This commit changes "include_js_files!" macro from "deno_core" in a way that "dir" option doesn't cause specifiers to be rewritten to include it. Example: ``` include_js_files! { dir "js", "hello.js", } ``` The above definition required embedders to use: `import ... from "internal:<ext_name>/js/hello.js"`. But with this change, the "js" directory in which the files are stored is an implementation detail, which for embedders results in: `import ... from "internal:<ext_name>/hello.js"`. The directory the files are stored in, is an implementation detail and in some cases might result in a significant size difference for the snapshot. As an example, in "deno_node" extension, we store the source code in "polyfills" directory; which resulted in each specifier to look like "internal:deno_node/polyfills/<module_name>", but with this change it's "internal:deno_node/<module_name>". Given that "deno_node" has over 100 files, many of them having several import specifiers to the same extension, this change removes 10 characters from each import specifier.
2023-02-22refactor: use deno_graph for npm specifiers (#17858)David Sherret
This changes npm specifiers to be handled by deno_graph and resolved to an npm package name and version when the specifier is encountered. It also slightly changes how npm specifier resolution occurs—previously it would collect all the npm specifiers and resolve them all at once, but now it resolves them on the fly as they are encountered in the module graph. https://github.com/denoland/deno_graph/pull/232 --------- Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2023-02-15feat: wire up ext/node to the Node compatibility layer (#17785)Bartek Iwańczuk
This PR changes Node.js/npm compatibility layer to use polyfills for built-in Node.js embedded in the snapshot (that are coming from "ext/node" extension). As a result loading `std/node`, either from "https://deno.land/std@<latest>/" or from "DENO_NODE_COMPAT_URL" env variable were removed. All code that is imported via "npm:" specifiers now uses code embedded in the snapshot. Several fixes were applied to various modules in "ext/node" to make tests pass. --------- Co-authored-by: Yoshiya Hinosawa <stibium121@gmail.com> Co-authored-by: Divy Srivastava <dj.srivastava23@gmail.com>
2023-02-14feat(ext/node): embed std/node into the snapshot (#17724)Bartek Iwańczuk
This commit moves "deno_std/node" in "ext/node" crate. The code is transpiled and snapshotted during the build process. During the first pass a minimal amount of work was done to create the snapshot, a lot of code in "ext/node" depends on presence of "Deno" global. This code will be gradually fixed in the follow up PRs to migrate it to import relevant APIs from "internal:" modules. Currently the code from snapshot is not used in any way, and all Node/npm compatibility still uses code from "https://deno.land/std/node" (or from the location specified by "DENO_NODE_COMPAT_URL"). This will also be handled in a follow up PRs. --------- Co-authored-by: crowlkats <crowlkats@toaxl.com> Co-authored-by: Divy Srivastava <dj.srivastava23@gmail.com> Co-authored-by: Yoshiya Hinosawa <stibium121@gmail.com>
2023-02-10refactor: clean up "cli/node/mod.rs" and "ext/node" (#17713)Bartek Iwańczuk
This commit moves some code around from "cli/node/mod.rs" to "ext/node". Additionally "ext/node" was changed to factor out "ops.rs" and "polyfill.rs" modules.