summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2023-02-16ref(core): Refactor core:fs error mapping to use unified format (#17719)Kamil Ogórek
2023-02-16ref(cli): Add better error message when powershell is missing during upgrade ↵Kamil Ogórek
(#17759) Closes https://github.com/denoland/deno/issues/17756
2023-02-16perf(ext/node): move winerror binding to rust (#17792)Divy Srivastava
16873 lines of JS removed from the snapshot.
2023-02-16test: add unit tests from std/node (#17794)Bartek Iwańczuk
Adds two test files: "cli/tests/unit_node/process_test.ts" and "cli/tests/unit_node/child_process_test.ts" --------- Co-authored-by: Yoshiya Hinosawa <stibium121@gmail.com>
2023-02-16feat: Deprecate Deno.run API in favor of Deno.Command (#17630)Bartek Iwańczuk
2023-02-16test: ignore inspector tests for npm integration (#17796)Bartek Iwańczuk
I will revisit and fix the test after we move along with "ext/node" integration. eg. https://github.com/denoland/deno/actions/runs/4189205563/jobs/7261246149
2023-02-16chore(cli/test): stabilize coverage, doc, shuffle flags (#17661)Geert-Jan Zwiers
This PR removes the `UNSTABLE` mentions from the CLI docs for `deno test --coverage/doc/shuffle`.
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-15refactor: use deno_graph's semver and npm structs (#17791)David Sherret
2023-02-15refactor: make resolver required (#17783)David Sherret
Makes the resolver required and prints a warning when vendoring and a dynamic import can't be resolved. Closes #16522
2023-02-15feat(flash): add 2nd param to handler to get remote address (#17633)Leo Kettmeir
Closes #17583
2023-02-15fix(ext/ffi): improve error messages in FFI module (#17786)Matt Mastracci
Fixes denoland#16922. The error messages in the `ffi` module are somewhat cryptic when passing functions that have invalid `parameters` or `result` type strings. While the generated serializer for the `ForeignFunction` struct correctly outputs a correct and verbose message, the user sees a far less helpful `data did not match any variant` message instead. The underlying cause appears to be the fallback message in the auto-derived deserializer for untagged enums [1] generated as a result of `ForeignSymbol` being marked as `#[serde(untagged)]` [2]. Passing an unexpected value for `NativeType` causes it to error out while attempting to deserialize both enum variants -- once because it's not a match for the `ForeignStatic` variant, and once because the `ForeignFunction` deserializer rejects the invalid type for the parameters/return type. This is currently open as [serde #773](https://github.com/serde-rs/serde/issues/773), and not a trivial exercise to fix generically. [1] https://github.com/serde-rs/serde/blob/v0.9.7/serde_derive/src/de.rs#L730 [2] https://github.com/denoland/deno/blob/main/ext/ffi/dlfcn.rs#L102 [3] https://github.com/serde-rs/serde/issues/773 Note that the auto-generated deserializer for untagged enums uses a private API to buffer deserializer content that we don't have access to. Instead, we can make use of the `serde_value` crate to buffer the values. This can likely be removed once the official buffering API lands (see [4] and [5]). In addition, this crate pulls in `serde_json` as a cheap way to test that the deserializer works properly. [4] https://github.com/serde-rs/serde/issues/741 [5] https://github.com/serde-rs/serde/pull/2348
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-14fix: loading built-in Node modules embedded in the binary (#17777)Bartek Iwańczuk
Fixes bug introduced in ed3a7ce2f719e64e59cfebb3d131a05a1694523b that caused errors when loading built-in Node modules, when using "deno_graph".
2023-02-14feat(node): stabilize Node-API (#17553)Bartek Iwańczuk
This commit stabilizes Node-API, the "--unstable" flag is no longer required to load native extensions. "--allow-ffi" permission is still required to load them.
2023-02-14feat: stabilize Deno.osUptime() (#17554)Bartek Iwańczuk
This commit stabilizes "Deno.osUptime()" API. The "--unstable" flag is no longer required to use this API.
2023-02-14chore(build): don't compress TSC snapshot in debug build (#17772)Bartek Iwańczuk
Compressing the TSC snapshot in debug build took ~45s on M1 MacBook Pro; without compression it took ~1s. Thus we're not not using compressed snapshot, trading off a lot of build time for some startup time in debug build.
2023-02-14feat: Deprecate 'deno bundle' subcommand (#17695)Bartek Iwańczuk
This commit adds a deprecation warning when using "deno bundle" subcommand and removes it from the output of "deno help".
2023-02-14feat(core): allow to specify entry point for snapshotted ES modules (#17771)Bartek Iwańczuk
This commit adds "ExtensionBuilder::esm_entry_point()" function that allows to specify which of the extension files should be treated as an entry point. If the entry point is not provided all modules are loaded and evaluated, but if it is provided then only the entry point is explicitly loaded and evaluated. Co-authored-by: Leo Kettmeir <crowlkats@toaxl.com>
2023-02-13feat: Stabilize Deno.Command API (#17628)Bartek Iwańczuk
This commit stabilizes "Deno.Command" API with all its related APIs. "--unstable" flag is no longer required to use this API.
2023-02-13fix(ext/websocket): extra ws pongs sent (#17762)Divy Srivastava
Fixes https://github.com/denoland/deno/issues/17761 Tugstenite already sends a pong for a recieved ping. This automatically happens when the socket read is being driven. From https://github.com/snapview/tokio-tungstenite/issues/88 > You need to read from the read-side of the socket so that it receives/handles pings, and on the next write it would then send the corresponding pong. Here's the source: https://github.com/snapview/tungstenite-rs/blob/e1033afd959bb7abfcbc181033b8326f8a40562b/src/protocol/mod.rs#L374-L380 ```rust // Upon receipt of a Ping frame, an endpoint MUST send a Pong frame in // response, unless it already received a Close frame. It SHOULD // respond with Pong frame as soon as is practical. (RFC 6455) if let Some(pong) = self.pong.take() { trace!("Sending pong reply"); self.send_one_frame(stream, pong)?; } ``` WIth this patch, all Autobahn tests from 1-8 pass. Fixed cases: 2.1, 2.2, 2.3, 2.4, 2.6, 2.9, 2.10, 2.11, 5.6, 5.7, 5.8, 5.19, 5.20 To run the test yourself, follow https://www.notion.so/denolandinc/Autobahn-WebSocket-testsuite-723a86f450ce4823b4ef9cb3dc4c7869?pvs=4
2023-02-13refactor(runtime): reorganize build script for snapshot (#17760)Bartek Iwańczuk
This commit reorganizes "runtime/build.rs" to properly create an extension and conditionally include "99_main.js" in the snapshot.
2023-02-12fix: add WouldBlock error (#17339)Leo Kettmeir
2023-02-12perf(http): remove allocations checking upgrade and connection header values ↵David Sherret
(#17727)
2023-02-12feat(bench): Add JSON reporter for "deno bench" subcommand (#17595)Serhiy Barhamon
2023-02-12perf(ext/ffi): Revert UTF-8 validity check from getCString (#17741)Aapo Alasuutari
2023-02-12fix(ext/flash): Always send correct number of bytes when handling HEAD ↵Kamil Ogórek
requests (#17740) This was not caught in the previous test case, as the response body was smaller than the size of `HEAD` response. This made `nwritten < responseLen` check in `writeFixedResponse` to fail, and not trigger `op_flash_respond_async` as a result. When the response body is larger than the `HEAD` though, as in the updated test case (`HEAD` i 120 bytes, where our response is 300 bytes), it would think that we still have something to send, and effectively panic, as `op_flash_respond` already removed the request from the pool. This change, makes the `handleResponse` function always calculate the number of bytes to transmit when `HEAD` request is encountered. Effectively ignoring `Content-Length` of the body, but still setting it correctly in the request header itself. Fixes https://github.com/denoland/deno/issues/17737
2023-02-11fix(fmt): make fmt options CLI args less verbose (#17550)aryan02420
Make deno fmt options CLI args less verbose #17546
2023-02-11fix(cli/graph_util): don't append referrer info for root module errors (#17730)Nayeem Rahman
2023-02-11feat: add signal option to Deno.resolveDns (#17384)Leo Kettmeir
Closes #14406
2023-02-11feat: add more variants to Deno.build.os (#17340)Leo Kettmeir
Closes #14799
2023-02-11fix(ops): Always close cancel handles for read_async/write_async (#17736)Kamil Ogórek
Fixes https://github.com/denoland/deno/issues/17734
2023-02-11fix(webgpu): use correct op for GPUDevice.createSampler (#17729)Leo Kettmeir
Fixes #17728
2023-02-11docs: fix minor typo in AsyncRefCell comment (#17732)Mike Mulchrone
2023-02-10refactor(ext/http): use `String.prototype.trim()` instead of regex (#17722)Bert Belder
2023-02-10fix(dts): make Deno.Command accept readonly prop in options.args (#17718)Kamil Ogórek
2023-02-10fix(cli/napi): correct name handling in napi property descriptor (#17716)Divy Srivastava
Fixes https://github.com/denoland/deno/issues/17712
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.
2023-02-10feat(install): follow redirects for urls with no path (#17449)Kamil Ogórek
This change makes absolute urls, that contain no path like `deno install https://my-cli.io` to follow redirects and extract the name from it. It allows modifies `test_util` server listener on port `4550` (`REDIRECT_ABSOLUTE_PORT`) to allow for specifying `redirect_to` query param, that fill use that value for it's next redirect. Fixes https://github.com/denoland/deno/issues/17409
2023-02-10fix(cli/napi): handle all property variants in napi_define_properties (#17680)Divy Srivastava
Fixes https://github.com/denoland/deno/issues/17509 This fixes the bug that blocked loading `fsevents` in Deno.
2023-02-10chore: upgrade rusty_v8 to 0.63.0 (#17705)Bartek Iwańczuk
2023-02-10perf(core): speed up promise hook dispatch (#17616)Bert Belder
2023-02-10refactor: allow to provide polyfills for Node modules from the snapshot (#17706)Bartek Iwańczuk
This commit does preparatory work to allow snapshotting Node.js compatibility layer, that currently lives in `std/node`. The logic was changed to allow loading some modules from the snapshot and some from the remote URL. Additionally "module_es_shim.js" that provides exports for "node:module" is now snapshotted.
2023-02-10refactor(permissions): use less space for permissions prompt (#17708)Bartek Iwańczuk
2023-02-09refactor: deno_graph 0.43 upgrade (#17692)David Sherret
2023-02-09refactor(ext/webidl): use `TypedArrayPrototypeGetSymbolToStringTag` (#17602)Kenta Moriuchi
2023-02-09perf: module info cache - avoid MediaType.to_string() allocation (#17699)David Sherret
Micro optimization because these allocations were coming up on a flame graph I was looking at (only 0.28% of total).
2023-02-08perf: disable fetching graph cache info except for `deno info` (#17698)David Sherret
2023-02-08fix: use static Reflect methods in nodeGlobalThis proxy (#17696)Kamil Ogórek
Co-authored-by: David Sherret <dsherret@gmail.com>
2023-02-08refactor: internal runtime code TS support (#17672)Leo Kettmeir
This is a proof of concept for being able to snapshot TypeScript files. Currently only a single runtime file is authored in TypeScript - "runtime/js/01_version.ts". Not needed infrastructure was removed from "core/snapshot_util.rs". --------- Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>