0
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-10-31 09:14:20 -04:00
Commit graph

753 commits

Author SHA1 Message Date
Jakub Łabor
7c3df66be7
feat(core): Reorder extension initialization (#16136) 2022-10-07 14:38:06 +02:00
denobot
afeacb8328
chore: forward v1.26.1 release commit to main (#16178)
This is the release commit being forwarded back to main for 1.26.1

Please ensure:
- [x] Everything looks ok in the PR
- [x] The release has been published

To make edits to this PR:
```shell
git fetch upstream forward_v1.26.1 && git checkout -b forward_v1.26.1 upstream/forward_v1.26.1
```

Don't need this PR? Close it.

cc @cjihrig

Co-authored-by: cjihrig <cjihrig@users.noreply.github.com>
2022-10-06 16:49:40 -04:00
Divy Srivastava
0b016a7fb8
feat(npm): implement Node API (#13633)
This PR implements the NAPI for loading native modules into Deno. 

Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
Co-authored-by: DjDeveloper <43033058+DjDeveloperr@users.noreply.github.com>
Co-authored-by: Ryan Dahl <ry@tinyclouds.org>
2022-10-05 19:36:44 +05:30
Satya Rohith
eacd6a7f29
chore(ext/cache): make helper functions public (#16117) 2022-10-03 10:52:54 +05:30
Luca Casonato
20c7300412
refactor(ext/http): remove op_http_read (#16096)
We can use Resource::read_return & op_read instead. This allows HTTP
request bodies to participate in FastStream.

To make this work, `readableStreamForRid` required a change to allow non
auto-closing resources to be handled. This required some minor changes
in our FastStream paths in ext/http and ext/flash.
2022-09-30 07:54:12 +02:00
Luca Casonato
38f544538b
fix(runtime): no FastStream for unrefable streams (#16095) 2022-09-30 00:42:33 +02:00
Yoshiya Hinosawa
15ea624790
refactor(cli): use shared sys kind parser in flags.rs (#16087) 2022-09-29 19:34:16 +09:00
TrickyPi
37887d4a1f
fix: move Deno.hostname() from denoNsUnstable to denoNs (#16086) 2022-09-29 12:15:35 +02:00
denobot
d8827514ff
1.26.0
Co-authored-by: bartlomieju <bartlomieju@users.noreply.github.com>
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2022-09-29 00:10:44 +02:00
Bartek Iwańczuk
b8e3f4c71d
feat: Stabilize Deno.hostname() API (#15932) 2022-09-28 15:36:06 +02:00
Luca Casonato
70bc0eb72b
feat(unstable): Deno.setRaw -> Deno.stdin.setRaw (#15797)
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2022-09-28 15:03:56 +02:00
Yoshiya Hinosawa
fa9e7aab6d
feat: add --allow-sys permission flag (#16028) 2022-09-28 21:46:50 +09:00
Satya Rohith
b312279e58
feat: implement Web Cache API (#15829) 2022-09-28 17:41:12 +05:30
Bartek Iwańczuk
1156f726a9
refactor(runtime): don't use destructuring assignment in JS code (#16050) 2022-09-28 12:28:38 +02:00
Bartek Iwańczuk
212b7dd6da
feat: Add requesting API name to permission prompt (#15936)
Co-authored-by: Leo Kettmeir <crowlkats@toaxl.com>
2022-09-27 22:36:33 +02:00
Bartek Iwańczuk
a344368603
feat: Stabilize Deno.refTimer() and Deno.unrefTimer() APIs (#16036) 2022-09-27 22:11:11 +02:00
Yoshiya Hinosawa
f3dd13730c
fix(runtime): refresh perm prompt 3 lines instead of 4 (#16049) 2022-09-27 18:07:49 +09:00
Divy Srivastava
72af1496d9
perf: use fast ops for tty (#15976) 2022-09-23 09:35:45 +05:30
David Sherret
1b04ff0782
chore: forward v1.25.4 release commit to main (#16001) 2022-09-22 15:58:43 -04:00
David Sherret
a43e9bebeb
chore: fix recent windows only clippy issues (#15993) 2022-09-22 10:33:52 -04:00
Bartek Iwańczuk
b20431c5f9
feat: Refresh interactive permission prompt (#15907)
Co-authored-by: David Sherret <dsherret@users.noreply.github.com>
2022-09-22 14:16:06 +02:00
Divy Srivastava
698a340ad7
perf: fs optimizations - part 1 (#15873) 2022-09-22 14:39:25 +05:30
Yoshiya Hinosawa
cc32a297da
fix(runtime): better error message with Deno.env.get/set (#15966) 2022-09-21 15:18:58 +09:00
Ben Noordhuis
79aee3668d
chore(runtime): upgrade netif crate (#15867)
v0.1.3 contains code that will stop working with newer versions of
libstd because the layout of some std::net types changed.

Refs: https://github.com/bnoordhuis/netif/pull/10
2022-09-19 14:12:03 -04:00
David Sherret
1464b756a4
refactor: move out test files from root testdata directory into sub directories (#15949) 2022-09-19 10:32:21 -04:00
Ben Noordhuis
b1b418b81a
chore: fix clippy warnings (#15944)
Stop allowing clippy::derive-partial-eq-without-eq and fix warnings
about deriving PartialEq without also deriving Eq.

In one case I removed the PartialEq because it a) wasn't necessary,
and b) sketchy because it was comparing floating point numbers.

IMO, that's a good argument for enforcing the lint rule, because it
would most likely have been caught during review if it had been enabled.
2022-09-19 10:25:03 +02:00
Divy Srivastava
6154188786
perf(ext/console): avoid wrapConsole when not inspecting (#15931) 2022-09-17 15:34:43 +05:30
Ryan Dahl
684841a18c
upgrade deps (#15914) 2022-09-16 19:11:30 -04:00
Nayeem Rahman
38280990da
fix(runtime): fix permission status cache keys (#15899) 2022-09-16 20:46:38 +09:00
Colin Ihrig
ee208c1b20
chore: forward v1.25.3 release commit to main (#15919)
Co-authored-by: denobot <33910674+denobot@users.noreply.github.com>
Co-authored-by: cjihrig <cjihrig@users.noreply.github.com>
2022-09-15 16:24:06 -04:00
Marcos Casagrande
606a6d7861
refactor(runtime/io): use primordials (#15906) 2022-09-15 13:35:41 +05:30
Colin Ihrig
19deec4494
fix(ops): add node.js env variable allowlist (#15893)
This commit allows the Node compatibility layer to skip
environment variable permission checks when --unstable
is passed and the variable name is one that Node uses.

Fixes: https://github.com/denoland/deno/issues/15890
2022-09-14 11:59:20 -04:00
David Sherret
73efed218f
refactor(npm): create general use NpmPackageResolver (#15882) 2022-09-13 11:59:01 -04:00
denobot
3bce2af0eb
chore: forward v1.25.2 release commit to main (#15831)
Co-authored-by: kt3k <kt3k@users.noreply.github.com>
2022-09-09 20:31:43 +09:00
Divy Srivastava
d2a408f452
perf(runtime): short-circuit queue_async_op for Poll::Ready (#15773) 2022-09-06 23:08:37 +05:30
David Sherret
f6636d4145
chore: fix flaky stdout_write_all test (#15772) 2022-09-05 09:05:48 -04:00
Divy Srivastava
1cdd2504b1
perf(runtime): flatten arguments for write_file ops (#15776) 2022-09-05 17:20:48 +05:30
David Sherret
08a6af398f
fix(cli): allow using file resource synchronously while being used async (#15747) 2022-09-04 22:33:06 -04:00
Christian Dürr
63b8089bda
refactor: move JsError formatting to deno_runtime (#15345)
This takes the existing `fmt_error` module from cli and puts it as a
public module into `deno_runtime`.
2022-09-02 22:53:23 +02:00
Nayeem Rahman
4f8dea100e
refactor(test): grab runTests() and runBenchmarks() from __bootstrap (#15420) 2022-09-02 19:44:45 +02:00
Nayeem Rahman
a74b2ecf37
fix(repl): don't terminate on unhandled error events (#15548) 2022-09-02 12:43:39 +02:00
denobot
658d2cdff2
chore: forward v1.25.1 release commit to main (#15735)
Co-authored-by: bartlomieju <bartlomieju@users.noreply.github.com>
2022-09-02 07:42:47 +02:00
Divy Srivastava
8e1c0e5141
perf(runtime): optimize allocations in read/write checks (#15631) 2022-08-27 20:50:05 +05:30
Bartek Iwańczuk
8986e2ced4
v1.25.0 2022-08-25 00:20:07 +02:00
Bartek Iwańczuk
6bb72a8086
feat(unstable): add more permission checks for ext/node/ (#15581) 2022-08-24 18:07:49 +02:00
Luca Casonato
f3bde1d53b
feat(ext/flash): split upgradeHttp into two APIs (#15557)
This commit splits `Deno.upgradeHttp` into two different APIs, because
the same API is currently overloaded with two different functions. Flash
requests upgrade immediately, with no need to return a `Response`
object. Instead you have to manually write the response to the socket.
Hyper requests only upgrade once a `Response` object has been sent.

These two behaviours are now split into `Deno.upgradeHttp` and
`Deno.upgradeHttpRaw`. The latter is flash only. The former only
supports hyper requests at the moment, but can be updated to support
flash in the future.

Additionally this removes `void | Promise<void>` as valid return types
for the handler function. If one wants to use `Deno.upgradeHttpRaw`,
they will have to type cast the handler signature - the signature is
meant for the 99.99%, and should not be complicated for the 0.01% that
use `Deno.upgradeHttpRaw()`.
2022-08-24 17:40:57 +05:30
Nayeem Rahman
97954003cc
feat: queueMicrotask() error handling (#15522)
Adds error event dispatching for queueMicrotask(). Consequently unhandled errors are now reported with Deno.core.terminate(), which is immune to the existing quirk with plainly thrown errors (#14158).
2022-08-21 20:16:42 +02:00
David Sherret
87f80ff6be
feat(unstable): initial support for npm specifiers (#15484)
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2022-08-20 11:31:33 -04:00
Bartek Iwańczuk
5beec3f106
feat(unstable): change Deno.serve() API (#15498)
- Merge "Deno.serve()" and "Deno.serveTls()" API
- Remove first argument and use "fetch" field options instead
- Update type declarations
- Add more documentation
2022-08-19 14:36:01 +02:00
Divy Srivastava
9e576dff7c
perf(runtime): optimize Deno.file open & stream (#15496) 2022-08-19 15:54:40 +05:30
Divy Srivastava
cd21cff299
feat(ext/flash): An optimized http/1.1 server (#15405)
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
Co-authored-by: Ben Noordhuis <info@bnoordhuis.nl>
Co-authored-by: crowlkats <crowlkats@toaxl.com>
Co-authored-by: Ryan Dahl <ry@tinyclouds.org>
2022-08-18 17:35:02 +05:30
David Sherret
868c7e38bf
feat(runtime): add pre_execute_module_cb (#15485) 2022-08-16 21:00:35 -04:00
denobot
e4a5f9952f
chore: forward v1.24.3 release commit to main (#15462)
Co-authored-by: David Sherret <dsherret@gmail.com>
2022-08-11 16:47:03 -04:00
Aapo Alasuutari
2164f6b1eb
perf(ops): Monomorphic sync op calls (#15337)
Welcome to better optimised op calls! Currently opSync is called with parameters of every type and count. This most definitely makes the call megamorphic. Additionally, it seems that spread params leads to V8 not being able to optimise the calls quite as well (apparently Fast Calls cannot be used with spread params).

Monomorphising op calls should lead to some improved performance. Now that unwrapping of sync ops results is done on Rust side, this is pretty simple:

```
opSync("op_foo", param1, param2);
// -> turns to
ops.op_foo(param1, param2);
```

This means sync op calls are now just directly calling the native binding function. When V8 Fast API Calls are enabled, this will enable those to be called on the optimised path.

Monomorphising async ops likely requires using callbacks and is left as an exercise to the reader.
2022-08-11 15:56:56 +02:00
David Sherret
321a42d1fb
refactor(runtime): split up MainWorker and WebWorker's preload_module method into two separate methods (#15451) 2022-08-10 18:10:51 -04:00
Leo Kettmeir
d0ffa0beb5
fix(permissions): ignore empty values (#15447) 2022-08-10 21:13:53 +02:00
Kayla Washburn
08061b60d9
fix: allow setting globalThis.location when no --location is provided (#15448) 2022-08-10 12:57:30 -06:00
David Sherret
04d402116c
chore: temporarily disable ext/node and use unstable ops (#15438) 2022-08-09 22:09:51 -04:00
Kitson Kelly
1c2ec1f48f
fix: update deno_graph to fix importing config as JSON module (#15388)
Ref: denoland/deno_graph#166
2022-08-10 07:27:22 +10:00
Bartek Iwańczuk
1f54d87789
feat: add ext/node for require support (#15362)
This commit adds "ext/node" extension that implementes CommonJS module system.

In the future this extension might be extended to actually contain implementation of
Node compatibility layer in favor of "deno_std/node".

Currently this functionality is not publicly exposed, it is available via "Deno[Deno.internal].require"
namespace and is meant to be used by other functionality to be landed soon.

This is a minimal first pass, things that still don't work:

support for dynamic imports in CJS
conditional exports
2022-08-09 21:06:01 +02:00
David Sherret
888b26819e
fix: various formatting fixes (#15412) 2022-08-05 19:31:19 -04:00
denobot
cf33720a85
chore: forward v1.24.2 release commit to main (#15410) 2022-08-05 00:10:47 +02:00
Yongwook Choi
2138b68c24
fix: Update Object.prototype.__proto__ related comments (#15394) 2022-08-04 08:39:16 +05:30
Colin Ihrig
088bc52db0
Forward 1.24.1 to main (#15333) (#15336)
1.24.1 (#15333)

Co-authored-by: cjihrig <cjihrig@users.noreply.github.com>
2022-07-29 08:44:46 -04:00
Aapo Alasuutari
b4b4e5980b
chore(ops): Remove unused arguments from ops (#15315) 2022-07-26 19:34:08 +02:00
Bartek Iwańczuk
504d2936ec
fix: unhandledrejection handling for sync throw in top level (#15279)
Fixes an edge in "unhandledrejection" event that prevent synchronous
errors being surfaced when throw from a top-level scope.
2022-07-23 00:40:42 +02:00
Bartek Iwańczuk
72199303d8
fix: Child.unref() unrefs stdio streams properly (#15275) 2022-07-22 18:07:20 +02:00
denobot
f0e01682cc
1.24.0 (#15262)
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2022-07-21 01:28:00 +02:00
Bartek Iwańczuk
d53936eb7d
Reland "feat: add "unhandledrejection" event support" (#15211) 2022-07-20 20:28:19 +02:00
Leo Kettmeir
2bebdc9116
feat(unstable): Ability to ref/unref "Child" in "Deno.spawnChild()" API (#15151)
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
Co-authored-by: Colin Ihrig <cjihrig@gmail.com>
2022-07-18 22:24:35 +02:00
sigmaSd
1f04cea160
chore(repl): update rustyline to 10.0.0 (#15232) 2022-07-18 20:47:00 +02:00
Nayeem Rahman
45c49034a7
BREAKING(unstable): Improve Deno.spawn() stdio API (#14919)
- "SpawnOutput" extends "ChildStatus" instead of composing it
- "SpawnOutput::stdout", "SpawnOutput::stderr", "Child::stdin", 
"Child::stdout" and "Child::stderr" are no longer optional, instead 
made them getters that throw at runtime if that stream wasn't set 
to "piped". 
- Remove the complicated "<T extends SpawnOptions = SpawnOptions>" 
which we currently need to give proper type hints for the availability of 
these fields. Their typings for these would get increasingly complex 
if it became dependent on more options (e.g. "SpawnOptions::pty" 
which if set should make the stdio streams unavailable)
2022-07-18 15:16:12 +02:00
Nayeem Rahman
22a4998e29
refactor: allocate IDs for tests (#14729) 2022-07-15 13:09:22 -04:00
David Sherret
635eed9373
chore: fix Windows specific clippy errors (#15212) 2022-07-15 12:30:25 -04:00
Bartek Iwańczuk
f9b692e68e
Revert "feat: add "unhandledrejection" event support (#12994) (#15080)" (#15210)
This reverts commit 1a7259b04b.
2022-07-15 01:06:20 +02:00
Bartek Iwańczuk
1a7259b04b
feat: add "unhandledrejection" event support (#12994) (#15080)
Relanding #12994 

This commit adds support for "unhandledrejection" event.

This event will trigger event listeners registered using:

"globalThis.addEventListener("unhandledrejection")
"globalThis.onunhandledrejection"
This is done by registering a default handler using
"Deno.core.setPromiseRejectCallback" that allows to
handle rejected promises in JavaScript instead of Rust.

This commit will make it possible to polyfill
"process.on("unhandledRejection")" in the Node compat
layer.

Co-authored-by: Colin Ihrig <cjihrig@gmail.com>
2022-07-14 22:39:20 +02:00
David Sherret
667812a297
fix(cli): synchronize async stdio/file reads and writes (#15092)
Fixes a regression where async writes and reads could get out of order.
2022-07-13 11:16:42 -04:00
Colin Ihrig
7610764980
chore: forward v1.23.4 release commit to main (#15172)
1.23.4 (#15168)

Co-authored-by: cjihrig <cjihrig@users.noreply.github.com>

Co-authored-by: denobot <33910674+denobot@users.noreply.github.com>
Co-authored-by: cjihrig <cjihrig@users.noreply.github.com>
2022-07-12 17:08:36 -04:00
cuobiezi
83818c914b
refactor: rename run_basic to run_local (#15068) 2022-07-11 19:02:23 +02:00
denobot
ef312e0050 1.23.3 (#15081)
Co-authored-by: David Sherret <dsherret@gmail.com>
2022-07-05 14:24:40 -04:00
Bartek Iwańczuk
a919a5dd11
Revert "refactor(snapshots): to their own crate (#14794)" (#15076)
This reverts commit fd5a12d7e2.
2022-07-05 00:12:41 +02:00
Bartek Iwańczuk
06934db883
Revert "feat: add "unhandledrejection" event support (#12994)" (#15075)
This reverts commit f7af0b01a5.
2022-07-04 23:34:39 +02:00
Bartek Iwańczuk
f7af0b01a5
feat: add "unhandledrejection" event support (#12994)
This commit adds support for "unhandledrejection" event.

This event will trigger event listeners registered using:

"globalThis.addEventListener("unhandledrejection")
"globalThis.onunhandledrejection"
This is done by registering a default handler using
"Deno.core.setPromiseRejectCallback" that allows to
handle rejected promises in JavaScript instead of Rust.

This commit will make it possible to polyfill
"process.on("unhandledRejection")" in the Node compat
layer.

Co-authored-by: Colin Ihrig <cjihrig@gmail.com>
2022-07-04 21:14:58 +02:00
David Sherret
3d8ba30ea0
chore: forward 1.23.2 to main (#15027)
Co-authored-by: David Sherret <dsherret@gmail.com>
2022-06-30 18:01:08 -04:00
Curtis Allen
d5ef14eca6
fix(runtime): derive default for deno_runtime::ExitCode (#15017) 2022-06-30 02:26:58 +02:00
nkronlage
4e4d987486
fix(test): typo ('finsihed') if text decoder not closed during test (#14996)
fix: typo ('finsihed') if text decoder not closed during test
2022-06-28 17:30:37 -04:00
Colin Ihrig
0f6a5c5fc2
feat(web): add beforeunload event (#14830)
This commit adds the 'beforeunload' event.

Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2022-06-28 10:49:30 -04:00
Luca Casonato
8d82ba7299
build: require safety comments on unsafe code (#13870)
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
Co-authored-by: Divy Srivastava <dj.srivastava23@gmail.com>
2022-06-26 00:13:24 +02:00
Aaron O'Mullan
fd5a12d7e2
refactor(snapshots): to their own crate (#14794)
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2022-06-24 15:04:45 +02:00
Bartek Iwańczuk
d39094913e
fix: don't error if Deno.bench() or Deno.test() are used in run subcommand (#14946) 2022-06-24 12:00:53 +02:00
Kayla Washburn
215f3d4c8e
v1.23.1 (#14954)
1.23.1 (#14952)

Co-authored-by: aslilac <aslilac@users.noreply.github.com>
Co-authored-by: Kayla Washburn <mckayla@hey.com>

Co-authored-by: denobot <33910674+denobot@users.noreply.github.com>
Co-authored-by: aslilac <aslilac@users.noreply.github.com>
2022-06-23 15:27:41 -06:00
Aapo Alasuutari
3d6fa64f19
feat(ext/ffi): Callbacks (#14663)
This commit adds support for unstable FFI
callbacks. A callback is registered using
the `Deno.UnsafeCallback` API.

The backing memory for the callback can 
be disposed of using `Deno.UnsafeCallback#close`.
It is not safe to pass the callback after calling
close.

Callbacks from other than the isolate thread
are not supported.

Co-authored-by: Divy Srivastava <dj.srivastava23@gmail.com>
Co-authored-by: Bert Belder <bertbelder@gmail.com>
2022-06-20 16:36:04 +05:30
Mathias Lafeldt
9f1f76f0b0
refactor: make MainWorker::evaluate_module public (#14892) 2022-06-19 23:29:48 +02:00
denobot
e7ea4edc8a
1.23.0 (#14878)
* 1.23.0

* docs(Releases.md): update a few items for 1.23

* docs(Releases.md): revert bad formatting

Co-authored-by: aslilac <aslilac@users.noreply.github.com>
Co-authored-by: McKayla Washburn <mckayla@hey.com>
2022-06-15 17:02:18 -06:00
Ryan Dahl
d0dec8d36b
chore: upgrade various deps (#14876)
Co-authored-by: David Sherret <dsherret@gmail.com>
2022-06-15 13:48:53 -04:00
Nayeem Rahman
0b90e966c5
chore(cli/cache): Remove CacheType::Declaration (#14873) 2022-06-15 10:25:25 -04:00
Luca Casonato
5bde4c7eca
BREAKING: remove Intl.v8BreakIterator (#14864)
This is a non-standard API that is mostly replaced by `Intl.Segmenter`.
2022-06-15 05:04:30 +02:00
David Sherret
4cff05b275
refactor(runtime/signal): revert SIGINT and SIGBREAK Deno.kill Windows changes (#14865) 2022-06-14 15:31:50 -04:00
Bartek Iwańczuk
fc3a966a2d
Deno.exit() is an alias to self.close() in worker contexts (#14826)
This commit changes Deno.exit() to be an alias to self.close() in worker contexts,
and the provided exit code becomes is ignored.
2022-06-13 23:53:04 +02:00
Geert-Jan Zwiers
24571a3952
feat(runtime/signal): implement SIGINT and SIGBREAK for windows (#14694)
This commit adds support for SIGINT and SIGBREAK signals on 
Windows platform.

Co-authored-by: orange soeur <juzi201314@gmail.com>
2022-06-13 22:39:46 +02:00