1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-22 15:06:54 -05:00
Commit graph

1676 commits

Author SHA1 Message Date
Divy Srivastava
47232f8a41
fix(node): remove use of non existing FunctionPrototypeApply primordial (#21986)
Fixes #21978
2024-01-19 12:01:46 -05:00
Marvin Hagemeister
59f419bf41
fix(node/http): remoteAddress and remotePort not being set (#21998)
<!--
Before submitting a PR, please read https://deno.com/manual/contributing

1. Give the PR a descriptive title.

  Examples of good title:
    - fix(std/http): Fix race condition in server
    - docs(console): Update docstrings
    - feat(doc): Handle nested reexports

  Examples of bad title:
    - fix #7123
    - update docs
    - fix bugs

2. Ensure there is a related issue and it is referenced in the PR text.
3. Ensure there are tests that cover the changes.
4. Ensure `cargo test` passes.
5. Ensure `./tools/format.js` passes without changing files.
6. Ensure `./tools/lint.js` passes.
7. Open as a draft PR if your work is still in progress. The CI won't
run
   all steps, but you can add '[ci]' to a commit message to force it to.
8. If you would like to run the benchmarks on the CI, add the 'ci-bench'
label.
-->

Ultimately, it came down to using incorrect property names in the
`FakeSocket` constructor. The values are passed under `remoteAddress`,
not `hostname` and `remotePort` instead of `port`.

Fixes https://github.com/denoland/deno/issues/21980
2024-01-19 13:09:37 +01:00
Bartek Iwańczuk
4e3aff8400
chore: upgrade deno_core to 0.247.0 (#21974) 2024-01-18 17:57:22 +01:00
Divy Srivastava
66ff28c21e
fix(node): update req.socket on WS upgrade (#21984)
Update the `req.socket` to be a `net.Socket` from `FakeSocket`

Fixes #21979
2024-01-18 22:24:02 +05:30
Matt Mastracci
971eb0e5e8
chore: bump rustls-tokio-stream and rustls (#21955) 2024-01-16 21:51:54 +01:00
Matt Mastracci
3ff80eb152
chore(ext/cache): remove CachePutResource in preparation for resource rewrite (#21949)
We can use `resourceForReadableStream` to ensure that cached resources
are implemented more efficiently and remove one more resource special
case.
2024-01-15 13:14:54 -07:00
Bartek Iwańczuk
5143b9e7d3
feat(unstable): add Temporal API support (#21738)
This commit adds support for [Stage 3 Temporal API
proposal](https://tc39.es/proposal-temporal/docs/).

The API is available when `--unstable-temporal` flag is passed.

---------

Signed-off-by: Bartek Iwańczuk <biwanczuk@gmail.com>
Co-authored-by: David Sherret <dsherret@gmail.com>
Co-authored-by: Kenta Moriuchi <moriken@kimamass.com>
2024-01-15 01:26:57 +01:00
Bartek Iwańczuk
fc17ddbcc4
feat: Stabilize Deno.connect for 'unix' transport (#21937) 2024-01-14 21:50:58 +00:00
Bartek Iwańczuk
f3bb0a1a0e
feat: stabilize Deno.connectTls options and Deno.TlsConn.handshake (#21889) 2024-01-14 17:06:26 +00:00
Bartek Iwańczuk
c2127a86cb
feat: stabilize Deno.Conn.ref/unref (#21890) 2024-01-14 17:04:33 +00:00
denobot
248fb9c946
chore: forward v1.39.4 release commit to main (#21933)
Co-authored-by: David Sherret <dsherret@gmail.com>
2024-01-13 20:32:50 -05:00
Bartek Iwańczuk
7471587d29
feat: "rejectionhandled" Web event and "rejectionHandled" Node event (#21875)
This commit adds support for "rejectionhandled" Web Event and
"rejectionHandled" Node event.

```js
import process from "node:process";

process.on("rejectionHandled", (promise) => {
  console.log("rejectionHandled", reason, promise);
});

window.addEventListener("rejectionhandled", (event) => {
  console.log("rejectionhandled", event.reason, event.promise);
});
```

---------

Co-authored-by: Matt Mastracci <matthew@mastracci.com>
2024-01-12 22:10:42 +00:00
Bartek Iwańczuk
288774c5ed
chore: forward v1.39.3 to main (#21915)
Co-authored-by: denobot <33910674+denobot@users.noreply.github.com>
Co-authored-by: bartlomieju <bartlomieju@users.noreply.github.com>
2024-01-12 19:13:18 +00:00
Leo Kettmeir
4122c8f164
fix: add EventSource typings (#21908)
Fixes #21691
2024-01-12 13:28:54 +00:00
Kenta Moriuchi
515a34b4de
refactor: use core.ensureFastOps() (#21888) 2024-01-10 15:37:25 -07:00
cions
881a62869d
fix: android support (#19437)
<!--
Before submitting a PR, please read https://deno.com/manual/contributing

1. Give the PR a descriptive title.

  Examples of good title:
    - fix(std/http): Fix race condition in server
    - docs(console): Update docstrings
    - feat(doc): Handle nested reexports

  Examples of bad title:
    - fix #7123
    - update docs
    - fix bugs

2. Ensure there is a related issue and it is referenced in the PR text.
3. Ensure there are tests that cover the changes.
4. Ensure `cargo test` passes.
5. Ensure `./tools/format.js` passes without changing files.
6. Ensure `./tools/lint.js` passes.
7. Open as a draft PR if your work is still in progress. The CI won't
run
   all steps, but you can add '[ci]' to a commit message to force it to.
8. If you would like to run the benchmarks on the CI, add the 'ci-bench'
label.
-->

---------

Signed-off-by: Matt Mastracci <matthew@mastracci.com>
Co-authored-by: Matt Mastracci <matthew@mastracci.com>
2024-01-10 06:04:14 -07:00
Bartek Iwańczuk
cd43d2b877
chore: upgrade deno_core to 0.244.0 (#21859) 2024-01-09 17:25:10 +01:00
Divy Srivastava
6db631a432
fix(ext/websocket): pass on uncaught errors in idleTimeout (#21846)
Fixes https://github.com/denoland/deno/issues/21840

The problem was hard to reproduce as its a race condition. I've added a
test that reproduces the problem 1/10 tries. We should move the
idleTimeout handling to Rust (maybe even built into fastwebsocket).
2024-01-09 19:56:54 +05:30
Asher Gomez
19c10c0246
chore: cleanup readAll() logic (#21862) 2024-01-09 13:53:28 +01:00
Marvin Hagemeister
040fdeec0b
fix: cjs export rewritten to invalid identifier (#21853)
<!--
Before submitting a PR, please read https://deno.com/manual/contributing

1. Give the PR a descriptive title.

  Examples of good title:
    - fix(std/http): Fix race condition in server
    - docs(console): Update docstrings
    - feat(doc): Handle nested reexports

  Examples of bad title:
    - fix #7123
    - update docs
    - fix bugs

2. Ensure there is a related issue and it is referenced in the PR text.
3. Ensure there are tests that cover the changes.
4. Ensure `cargo test` passes.
5. Ensure `./tools/format.js` passes without changing files.
6. Ensure `./tools/lint.js` passes.
7. Open as a draft PR if your work is still in progress. The CI won't
run
   all steps, but you can add '[ci]' to a commit message to force it to.
8. If you would like to run the benchmarks on the CI, add the 'ci-bench'
label.
-->

Fixes https://github.com/denoland/deno/issues/21836
2024-01-08 17:50:52 +00:00
Asher Gomez
664ffe2ad0
chore(ext/io): cleanup unused functions (#21844)
These functions don't appear to be used anywhere.
2024-01-08 14:04:11 +01:00
Kenta Moriuchi
c2c115ebd8
fix(ext): enable prefer-primordials for internal TypeScript (#21813)
Enabled prefer-primordials lint for ext/cron and ext/kv.
2024-01-07 23:20:02 +01:00
Bartek Iwańczuk
d1706c2ac9
refactor: split runtime/98_global_scope.js (#21785) 2024-01-06 14:40:26 +01:00
Divy Srivastava
bfd5f1598c
feat(ext/crypto): initial support for p521 in generateKey and importKey (#21815)
Part 1 of a potential 3 part series. Ref #13449 

The current implementation passes key material back and forth RustCrypto
group of crates and ring. ring does not implement p521 yet.

This PR adds support for P521 named curve in `generateKey` and
`importKey` where we use RustCrypto. Other parts should be moved over to
the RustGroup group of crates for consistency.
2024-01-06 16:48:31 +05:30
Divy Srivastava
dac9b6ab43
fix(ext/node): add WriteStream.isTTY (#21801) 2024-01-05 22:37:14 +01:00
Kenta Moriuchi
e7e25db24f
chore: update deno_lint for CI (#21802) 2024-01-05 15:03:06 +00:00
Divy Srivastava
9f86705fa6
chore(ext/webgpu): include GPUCanvasContext in snapshot (#21773)
Part 1 of #21713 

Changes:

- Remove `.present()` and add a `presentGPUCanvasContext` (not exposed
yet to users)
- Move lazy load logic to `00_init.js`. This can be used to use webgpu
on-demand from future code (OffScreenCanvas)
2024-01-05 19:55:01 +05:30
Divy Srivastava
611993fbe0
fix(ci): update copright year for _fs_cp.js (#21803) 2024-01-05 13:43:56 +00:00
Divy Srivastava
df062d2c78
fix(ext/node): add fs.cp, fs.cpSync, promises.cp (#21745)
Fixes https://github.com/denoland/deno/issues/20803
Fixes https://github.com/denoland/deno/issues/21723

Performance: copying a 48GiB rust `target` folder (recursive)
| Platform  | `deno` | `node v21.5` | Improvement |
| -------- | ------- | ------- | ------- |
| macOS (APFS) |   3.1secs  |  127.99 secs |  **42x** |
| Windows | 18.3secs | 67.2secs |  **3.8x** |

Copying files with varying sizes:


![image](https://github.com/denoland/deno/assets/34997667/58932652-6f7a-47f5-8504-896dc9ab4ddc)
2024-01-05 18:28:33 +05:30
Bartek Iwańczuk
aadcd64065
chore: forward v1.39.2 release commit to main (#21793) 2024-01-04 23:52:17 +00:00
Kenta Moriuchi
b2cd254c35
fix: strict type check for cross realms (#21669)
Deno v1.39 introduces `vm.runInNewContext`. This may cause problems when
using `Object.prototype.isPrototypeOf` to check built-in types.

```js
import vm from "node:vm";

const err = new Error();
const crossErr = vm.runInNewContext(`new Error()`);

console.assert( !(crossErr instanceof Error) );
console.assert( Object.getPrototypeOf(err) !== Object.getPrototypeOf(crossErr) );
```

This PR changes to check using internal slots solves them.

---

current: 

```
> import vm from "node:vm";
undefined
> vm.runInNewContext(`new Error("message")`)
Error {}
> vm.runInNewContext(`new Date("2018-12-10T02:26:59.002Z")`)
Date {}
```

this PR:

```
> import vm from "node:vm";
undefined
> vm.runInNewContext(`new Error("message")`)
Error: message
    at <anonymous>:1:1
> vm.runInNewContext(`new Date("2018-12-10T02:26:59.002Z")`)
2018-12-10T02:26:59.002Z
```

---------

Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2024-01-04 09:42:38 +05:30
Divy Srivastava
ad65440092
fix(ext/node): UdpSocket ref and unref (#21777) 2024-01-04 08:51:39 +05:30
Jovi De Croock
f5ad15b504
fix(node/zlib): accept dataview and buffer in zlib bindings (#21756)
Fixes #20516 
Follow up to #21747 and #21746

This tackles the last point of #20516 where certain inputs weren't
accepted in the other zlib methods

This adds the `toU8` conversion of `_brotli` to `_zlib.mjs`, when we
create the ZLibBuffer, we'll sanitize the input. I noticed that the
async had no handler for `string` input so I added that as well.
2024-01-03 19:03:51 +05:30
Divy Srivastava
60403faaf3
fix(ext/node): use node:process in _streams.mjs (#21755)
Fixes https://github.com/denoland/deno/issues/21644

`next build` works:
```
~/gh/deno/target/debug/deno run -A --unstable-byonm ./node_modules/.bin/next build
Warning: Not implemented: process.on("rejectionHandled")
   ▲ Next.js 14.0.4

 ✓ Creating an optimized production build
 ✓ Compiled successfully
 ✓ Linting and checking validity of types
   Collecting page data  ..Warning: Not implemented: process.on("rejectionHandled")
Warning: Not implemented: process.on("rejectionHandled")
Warning: Not implemented: process.on("rejectionHandled")
Warning: Not implemented: process.on("rejectionHandled")
Warning: Not implemented: process.on("rejectionHandled")
 ✓ Collecting page data
   Generating static pages (0/5)  [    ]Warning: Not implemented: process.on("rejectionHandled")
Warning: Not implemented: process.on("rejectionHandled")
Warning: Not implemented: process.on("rejectionHandled")
Warning: Not implemented: process.on("rejectionHandled")
Warning: Not implemented: process.on("rejectionHandled")
 ✓ Generating static pages (5/5)
 ✓ Collecting build traces
 ✓ Finalizing page optimization

Route (app)                              Size     First Load JS
┌ ○ /                                    5.32 kB        87.4 kB
└ ○ /_not-found                          875 B            83 kB
+ First Load JS shared by all            82.1 kB
  ├ chunks/938-5e061ba0d46125b1.js       26.8 kB
  ├ chunks/fd9d1056-735d320b4b8745cb.js  53.5 kB
  ├ chunks/main-app-2945f337109ea73c.js  220 B
  └ chunks/webpack-e3c6517d4ab8d680.js   1.68 kB


○  (Static)  prerendered as static content
```
2024-01-02 19:08:05 +01:00
Divy Srivastava
9f7586a206
fix(ext/node): implement os.machine (#21751) 2024-01-02 14:57:54 +01:00
Divy Srivastava
8e4feacd25
fix(ext/http): use arraybuffer binaryType for server websocket (#21741)
Ref
https://github.com/denoland/deno/issues/15340#issuecomment-1872353134
2024-01-02 10:30:09 +05:30
Divy Srivastava
642c4a44a5
fix(ext/node): querystring stringify without encode callback (#21740)
Fixes https://github.com/denoland/deno/issues/21734

Changes:
- Use default encode when options do not provide a encode callback.
- Remove internal TS for `node:querystring`. Its not helping catching
bugs like this because of invalid type assumptions and use of `any`,
more of a maintenance burden.
2024-01-02 04:54:11 +00:00
林炳权
96b581bdd2
chore: update to Rust 1.75 (#21731) 2024-01-01 23:22:48 +01:00
David Sherret
7e72f3af61
chore: update copyright to 2024 (#21753) 2024-01-01 19:58:21 +00:00
Raashid Anwar
8ba828b41e
fix(http_client): Fix Deno.createHttpClient to accept poolIdleTimeout parameter (#21603)
Fixed the bug `Deno.createHttpClient` to accept `poolIdleTimeout` parameter.

Fixes https://github.com/denoland/deno/issues/21546
2023-12-31 12:45:12 +00:00
Jovi De Croock
4339a6c55d
fix(node/zlib): consistently return buffer (#21747)
This fixes point 3 of https://github.com/denoland/deno/issues/20516

This PR creates consistency between the sync and async versions of the
brotli compress where we will always return a buffer like Node.
2023-12-31 17:23:09 +05:30
Jovi De Croock
08fc8d50e3
fix(node/zlib): cast Dataview and Buffer to uint8 (#21746)
This fixes point 2 of #20516 

This adds a conversion from Dataview/Buffer by returning `obj.buffer`
which can be converted to a `UInt8Array`.

Question: Regarding point 4 of the mentioned issue would it be
appropriate to copy the toU8 helper to the `zlib.mjs` methods?
2023-12-31 17:20:37 +05:30
Divy Srivastava
3db9c8742d
fix(ext/node): add process.abort() (#21742) 2023-12-30 20:30:55 +05:30
Divy Srivastava
a7b21760fc
chore(runtime): internalize pipe fd for ext/node (#21570)
Signed-off-by: Divy Srivastava <dj.srivastava23@gmail.com>
2023-12-30 05:32:30 +00:00
Bartek Iwańczuk
1dd1aba244
fix(node): support nested tests in "node:test" (#21717)
Closes https://github.com/denoland/deno/issues/21679
2023-12-29 16:18:08 +01:00
Bartek Iwańczuk
f85d65e066
chore: update deno_core to 0.240.0 (#21726) 2023-12-28 19:30:07 +00:00
Divy Srivastava
c08319262a
fix(node): Implement os.cpus() (#21697)
Fixes https://github.com/denoland/deno/issues/21666

Zero added dependency and tries to match the libuv implementation
2023-12-28 09:08:50 +05:30
Bartek Iwańczuk
c2414db1f6
refactor: simplify hyper, http, h2 deps (#21715)
Main change is that:
- "hyper" has been renamed to "hyper_v014" to signal that it's legacy
- "hyper1" has been renamed to "hyper" and should be the default
2023-12-27 11:59:57 -05:00
Bartek Iwańczuk
33acd437f5
refactor: finish test_util server cleanup, simplify dependencies (#21714)
Closes https://github.com/denoland/deno/issues/21578
2023-12-27 14:38:44 +01:00
Lino Le Van
d5f6e271ff
fix(ext/node): Implement aes-192-ecb and aes-256-ecb (#21710) 2023-12-27 17:24:52 +05:30