1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-24 15:19:26 -05:00
Commit graph

8282 commits

Author SHA1 Message Date
denobot
74064c9d8c
1.28.3 (#16883)
Co-authored-by: kt3k <kt3k@users.noreply.github.com>
2022-12-01 19:10:17 +09:00
David Sherret
dfc9fc6a0f
fix(npm): improve package.json exports support for types (#16880) 2022-12-01 16:30:19 +09:00
Bartek Iwańczuk
f7b89fc23c
fix(repl): respect --quiet flag (#16875)
This commit changes REPL behavior to respect --quiet flag. Once 
this flag is present REPL will not print a banner at the start.
2022-12-01 16:30:11 +09:00
Bartek Iwańczuk
229150ab1a
chore: upgrade rusty_v8 to 0.58.0 (#16879) 2022-12-01 16:30:01 +09:00
David Sherret
5f065d22a8
chore: remove unnecessary lifetimes (#16878)
It seems we don't really need to allow these clippy rules.
2022-12-01 16:29:57 +09:00
ud2
061e27ba26
fix(ext/web): fix typings for readable stream readers (#16191)
* Introduces `ReadableStreamDefaultReadResult` and modifies
`ReadableStreamDefaultReader.read` to return this type (closes #15269).
* Adds the missing `ReadableStreamBYOBReader` constructor.
* Removes the nonexistent `ReadableStreamReader` class.
2022-12-01 16:29:50 +09:00
Bartek Iwańczuk
8b3446f6d3
chore: upgrade rusty_v8 to 0.57.0 (#16871) 2022-12-01 16:29:38 +09:00
David Sherret
72afe7474d
fix(fmt/markdown): fix emoji width calculation in tables (#16870)
https://github.com/dprint/dprint-plugin-markdown/pull/67
2022-12-01 16:29:31 +09:00
David Sherret
ed4109494a
fix(lsp): analyze fs dependencies of dependencies to find npm package requirements (#16866)
Closes #16867
2022-12-01 16:29:26 +09:00
sigmaSd
9ea6cfbf6b
fix(coverage): Error if the emit cache is invalid (#16850) 2022-12-01 16:29:20 +09:00
Yoshiya Hinosawa
258c899ecb
fix(ext/node): allow absolute path in createRequire (#16853)
Co-authored-by: David Sherret <dsherret@gmail.com>
2022-12-01 16:29:07 +09:00
David Sherret
77c1608213
fix(npm): don't resolve JS files when resolving types (#16854)
Closes #16851
2022-12-01 16:28:57 +09:00
David Sherret
998e5cf171
refactor: create util folder, move nap_sym to napi/sym, move http_cache to cache folder (#16857) 2022-12-01 16:28:39 +09:00
Bartek Iwańczuk
7db81eaad6
feat(core): show unresolved promise origin (#16650)
This commit updates unhelpful messages that are raised when event loop
stalls on unresolved top-level promises.

Instead of "Module evaluation is still pending but there are no pending
ops or dynamic imports. This situation is often caused by unresolved
promises." and "Dynamically imported module evaluation is still pending
but there are no pending ops. This situation is often caused by
unresolved promises." we are now printing a message like: 

error: Top-level await promise never resolved
[SOURCE LINE]
^
    at [FUNCTION NAME] ([FILENAME])

eg:
error: Top-level await promise never resolved
await new Promise((_resolve, _reject) => {});
^
at <anonymous>
(file:///Users/ib/dev/deno/cli/tests/testdata/test/unresolved_promise.ts:1:1)

Co-authored-by: David Sherret <dsherret@users.noreply.github.com>
2022-12-01 16:28:30 +09:00
Bartek Iwańczuk
cccc95a2d5
fix(npm): allow to inspect npm modules with --inspect-brk (#16841) 2022-12-01 16:28:20 +09:00
Leo Kettmeir
88381a8e97
fix(runtime): feature-flag snapshot from snapshot (#16843) 2022-12-01 16:28:05 +09:00
Leo Kettmeir
c27f9d8072
feat(unstable): rework Deno.Command (#16812)
Refactors the `Deno.Command` class to not handle any state, but only being an intermediary to calling its methods, and as such any methods and properties besides `output`, `outputSync` & `spawn` have been removed. Interracting with a `spawn`ed subprocess now works by using the methods and properties on the returned class of the `spawn` method.
2022-12-01 16:25:31 +09:00
David Sherret
42d60c8db4
fix(npm): ensure npm package downloaded once per run when using --reload (#16842) 2022-12-01 16:25:18 +09:00
Aapo Alasuutari
956a5975ce
fix(ext/ffi): Null buffer pointer value is inconsistent (#16625)
Currently, slow call path will always create a dangling pointer to
replace a null pointer when called with eg. a `new Uint8Array()`
parameter, which V8 initialises as a null pointer backed buffer.

However, the fast call path will never change the pointer value and will
thus expose a null pointer. Thus, it's possible that the pointer value
that a native call sees coming from Deno changes between two sequential
invocations of the same function with the exact same parameters.

Since null pointers can be quite important, and `Uint8Array` is the
chosen fast path for Deno FFI `"buffer"` parameters, I think it is
fairly important that the null pointer be properly exposed to the native
code. Thus this PR.

### `*mut c_void`
While here, I also changed the type of our pointer values to `*mut
c_void`. This is mainly due to JS buffers always being `*mut`, and
because we offer a way to turn a pointer into a JS `ArrayBuffer`
(`op_ffi_get_buf`) which is read-write. I'm not exactly sure which way
we should really go here, we have pointers that are definitely mut but
we also cannot assume all of our pointers are. So, do we go with the
maxima or the minima?

### `optimisedCall(new Uint8Array())`
V8 seems to have a bug where calling an optimised function with a newly
created empty `Uint8Array` (no argument or 0) will not see the data
pointer being null but instead it's some stable pointer, perhaps
pointing to some internal null-backing-store. The pointer value is also
an odd (not even) number, so it might specifically be a tagged pointer.

This will probably be an issue for some users, if they try to use eg.
`method(cstr("something"), new Uint8Array())` as a way to do a fast call
to `method` with a null pointer as the second parameter.

If instead of a `new Uint8Array()` the user instead uses some `const
NULL = new Uint8Array()` where the `NULL` buffer has been passed to a
slow call previously, then the fast call will properly see a null
pointer.

I'll take this up with some V8 engineers to see if this couldn't be
fixed.
2022-12-01 16:25:09 +09:00
Divy Srivastava
1f2086220c
feat(ops): fast calls for Wasm (#16776)
This PR introduces Wasm ops. These calls are optimized for entry from
Wasm land.

The `#[op(wasm)]` attribute is opt-in. 

Last parameter `Option<&mut [u8]>` is the memory slice of the Wasm
module *when entered from a Fast API call*. Otherwise, the user is
expected to implement logic to obtain the memory if `None`

```rust
#[op(wasm)]
pub fn op_args_get(
  offset: i32,
  buffer_offset: i32,
  memory: Option<&mut [u8]>,
) {
  // ...
}
```
2022-12-01 16:24:58 +09:00
Divy Srivastava
4674fa5df3
perf(ops): Reenable fast unit result optimization (#16827)
The optimization was missed in the optimizer rewrite
https://github.com/denoland/deno/pull/16514
2022-12-01 16:24:48 +09:00
Bartek Iwańczuk
fc16ba5411
Revert "fix(ext/flash): graceful server startup/shutdown with unsettl… (#16839)
…ed promises in mind (#16616)"

This reverts commit fd023cf793.

There are reports saying that Vite is often hanging in 1.28.2 and this
is
the only PR that changed something with HTTP server. I think we should
hold off on trying to fix this and instead focus on #16787

CC @magurotuna
2022-12-01 16:24:37 +09:00
Divy Srivastava
5958632c5b
chore(ops): increase codegen tests coverage (#16834)
Upgrade fast_call tests to full (both tier) codegen tests.
2022-12-01 16:24:26 +09:00
Bartek Iwańczuk
e363249c3f
feat(core): support initializing extensions with and without JS (#16789)
This commit allows to execute more JS code from extensions when
creating a snapshot from an existing snapshot.

"deno_core::RuntimeOptions::extensions_with_js" field was added
that is used to pass a list of extensions whose both "ops" and
associated JS source should be executed upon start.

Co-authored-by: crowlkats <crowlkats@toaxl.com>
2022-12-01 16:24:14 +09:00
Bartek Iwańczuk
8c7e15d445
feat(core): send "executionContextDestroyed" notification on program end (#16831)
This commit changes "JsRuntime" to send "executionContextDestroyed"
notification when the program finishes and shows a prompt informing 
that runtime is waiting for inspector to disconnect.
2022-12-01 16:24:03 +09:00
Leo Kettmeir
3ac7b27efa
chore: update deno_doc (#16838) 2022-12-01 16:23:56 +09:00
Bartek Iwańczuk
5d2461d46f
fix(inspector): send "isDefault" in aux data (#16836)
With trial and error I found that most debuggers expect "isDefault" to be sent
in "auxData" field of "executionContextCreated" notification. This stems from
the fact that Node.js sends this data and eg. VSCode requires it to close
connection to the debugger when the program finishes execution.
2022-12-01 16:23:48 +09:00
Bartek Iwańczuk
5e9e1395d0
chore: update rusty_v8 to 0.56.1 (#16835) 2022-12-01 16:23:38 +09:00
Bartek Iwańczuk
e095c54422
chore: update rusty_v8 to 0.56.0 (#16814)
Co-authored-by: Divy Srivastava <dj.srivastava23@gmail.com>
2022-12-01 16:23:28 +09:00
Divy Srivastava
bcbcc72996
feat(ops): support raw pointer arguments (#16826)
See https://github.com/denoland/deno/pull/16814#discussion_r1032744083.
Allows nullable buffers in low-level ops like FFI:

```rust
fn op_ffi_ptr_of<FP>(
  state: &mut OpState,
  buf: *const u8,
  out: &mut [u32],
) 
where
  FP: FfiPermissions + 'static {
  // ..
}
```
2022-12-01 16:23:18 +09:00
Bartek Iwańczuk
73ff200357
tests: move integration tests to separate modules (#16816) 2022-12-01 16:23:12 +09:00
David Sherret
933eebdde9
refactor: DenoDir - move to cache folder and make root_dir private (#16823) 2022-12-01 16:23:03 +09:00
David Sherret
c63d857c17
refactor: move generated_symbol_exports_list_* files to napi folder (#16822) 2022-12-01 16:22:49 +09:00
David Sherret
4a0066b84d
refactor: move cdp.rs to tools/repl (#16821) 2022-12-01 16:22:40 +09:00
David Sherret
65986986f1
refactor: move dts files, diagnostics.rs, and tsc.rs to tsc folder (#16820) 2022-12-01 16:22:31 +09:00
David Sherret
0532304b5c
refactor: move lockfile.rs to args module (#16818)
This should be in the `args` folder as it's similar to `config_file`.
2022-12-01 16:22:24 +09:00
David Sherret
77454c5863
fix(npm): better error message when attempting to use typescript in npm packages (#16813) 2022-12-01 16:21:52 +09:00
Divy Srivastava
eae35cb81d
fix(ops): circular dependency in deno_ops test (#16809) 2022-12-01 16:21:27 +09:00
David Sherret
292d731466
refactor(lsp): consolidate relative_specifier (#16780)
Closes #14840
2022-12-01 16:21:12 +09:00
Luca Casonato
78c287eb87
fix(cli/js): improve resource sanitizer messages (#16798)
This commit improves the guidance for how to close a child process
stdout / stderr to also include guidance for when using
`new Deno.Command()`.
2022-12-01 16:21:04 +09:00
Bartek Iwańczuk
488eb21652
fix(repl): more reliable history handling (#16797)
This commit changes history handling of the REPL.

There were some situations were history wasn't properly saved and flushed to a
file, making history very spotty. This commit changes it to save every line into
the history file and flush it to disk before being evaluated.

Thanks to this all lines, including "close()" will be stored in the history
file.

If for any reason we're not able to save history file, a single warning will be
printed to the REPL and it will continue to work, even if subsequent tries will
fail to save to disk.
2022-12-01 16:20:48 +09:00
David Sherret
14090179e9
fix(task): output encoding issues on windows (#16794)
Closes #16792
2022-12-01 16:20:12 +09:00
denobot
1aca16e239
1.28.2 (#16793)
Co-authored-by: bartlomieju <bartlomieju@users.noreply.github.com>
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2022-11-24 21:22:47 +01:00
David Sherret
184c9b9b28
fix(npm/types): resolve main entrypoint declaration file when no types entry (#16791)
Closes #16782
2022-11-24 20:27:10 +01:00
Yusuke Tanaka
31abacbe1a
fix(ext/flash): graceful server startup/shutdown with unsettled promises in mind (#16616)
This PR resets the revert commit made by #16610, bringing back #16383
which attempts to fix the issue happening when we use the flash server
with `--watch` option enabled.
Also, some code changes are made to pass the regression test added in
#16610.
2022-11-24 20:27:10 +01:00
David Sherret
72c8c16a85
fix(npm/check): prioritize exports over types entry (#16788) 2022-11-24 20:27:10 +01:00
Ikko Ashimine
40198a1504
refactor(core): fix typo in ops_builtin.rs (#16613) 2022-11-24 20:27:10 +01:00
Asher Gomez
d178ab6049
feat(cli): add warning for incorrectly ordered flags (#16734)
This code checks if permission flags are incorrectly defined after the
module name (e.g. `deno run mod.ts --allow-read` instead of the correct
`deno run --allow-read mod.ts`). If so, a simple warning is displayed.
2022-11-24 20:27:09 +01:00
David Sherret
06df0ff332
chore: more debug logging and avoid allocating strings in ts logging when not debug (#16689) 2022-11-24 20:26:47 +01:00
David Sherret
090d9a7a3c
chore: remove unnecessary qualifier in declaration file (#16767) 2022-11-24 20:26:47 +01:00