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

12769 commits

Author SHA1 Message Date
Bartek Iwańczuk
a1bcdf17a5
feat(jupyter): Add Deno.jupyter.image API (#26284)
This commit adds `Deno.jupyter.image` API to display PNG and JPG images:

```
const data = Deno.readFileSync("./my-image.jpg");
Deno.jupyter.image(data);

Deno.jupyter.image("./my-image.jpg");
```
2024-11-16 15:13:50 +00:00
/usr/bin/cat
8d2960d7cc
fix(ext/node): New async setInterval function to improve the nodejs compatibility (#26703)
Closes #26499
2024-11-16 16:01:19 +01:00
HasanAlrimawi
abf06eb87f
feat(watch): log which file changed on HMR or watch change (#25801)
Closes #25504
2024-11-16 15:59:31 +01:00
Bartek Iwańczuk
768c5ea2bb
fix(ext/cache): gracefully error when cache creation failed (#26895)
Removes panic reported in https://github.com/denoland/deno/issues/26893
2024-11-16 14:29:36 +00:00
Miguel Rodrigues
99d5c6e423
fix(cli): show prefix hint when installing a package globally (#26629)
Closes #26545

Shows a hint when a package is installed globally, otherwise fallbacks
to the existing implementation.
2024-11-16 14:57:14 +01:00
Bartek Iwańczuk
84e1238648
feat(task): support object notation, remove support for JSDocs (#26886)
This commit changes three aspects of `deno task`:
1. Tasks can now be written using object notation like so:
```jsonc
{
  "tasks": {
     "foo": "deno run foo.js",
     "bar": {
        "command": "deno run bar.js"
     }
}
```
2. Support for comments for tasks is now removed. Comments above tasks
will
no longer be printed when running `deno task`.
3. Tasks written using object notation can have "description" field that
replaces
support for comments above tasks:
```jsonc
{
  "tasks": {
     "bar": {
        "description": "This is a bar task"
        "command": "deno run bar.js"
     }
}
```
```
$ deno task
Available tasks:
- bar
    // This is a bar task
    deno run bar.js
```

Pulled most of the changes from
https://github.com/denoland/deno/pull/26467 to
support "dependencies" in tasks. Additionally some cleanup was performed
to make code easier to read.

---------

Co-authored-by: David Sherret <dsherret@gmail.com>
2024-11-16 12:18:17 +01:00
David Sherret
48b94c0995
refactor: use boxed_error in some places (#26887) 2024-11-15 23:22:50 -05:00
Bartek Iwańczuk
dee94473c4
fix: update message for unsupported schemes with npm and jsr (#26884)
Closes https://github.com/denoland/deno/issues/26596
2024-11-15 17:09:19 +00:00
Luca Casonato
b8cf259924
feat(fetch): accept async iterables for body (#26882)
Reland of #24623, but with a fix for `String` objects.

Co-authored-by: crowlkats <crowlkats@toaxl.com>
2024-11-15 15:54:28 +01:00
Nayeem Rahman
3f26310728
feat(lsp): auto-imports with @deno-types directives (#26821)
Co-authored-by: David Sherret <dsherret@gmail.com>
2024-11-15 14:40:32 +00:00
Sahand Akbarzadeh
032ae7fb19
feat(ext/fetch): allow embedders to use hickory_dns_resolver instead of default GaiResolver (#26740)
Allows embedders to use `hickory-dns-resolver` instead of threaded "getaddrinfo" resolver
in the `fetch()` implementation.
2024-11-15 11:44:11 +01:00
Bartek Iwańczuk
c9baf3849f
perf: use available system memory for v8 isolate memory limit (#26868)
Instead of using the default 1.4Gb limit (which was meant for browser
tabs) configure V8 to
set the heap limit to the amount of memory available in the system.

Closes https://github.com/denoland/deno/issues/23424
Closes https://github.com/denoland/deno/issues/26435
Closes https://github.com/denoland/deno/issues/21226
2024-11-15 10:33:03 +01:00
Bartek Iwańczuk
dcc75d5685
chore: remove some unused tests (#26878) 2024-11-15 00:19:12 +00:00
David Sherret
617350e79c
refactor(resolver): move more resolution code into deno_resolver (#26873)
Follow-up to cjs refactor.

This moves most of the resolution code into the deno_resolver crate.
Still pending is the npm resolution code.
2024-11-14 15:24:25 -05:00
Marvin Hagemeister
de34c7ed29
feat(cli): add --unstable-node-globals flag (#26617)
This PR adds a new `--unstable-node-globals` flag to expose Node globals
by default.

Fixes https://github.com/denoland/deno/issues/26611

---------

Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2024-11-14 13:11:29 +00:00
snek
4e899d48cf
fix: otel resiliency (#26857)
Improving the breadth of collected data, and ensuring that the collected
data is more likely to be successfully reported.

- Use `log` crate in more places
- Hook up `log` crate to otel
- Switch to process-wide otel processors
- Handle places that use `process::exit`

Also adds a more robust testing framework, with a deterministic tracing
setting.

Refs: https://github.com/denoland/deno/issues/26852
2024-11-14 12:16:28 +00:00
Kyle Kelley
cb107a762f
chore: upgrade runtimelib (jupyter) to 0.19 (#26862)
Upgrades the `runtimelib` crate. Of utility for users and library
authors is the support for binary buffers on messages, especially for
comms.
2024-11-14 11:43:41 +01:00
Yusuke Tanaka
15fae19748
fix(cli): preserve comments in doc tests (#26828)
This commit makes comments in code snippets in JSDoc or markdown
preserved when they are executed as tests. In particular, this is needed
to get TypeScript special comments such as `@ts-ignore` or
`@ts-expect-error` to work correctly.

Fixes #26728
2024-11-13 21:04:32 -08:00
David Sherret
6b5cb41545
fix(fmt): error instead of panic on unstable format (#26859) 2024-11-13 15:39:40 +00:00
David Sherret
f091d1ad69
feat(node): stabilize detecting if CJS via "type": "commonjs" in a package.json (#26439)
This will respect `"type": "commonjs"` in a package.json to determine if
`.js`/`.jsx`/`.ts`/.tsx` files are CJS or ESM. If the file is found to
be ESM it will be loaded as ESM though.
2024-11-13 15:10:09 +00:00
Divy Srivastava
6a4c6d83ba
fix(ext/node): zlib.crc32() (#26856)
Fixes https://github.com/denoland/deno/issues/26845
2024-11-13 20:07:45 +05:30
Divy Srivastava
7d9ba09f5a
fix(ext/node): use ERR_NOT_IMPLEMENTED for notImplemented (#26853) 2024-11-13 19:47:01 +05:30
Luca Casonato
9331e2cef0
chore: update denokv_* (#26850) 2024-11-13 13:23:36 +00:00
Bartek Iwańczuk
ef4646278e
feat: upgrade V8 to 13.0 (#26851) 2024-11-13 12:04:30 +00:00
snek
aa546189be
feat: OpenTelemetry Tracing API and Exporting (#26710)
Initial import of OTEL code supporting tracing. Metrics soon to come.
Implements APIs for https://jsr.io/@deno/otel so that code using
OpenTelemetry.js just works tm.

There is still a lot of work to do with configuration and adding
built-in tracing to core APIs, which will come in followup PRs.

---------

Co-authored-by: Luca Casonato <hello@lcas.dev>
2024-11-13 10:38:46 +00:00
Łukasz Czerniawski
7becd83a38
feat(ext/fs): add ctime to Deno.stats and use it in node compat layer (#24801)
This PR fixes #24453, by introducing a ctime (using ctime for UNIX and
ChangeTime for Windows) to Deno.stats.

Co-authored-by: Yoshiya Hinosawa <stibium121@gmail.com>
2024-11-13 13:35:04 +09:00
Divy Srivastava
43812ee8ff
fix(ext/node): process.getBuiltinModule (#26833)
Closes https://github.com/denoland/deno/issues/26832
2024-11-13 08:02:09 +05:30
David Sherret
119910f339
fix(permissions): say to use --allow-run instead of --allow-all (#26842)
For https://github.com/denoland/deno/issues/26839
2024-11-12 17:14:19 -05:00
Richard Carson
01f3451869
chore: make fields public on PermissionDeniedError and deno_kv::KvConfig (#26798)
A few small changes to avoid needing unsafe mem transmutes to
instantiate the extensions

---------

Signed-off-by: Richard Carson <Rscarson@rogers.com>
2024-11-12 17:49:49 +00:00
Nathan Whitaker
c371b2a492
fix(install): re-setup bin entries after running lifecycle scripts (#26752)
Fixes #26677

Some packages (like supabase) declare bin entries that don't exist until
lifecycle scripts are run. For instance, the lifecycle script downloads
a binary file which serves as a bin entrypoint.

Unfortunately you can't just defer setting up the bin entries until
after lifecycle scripts have run, because the scripts may rely on them.

I looked into this, and PNPM just re-links bin entries after running
lifecycle scripts. I think that's about the best we can do as well.

Note that we'll only re-setup bin entries for packages whose lifecycle
scripts we run. This should limit the performance cost, as typically a
given project will not have many lifecycle scripts (and of those, many
of them probably don't have bin entries to set up).
2024-11-12 09:23:39 -08:00
Soc Virnyl S. Estela
15b6baff33
chore: update zeromq to 0.4.1 (#26811)
Closes: #26810

---------

Signed-off-by: Soc Virnyl Estela <contact@uncomfyhalomacro.pl>
Co-authored-by: Divy Srivastava <dj.srivastava23@gmail.com>
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2024-11-12 17:25:59 +01:00
Divy Srivastava
7179bdcc77
fix(ext/node): handle --allow-sys=inspector (#26836)
`op_inspector_open` checks for "inspector" as one of the allowed sys
value.
2024-11-12 16:55:49 +01:00
Nayeem Rahman
7d326c269c
fix(lsp): skip code action edits that can't be converted (#26831) 2024-11-12 13:15:32 +00:00
Divy Srivastava
3b99f6833c
fix(ext/websocket): initialize error attribute of WebSocket ErrorEvent (#26796)
Fixes https://github.com/denoland/deno/issues/26216

Not required by the spec but Discord.js depends on it, see
https://github.com/denoland/deno/issues/26216#issuecomment-2466060306
2024-11-12 17:10:07 +05:30
Yoshiya Hinosawa
c3c2b37966
fix(ext/node): add autoSelectFamily option to net.createConnection (#26661) 2024-11-12 19:54:47 +09:00
Satya Rohith
90236d67c5
fix(ext/http): prefer brotli for accept-encoding: gzip, deflate, br, zstd (#26814)
Closes https://github.com/denoland/deno/issues/26813
2024-11-12 12:10:41 +05:30
Yoshiya Hinosawa
b955d03740
test(ext/node): prevent running the same test cases twice (#26812) 2024-11-11 17:16:33 +09:00
Leo Kettmeir
bfc143a5ac
fix(ext/webstorage): use error class for sqlite error case (#26806)
Fixes #26797
2024-11-10 02:43:04 -08:00
denobot
e1b40a69c0
chore: forward v2.0.6 release commit to main (#26804)
This is the release commit being forwarded back to main for 2.0.6

Signed-off-by: Divy Srivastava <dj.srivastava23@gmail.com>
Co-authored-by: Divy Srivastava <dj.srivastava23@gmail.com>
2024-11-10 13:12:18 +05:30
Divy Srivastava
ce778a947e
Revert "perf(upgrade): cache downloaded binaries in DENO_DIR" (#26799)
Reverts denoland/deno#26108

Tests are flaky on main
01de331742
2024-11-10 09:00:44 +05:30
Bartek Iwańczuk
01de331742
perf(upgrade): cache downloaded binaries in DENO_DIR (#26108)
Co-authored-by: Divy Srivastava <dj.srivastava23@gmail.com>
2024-11-09 15:19:46 +00:00
snek
73fbd61bd0
fix: performance.timeOrigin (#26787)
`performance.timeOrigin` was being set from when JS started executing,
but `op_now` measures from an `std::time::Instant` stored in `OpState`,
which is created at a completely different time. This caused
`performance.timeOrigin` to be very incorrect. This PR corrects the
origin and also cleans up some of the timer code.

Compared to `Date.now()`, `performance`'s time origin is now
consistently within 5us (0.005ms) of system time.


![image](https://github.com/user-attachments/assets/0a7be04a-4f6d-4816-bd25-38a2e6136926)
2024-11-08 23:20:24 +01:00
Nathan Whitaker
d4f1bd3dac
fix(install): cache jsr deps from all workspace config files (#26779)
Fixes #26772.

I wasn't aware that the `imports()` method only returned the workspace
root imports
2024-11-08 12:45:30 -08:00
Divy Srivastava
b482a50299
feat(ext/http): abort event when request is cancelled (#26781)
```js
Deno.serve(async (req) => {
  const { promise, resolve } = Promise.withResolvers<void>();

  req.signal.addEventListener("abort", () => {
    resolve();
  });

  await promise;

  return new Response("Ok");
});
```
2024-11-08 18:46:11 +05:30
Divy Srivastava
637b1d5508
fix(ext/cache): don't panic when creating cache (#26780) 2024-11-08 12:27:29 +05:30
Nathan Whitaker
bf82c6697a
chore: make commandWithCwdIsAsync test less flaky (#26770) 2024-11-07 15:02:33 -08:00
Divy Srivastava
b9262130fe
feat(ext/http): abort signal when request is cancelled (#26761)
Closes https://github.com/denoland/deno/issues/21653
2024-11-07 17:12:13 +05:30
Nathan Whitaker
742744d498
chore: serve node headers from a test server to fix flaky node-gyp test (#26749)
Fixes https://github.com/denoland/deno/issues/24749

Runs a server that just returns the header tarball and checksum, and
sets the `NODEJS_ORG_MIRROR` env var so that `node-gyp` uses it instead
of `nodejs.org`
2024-11-06 19:52:46 -08:00
Leo Kettmeir
1cab4f07a3
refactor: use concrete error type for remaining ops (#26746) 2024-11-06 16:57:57 -08:00
Kaveh
db53ec230d
refactor(ext/net): Use hickory dns instead of unmaintained trust-dns (#26741)
This PR replaces the unmaintained and rebranded `trust-dns` to `hickory`
for resolver in `deno_net`.
2024-11-06 15:49:32 -08:00