summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2023-05-24chore: upgrade rusty_v8 to 0.72.0 (#19228)Bartek Iwańczuk
This commit updates rusty_v8 to 0.72.0 and by extension V8 to version 11.5.150.1.
2023-05-23fix(ext/node): add basic node:worker_threads support (#19192)Yoshiya Hinosawa
This PR restores `node:worker_threads` implementation and test cases from [`std@0.175.0/node`](https://github.com/denoland/deno_std/blob/0.175.0/node/worker_threads.ts). --------- Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2023-05-23fix: better error message for malformed glob (#19225)Bartek Iwańczuk
Before: ``` $ cargo run -- test "foo/*******/bar.ts" error: Pattern syntax error near position 6: wildcards are either regular `*` or recursive `**` ``` After: ``` $ cargo run -- test "foo/*******/bar.ts" error: Failed to expand glob: "foo/*******/bar.ts" Caused by: Pattern syntax error near position 6: wildcards are either regular `*` or recursive `**` ``` --------- Co-authored-by: David Sherret <dsherret@users.noreply.github.com>
2023-05-23fix(node): duplicate node_module suffixes (#19222)Marvin Hagemeister
Noticed that we're checking more module paths than necessary. In particular the module path array contains a couple of entries with a duplicated `node_modules/node_modules` suffix. ```js [ // ... more entries before here, where some also contain duplicate suffixes "/Users/marvinhagemeister/dev/preact-render-to-string/node_modules/.deno/node_modules", "/Users/marvinhagemeister/dev/preact-render-to-string/node_modules/node_modules", // <-- duplicate suffix "/Users/marvinhagemeister/dev/preact-render-to-string/node_modules", "/Users/marvinhagemeister/dev/node_modules", "/Users/marvinhagemeister/node_modules", "/Users/node_modules", "/node_modules", "/node_modules" // <-- duplicate entry ] ``` This was caused by a misunderstanding in how Rust's [`Path::ends_with()`](https://doc.rust-lang.org/std/path/struct.Path.html#method.ends_with) works. It's designed to match on whole path segments and the suffix `/node_modules` is not that, except for the root entry. This meant that our check for if the path already ended with `node_module` always returned `false`. Removing the leading slash fixes that. While we're at it, we can remove the last condition where we explicitly added the root `/node_modules` entry since the while loop prior to that takes care of it already.
2023-05-23feat: add support for globs in the config file and CLI arguments for files ↵Bartek Iwańczuk
(#19102) Follow up to https://github.com/denoland/deno/pull/19084. This commit adds support for globs in the configuration file as well as CLI arguments for files. With this change users can now use glob syntax for "include" and "exclude" fields, like so: ```json { "lint": { "include": [ "directory/test*.ts", "other_dir/" ], "exclude": [ "other_dir/foo*.ts", "nested/nested2/*" ] }, "test": { "include": [ "data/test*.ts", "nested/", "tests/test[1-9].ts" ], "exclude": [ "nested/foo?.ts", "nested/nested2/*" ] } } ``` Or in CLI args like so: ``` // notice quotes here; these values will be passed to Deno verbatim // and deno will perform glob expansion $ deno fmt --ignore="data/*.ts" $ deno lint "data/**/*.ts" ``` Closes https://github.com/denoland/deno/issues/17971 Closes https://github.com/denoland/deno/issues/6365
2023-05-22feat(lsp): support lockfile and node_modules directory (#19203)David Sherret
This adds support for the lockfile and node_modules directory to the lsp. In the case of the node_modules directory, it is only enabled when explicitly opted into via `"nodeModulesDir": true` in the configuration file. This is to reduce the language server automatically modifying the node_modules directory when the user doesn't want it to. Closes #16510 Closes #16373
2023-05-23refactor: further work on node http client (#19211)Leo Kettmeir
2023-05-22fix(node): make sure "setImmediate" is not clamped to 4ms (#19213)Bartek Iwańczuk
This commit changes implementation of "setImmediate" from "node:timers" module to 0ms timer that is never clamped to 4ms no matter how many nested calls there are. Closes https://github.com/denoland/deno/issues/19034
2023-05-22fix(npm): store npm binary command resolution in lockfile (#19219)David Sherret
Part of #19038 Closes #19034 (eliminates the time spent re-resolving)
2023-05-22chore(cli): One Rust test per JS and Node unit test file (#19199)Matt Mastracci
This runs our `js_unit_tests` and `node_unit_tests` in parallel, one rust test per JS unit test file. Some of our JS tests don't like running in parallel due to port requirements, so this also makes those use a specific port-per-file. This does not attempt to make the node-compat tests work.
2023-05-22fix(runtime): JS debug log to stderr (#19217)David Sherret
Debug logs should all go to stderr.
2023-05-22chore(cli): Don't assume deno is in path for spawn_kill_permissions (#19198)Matt Mastracci
We don't need to use the `deno` command here to test kill permissions and it's awkward to get right without passing `-A`. `cat` works, but for platforms other than windows. This test should have plenty of coverage on other platforms.
2023-05-22docs: be explicit in the unit of time of delay in setTimeout (#19207)Connor Burton
2023-05-22fix(ext/web): improve timers resolution for 0ms timeouts (#19212)Bartek Iwańczuk
This commit changes the implementation of `ext/web` timers, by using "op_void_async_deferred" for timeouts of 0ms. 0ms timeout is meant to be run at the end of the event loop tick and currently Tokio timers that we use to back timeouts have at least 1ms resolution. That means that 0ms timeout actually take >1ms. This commit changes that and runs 0ms timeout at the end of the event loop tick. One consequence is that "unrefing" a 0ms timer will actually keep the event loop alive (which I believe actually makes sense, the test we had only worked because the timeout took more than 1ms). Ref https://github.com/denoland/deno/issues/19034
2023-05-22fix(node): add http.Server.unref() (#19201)Bartek Iwańczuk
Closes https://github.com/denoland/deno/issues/19113
2023-05-21refactor(core): set function names for ops in JavaScript (#19208)Bartek Iwańczuk
This commit ensures that JavaScript functions generated for registered ops have proper names set up - the function name matches the name of the op. A test was added in `core/runtime.rs` that verifies this. Closes https://github.com/denoland/deno/issues/19206
2023-05-21fix(ci): simplify test assertion for http version enforcing with ↵Leo Kettmeir
Deno.createHttpClient (#19210)
2023-05-21chore: add tests for N-API symbol (#19205)Bartek Iwańczuk
2023-05-21feat(unstable): add more options to Deno.createHttpClient (#17385)Leo Kettmeir
2023-05-19chore: add Deno version information to new 1.34 deno.json properties (#19202)David Sherret
These already come up in the auto-complete, so let's let users know what versions these are available in.
2023-05-19feat(vendor): support for npm specifiers (#19186)David Sherret
We never properly added support for this. This fixes vendoring when it has npm or node specifiers. Vendoring occurs by adding a `"nodeModulesDir": true` property to deno.json then it uses a local node_modules directory. This can be opted out by setting `"nodeModulesDir": false` or running with `--node-modules-dir=false`. Closes #18090 Closes #17210 Closes #17619 Closes #16778
2023-05-19feat(ext/http): ref/unref for server (#19197)Matt Mastracci
Add `ref` and `unref` to return value from `Deno.serve`. Unblocks #3326.
2023-05-19Revert "perf: use jemalloc as global allocator (#18957)" (#19187)Bartek Iwańczuk
This reverts commit 798c1ad0f1de80ff0e7196b6140a3f74e31fe111. Reverting because this change caused a spike in memory usage, but we can't fully realise gains from lower GC pressure from more optimal malloc/ free provided by "jemalloc". We might revisit the topic in future.
2023-05-18feat(ext/http): Add support for trailers w/internal API (HTTP/2 only) (#19182)Matt Mastracci
Necessary for #3326. Requested in #10214 as well.
2023-05-19BREAKING(unstable): change return type of Deno.serve() API (#19189)Bartek Iwańczuk
This commit changes the return type of an unstable `Deno.serve()` API to instead return a `Deno.Server` object that has a `finished` field. This change is done in preparation to be able to ref/unref the HTTP server.
2023-05-18feat(runtime): Provide environment-configurable options for tokio parameters ↵Matt Mastracci
(#19173)
2023-05-19feat(compile): remove need for `--unstable` with npm specifiers (#19185)David Sherret
2023-05-18feat(cli): add `nodeModulesDir` option to config file (#19095)David Sherret
This adds an option to disable or enable using a local `node_modules` directory as a project wide setting. https://github.com/denoland/manual/pull/659 Closes #17930
2023-05-18feat(cli): top-level `exclude` field in `deno.json` (#17778)scarf
2023-05-18feat(task): glob expansion (#19084)David Sherret
This adds cross-platform glob expansion to deno task.
2023-05-18fix(npm): run pre and post tasks if present (#19178)Marvin Hagemeister
This PR optionally runs pre and posts tasks from `package.json` if available. Fixes #19157
2023-05-18fix(npm): `process` not defined in readline (#19184)Marvin Hagemeister
Issue was that we create node globals much later, so pulling `process` via a module import is the way to go. Fixes #19183
2023-05-18chore: forward v1.33.4 release commit to main (#19181)denobot
**THIS PR HAS GIT CONFLICTS THAT MUST BE RESOLVED** This is the release commit being forwarded back to main for 1.33.4 Please ensure: - [x] Everything looks ok in the PR - [ ] The release has been published To make edits to this PR: ```shell git fetch upstream forward_v1.33.4 && git checkout -b forward_v1.33.4 upstream/forward_v1.33.4 ``` Don't need this PR? Close it. cc @levex Co-authored-by: levex <levex@users.noreply.github.com> Co-authored-by: Levente Kurusa <lkurusa@kernelstuff.org>
2023-05-18fix(ext/websocket): order of ws writes (#19131)Divy Srivastava
Fixes https://github.com/denoland/deno/issues/19041
2023-05-18refactor(napi): simplify types (#19179)Bartek Iwańczuk
This commit removes "Error" and "Result" structs from "ext/napi". In turn all NAPI functions now return "napi_status" instead of "napi::Result".
2023-05-18fix(ext/webidl): change createPromiseConverter (#16367)Marcos Casagrande
2023-05-18fix(cli/napi): handle finalizers (#19168)Divy Srivastava
Fixes https://github.com/denoland/deno/issues/17325
2023-05-18fix(node): support passing parent stdio streams (#19171)Marvin Hagemeister
This is a bit bare bones but gets `npm-run-all` working. For full stdio compatibility with node more work is needed which is probably better done in follow up PRs. Fixes #19159
2023-05-18fix(napi): BigInt related APIs (#19174)Bartek Iwańczuk
Doesn't make the API bullet-proof and there are some TODOs left, but greatly improves the situation. Tests were ported from Node.js. Closes https://github.com/denoland/deno/issues/18276.
2023-05-18chore: lint server_test.ts (#19175)Bartek Iwańczuk
Somehow this file had `// deno-lint-ignore-file` directive at the top. This commit removes it and fixes all the linter violations.
2023-05-17fix(runtime): Box the main future to avoid blowing up the stack (#19155)Matt Mastracci
This fixes `Unhandled exception at [...] Stack overflow` on Windows, caused by the large size of the main future.
2023-05-17fix(npm): improved optional dependency support (#19135)David Sherret
Note: If the package information has already been cached, then this requires running with `--reload` or for the registry information to be fetched some other way (ex. the cache busting). Closes #15544 --------- Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2023-05-17feat(ext/web): Request higher-resolution timer on Windows if user requests ↵Matt Mastracci
setTimeout w/short delay (#19149) If a timer is requested with <=100ms resolution, request the high-res timer. Since the default Windows timer period is 15ms, this means a 100ms timer could fire at 115ms (15% late). We assume that timers longer than 100ms are a reasonable cutoff here. The high-res timers on Windows are still limited. Unfortuntely this means that our shortest duration 4ms timers can still be 25% late, but without a more complex timer system or spinning on the clock itself, we're somewhat bounded by the OS' scheduler itself.
2023-05-17fix(node): export diagnostics_channel module (#19167)Bartek Iwańczuk
Closes https://github.com/denoland/deno/issues/19166
2023-05-17fix(ext/node): make nodeGlobalThis configurable (#19163)Luca Casonato
2023-05-17fix(ext/node): fix whatwg url formatting (#19146)Yoshiya Hinosawa
2023-05-17fix(node): export punycode module (#19151)Bartek Iwańczuk
Closes https://github.com/denoland/deno/issues/19147
2023-05-17fix(kv): kv.close() interrupts in-flight operations (#19076)Heyang Zhou
Fixes https://github.com/denoland/deno/issues/19049
2023-05-17fix: support "fetch" over HTTPS for IP addresses (#18499)Bartek Iwańczuk
This commit adds support for connecting to IP addresses over HTTPS. This is done by updating "rustls" to "0.21.0" and other related crates. Closes https://github.com/denoland/deno/issues/7660 Closes https://github.com/denoland/deno/issues/17967 --------- Co-authored-by: Divy Srivastava <dj.srivastava23@gmail.com>
2023-05-17refactor(node): reimplement http client (#19122)Leo Kettmeir
This commit reimplements most of "node:http" client APIs using "ext/fetch". There is some duplicated code and two removed Node compat tests that will be fixed in follow up PRs. --------- Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>