summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2023-08-09refactor(ext/fetch): Remove FetchRequestBodyResource from FetchHandler ↵Matt Mastracci
interface (#20100) This is unused and will allow us to remove `FetchRequestBodyResource` in a future PR.
2023-08-08chore: rename some helpers on the Fs trait (#20097)Luca Casonato
Rename some of the helper methods on the Fs trait to be suffixed with `_sync` / `_async`, in preparation of the introduction of more async methods for some helpers. Also adds a `read_text_file_async` helper to complement the renamed `read_text_file_sync` helper.
2023-08-08refactor(cli): move `snapshot_from_lockfile` function to `deno_npm` (#20024)Yusuke Tanaka
This commit moves `snapshot_from_lockfile` function to [deno_npm crate](https://github.com/denoland/deno_npm). This allows this function to be called outside Deno CLI (in particular, Deno Deploy).
2023-08-08refactor: use deno_cache_dir crate (#20092)David Sherret
Uses https://github.com/denoland/deno_cache/pull/26
2023-08-08fix(fmt): do not insert expr stmt leading semi-colon in do while stmt body ↵David Sherret
(#20093) This is for when semiColons: false Closes #20089
2023-08-08fix(ext/abort): trigger AbortSignal events in correct order (#20095)Marcos Casagrande
This PR ensures that the original signal event is fired before any dependent signal events. --- The enabled tests fail on `main`: ``` assert_array_equals: Abort events fired in correct order expected property 0 to be "original-aborted" but got "clone-aborted" (expected array ["original-aborted", "clone-aborted"] got ["clone-aborted", "original-aborted"]) ```
2023-08-08build: remove redundant rerun-if-changed for compiler snapshot (#20094)Nayeem Rahman
Not sure why `40_testing.js` is there. The other two `00_typescript.js` and `99_main_compiler.js` should be covered by `files_loaded_during_snapshot` at the end. This helps with `__runtime_js_sources` wrt changing `40_testing.js`.
2023-08-06feat(unstable): rename `deno_modules` to `vendor` (#20065)David Sherret
Renames the unstable `deno_modules` directory and corresponding settings to `vendor` after feedback. Also causes the vendoring of the `node_modules` directory which can be disabled via `--node-modules-dir=false` or `"nodeModulesDir": false`.
2023-08-06fix(unstable): vendor cache should support adding files to hashed ↵David Sherret
directories (#20070) This changes the design of the manifest.json file to have a separate "folders" map for mapping hashed directories. This allows, for example, to add files in a folder like `http_localhost_8000/#testing_5de71/` and have them be resolved automatically as long as their remaining components are identity-mappable to the file system (not hashed). It also saves space in the manifest.json file by only including the hashed directory instead of each descendant file. ``` // manifest.json { "folders": { "https://localhost/NOT_MAPPABLE/": "localhost/#not_mappable_5cefgh" }, "modules": { "https://localhost/folder/file": { "headers": { "content-type": "application/javascript" } }, } } // folder structure localhost - folder - #file_2defn (note: I've made up the hashes in these examples) - #not_mappable_5cefgh - mod.ts - etc.ts - more_files.ts ```
2023-08-06build: allow disabling snapshots for dev (#20048)Nayeem Rahman
Closes #19399 (running without snapshots at all was suggested as an alternative solution). Adds a `__runtime_js_sources` pseudo-private feature to load extension JS sources at runtime for faster development, instead of building and loading snapshots or embedding sources in the binary. Will only work in a development environment obviously. Try running `cargo test --features __runtime_js_sources integration::node_unit_tests::os_test`. Then break some behaviour in `ext/node/polyfills/os.ts` e.g. make `function cpus() {}` return an empty array, and run it again. Fix and then run again. No more build time in between.
2023-08-05refactor: remove snapshot_module_load_cb (#20043)Nayeem Rahman
2023-08-05chore: use zlib-ng for flate2 (#20059)Matt Mastracci
Extracted from PR #16011
2023-08-05chore(wpt): expose gc (#20060)Marcos Casagrande
This PR exposes garbage collector for WPT see: https://github.com/web-platform-tests/wpt/blob/3d80f7e87928e2d0da25d1c60a13dab001332139/common/gc.js#L34-L36 ``` /streams/readable-streams/garbage-collection.any.html test stderr: Tests are running without the ability to do manual garbage collection. They will still work, but coverage will be suboptimal. Tests are running without the ability to do manual garbage collection. They will still work, but coverage will be suboptimal. Tests are running without the ability to do manual garbage collection. They will still work, but coverage will be suboptimal. Tests are running without the ability to do manual garbage collection. They will still work, but coverage will be suboptimal. file result: ok. 4 passed; 0 failed; 0 expected failure; total 4 (255ms) ---------------------------------------- /streams/readable-streams/garbage-collection.any.worker.html test stderr: Tests are running without the ability to do manual garbage collection. They will still work, but coverage will be suboptimal. Tests are running without the ability to do manual garbage collection. They will still work, but coverage will be suboptimal. Tests are running without the ability to do manual garbage collection. They will still work, but coverage will be suboptimal. Tests are running without the ability to do manual garbage collection. They will still work, but coverage will be suboptimal. file result: ok. 4 passed; 0 failed; 0 expected failure; total 4 (277ms) ``` This PR removes that warning and improves coverage.
2023-08-05fix(unstable): vendor cache override should handle forbidden windows ↵David Sherret
directory names (#20069) Meant to do this earlier.
2023-08-04fix(ext/http): serveHttp brotli compression level should be fastest (#20058)Matt Mastracci
Use brotli's fastest mode rather than default mode
2023-08-04chore(cargo): update async-compression/flate2/miniz to latest (#20049)Luca Bruno
This bumps `async-compression` dependency in `deno_http` to latest, in order to avoid having multiple duplicate versions. Related, it also unpin a stale `flate2` dependency so that the whole chain of `async-compression` -> `flate2` -> `miniz_oxide` can surface up to current versions. The lockfile entries for all of the above crates have been update accordingly; the new tree of dependencies looks like this: ``` $ cargo tree -i -p miniz_oxide miniz_oxide v0.7.1 └── flate2 v1.0.26 └── async-compression v0.4.1 ```
2023-08-04fix(ext/http): unify default gzip compression level (#20050)Luca Bruno
This tweaks the HTTP response-writer in order to align the two possible execution flows into using the same gzip default compression level, that is `1` (otherwise the implicit default level is `6`).
2023-08-04fix(test): make test runner work when global setTimeout is replaced (#20052)Yoshiya Hinosawa
2023-08-04fix(node): polyfill process.title (#20044)Bartek Iwańczuk
Closes https://github.com/denoland/deno/issues/19777
2023-08-04fix(node): repl._builtinLibs (#20046)Bartek Iwańczuk
Ref https://github.com/denoland/deno/issues/19733
2023-08-04fix(ext/file): resolve unresolved Promise in Blob.stream (#20039)Marcos Casagrande
This PR fixes some crashing WPT tests due to an unresolved promise. --- This could be a [stream spec](https://streams.spec.whatwg.org) bug When `controller.close` is called on a byob stream, there's no cleanup of pending `readIntoRequests`. The only cleanup of pending `readIntoRequests` happen when `.byobRequest.respond(0)` is called, it happens here:https://github.com/denoland/deno/blob/6ba245fe2570b29e35a4fd296a196a58870b1e3c/ext/web/06_streams.js#L2026 which ends up calling `readIntoRequest.closeSteps(chunk);` in https://github.com/denoland/deno/blob/6ba245fe2570b29e35a4fd296a196a58870b1e3c/ext/web/06_streams.js#L2070 To reproduce: ```js async function byobRead() { const input = [new Uint8Array([8, 241, 48, 123, 151])]; const stream = new ReadableStream({ type: "bytes", async pull(controller) { if(input.length === 0) { controller.close(); // controller.byobRequest.respond(0); // uncomment for fix return } controller.enqueue(input.shift()) }, }); const reader = stream.getReader({ mode: 'byob' }); const r1 = await reader.read(new Uint8Array(64)); console.log(r1); const r2 = await reader.read(new Uint8Array(64)); console.log(r2); } await byobRead(); ``` Running the script triggers: ``` error: Top-level await promise never resolved ```
2023-08-04fix(test): use only a single timeout for op sanitizers (#20042)Bartek Iwańczuk
Chipping away at making tests faster. Appears we don't need double timeout before sanitizing ops. This should cut baseline cost of running a test by half.
2023-08-03refactor: rewrite http_next ops to use op2 macro (#19934)Bartek Iwańczuk
Ref #19915 --------- Co-authored-by: Matt Mastracci <matthew@mastracci.com>
2023-08-03refactor(ext/fetch): refactor fetch to use new write_error method (#20029)Matt Mastracci
This is a prerequisite for fast streams work -- this particular resource used a custom `mpsc`-style stream, and this work will allow us to unify it with the streams in `ext/http` in time. Instead of using Option as an internal semaphore for "correctly completed EOF", we allow code to propagate errors into the channel which can be picked up by downstream sinks like Hyper. EOF is signalled using a more standard sender drop.
2023-08-03chore: fix pty support on Macs (#20037)Matt Mastracci
Many of the CI tests have been failing on my M2 Pro mac (Ventura 13.4) when running inside of a vscode terminal (a strange `ENOTTY` error). This modifies the pty-handling code to use libc directly rather than the older pty library that appears mostly unmaintained (outside of @littledivy's fork). As a bonus, this should allow us to run pty tests on the mac CI runner. After this PR, the tests now complete with 100% success on my local machine. Before this PR, I needed to pass `CI=true` to get my local test suite to pass.
2023-08-031.36.0 (#20036)denobot
Co-authored-by: bartlomieju <bartlomieju@users.noreply.github.com>
2023-08-03feat(permissions): add "--deny-*" flags (#19070)Asher Gomez
This commit adds new "--deny-*" permission flags. These are complimentary to "--allow-*" flags. These flags can be used to restrict access to certain resources, even if they were granted using "--allow-*" flags or the "--allow-all" ("-A") flag. Eg. specifying "--allow-read --deny-read" will result in a permission error, while "--allow-read --deny-read=/etc" will allow read access to all FS but the "/etc" directory. Runtime permissions APIs ("Deno.permissions") were adjusted as well, mainly by adding, a new "PermissionStatus.partial" field. This field denotes that while permission might be granted to requested resource, it's only partial (ie. a "--deny-*" flag was specified that excludes some of the requested resources). Eg. specifying "--allow-read=foo/ --deny-read=foo/bar" and then querying for permissions like "Deno.permissions.query({ name: "read", path: "foo/" })" will return "PermissionStatus { state: "granted", onchange: null, partial: true }", denoting that some of the subpaths don't have read access. Closes #18804. --------- Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com> Co-authored-by: Nayeem Rahman <nayeemrmn99@gmail.com>
2023-08-02refactor: use '--reporter' and '--junit-path' flags for 'deno test' (#20031)Bartek Iwańczuk
This commit adds "--reporter" and "--junit-path" flags to "deno test" subcommand instead of using "--dot" and "--junit" flags.
2023-08-02feat(unstable/lsp): support navigating to deno_modules folder (#20030)David Sherret
Closes #20015 Closes https://github.com/denoland/vscode_deno/issues/850 (only for deno_modules, but I don't think this will be possible for the global cache)
2023-08-02fix(repl): highlight from ident in import from or export from (#20023)await-ovo
2023-08-02feat(cli): Add dot test reporter (#19804)Bartek Iwańczuk
This commit adds a "dot" reporter to "deno test" subcommand, that can be activated using "--dot" flag. It provides a concise output using: - "." for passing test - "," for ignored test - "!" for failing test User output is silenced and not printed to the console. In non-TTY environments each result is printed on a separate line.
2023-08-02fix(node): node:test reports correct location (#20025)Bartek Iwańczuk
Also removed some noisy output that caused test flakiness.
2023-08-02fix(bench): iter/s calculation (#20016)Bartek Iwańczuk
Ref https://github.com/denoland/deno/pull/19994#discussion_r1281267606 Ref https://github.com/denoland/deno/pull/19994#discussion_r1281243602
2023-08-02fix: make "suggest.autoImports" to switch completions from external modules ↵Kyoh
(#19845)
2023-08-02fix: regression in workers using dynamic imports (#20006)Bartek Iwańczuk
Closes https://github.com/denoland/deno/issues/19903
2023-08-02feat(unstable): optional `deno_modules` directory (#19977)David Sherret
Closes #15633
2023-08-01feat(bench): print iter/s in the report (#19994)Bartek Iwańczuk
This commit adds "iter/s" column to the console report generated by "deno bench" subcommand.
2023-08-01fix(ext/node): fix import json using npm specifier (#19723)await-ovo
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-08-01feat(npm): support running non-bin scripts in npm pkgs via `deno run` (#19975)David Sherret
Closes https://github.com/denoland/deno/issues/19967
2023-08-01chore: fix windows clippy errors (#20014)David Sherret
2023-08-01ci: lint on all operating systems (#20012)David Sherret
2023-08-01refactor(runtime): use new fd methods from resource table (#20010)Matt Mastracci
Prereq for fast streams work. No longer need `#[cfg]` around `backing_fd`.
2023-08-01fix(test): request cloning should throw if body stream is locked (#19990)Felipe Baltor
Follow-up from #19869.
2023-08-01fix: deno diagnostic - clarify where to put triple-slash directive (#20009)David Sherret
Some people might not know what "entrypoint" means or where to put the triple-slash directive.
2023-08-01fix: retry module download once if server errored (#17252)Bartek Iwańczuk
Closes https://github.com/denoland/deno/issues/17251 Closes #19970 This commits adds logic to retry failed module downloads once. Both request and server errors are handled and the retry is done after 50 ms wait time.
2023-07-31chore: make LSP test less prone to changes (#20003)Bartek Iwańczuk
This test was getting changed often, I modified it a bit so it's less sensitive to changes in declaration files.
2023-07-31fix: call setIsTrusted for generated events (MessageEvent) (#19919)Ricardo Iván Vieitez Parra
This addresses issue #19918. ## Issue description Event messages have the wrong isTrusted value when they are not triggered by user interaction, which differs from the browser. In particular, all MessageEvents created by Deno have isTrusted set to false, even though it should be true. This is my first ever contribution to Deno, so I might be missing something.
2023-07-31feat(node/os): implement getPriority, setPriority & userInfo (#19370)Leo Kettmeir
Takes #4202 over Closes #17850 --------- Co-authored-by: ecyrbe <ecyrbe@gmail.com>
2023-07-31perf: faster node globals access in cjs (#19997)Luca Casonato
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>