Commit graph

1206 commits

Author SHA1 Message Date
denobot ed34429a5f
chore: forward v1.40.4 release commit to main (#22345)
This is the release commit being forwarded back to main for 1.40.4

Co-authored-by: Divy Srivastava <dj.srivastava23@gmail.com>
2024-02-08 12:39:39 +00:00
David Sherret 83d72e5c1c
refactor: extract out runtime::colors to deno_terminal::colors (#22324) 2024-02-07 11:25:14 -05:00
restlessronin b16e6220a2
fix: enable "--allow-sys=cpus" for "deno run" (#22260)
Fixes #22221 with the suggested fix, and added "cpus" to the existing
tests.
2024-02-07 06:38:40 +00:00
Bartek Iwańczuk 6c15dc3f06
chore: remove op_spawn_child test (#22314)
This test is not needed because the op is not available to user code
anymore.

This brings number of ops exposed to user code down to 15.
2024-02-07 04:44:51 +01:00
Bartek Iwańczuk edab1bb927
chore: don't expose FFI ops to user code (#22313)
This commit removes some not really necessary FFI tests and in effect
removes them from being accessible from the user code.

This lowers the number of ops accessible to user code to 16.
2024-02-07 04:15:11 +01:00
Bartek Iwańczuk 043fee48fd
chore: upgrade deno_core to 0.259.0 (#22311)
This update brings number of ops available to user code down to 45.
2024-02-07 02:16:08 +01:00
Leo Kettmeir 1007358768
refactor: move ImageData to web extension (#22295)
Signed-off-by: Leo Kettmeir <crowlkats@toaxl.com>
2024-02-07 01:11:15 +01:00
Bartek Iwańczuk 89ae2d88b8
chore: remove unneeded benchmark (#22300)
Brings down the number of ops available to user code to 49.
2024-02-07 01:00:18 +01:00
Leo Kettmeir c8b2af8ed1
refactor: use web utils and lazy load utils from core (#22289) 2024-02-06 22:28:32 +01:00
Bartek Iwańczuk 7c111da5f6
fix: Support Symbol.metadata (#22282)
This commit adds support for "Symbol.metadata" which was 
omitted when adding support for the Decorators Proposal.

Closes https://github.com/denoland/deno/issues/22111
2024-02-06 14:57:25 +01:00
Divy Srivastava e568cb8bf8
chore(ws): remove unused op_ws_send_pong (#22283) 2024-02-06 13:37:20 +01:00
Bartek Iwańczuk 28576db10e
refactor: don't expose some ops (#22281)
This commit brings down the number of ops exposed to user
code to 51.
2024-02-06 02:47:10 +01:00
Bartek Iwańczuk 6853633f7d
refactor: don't expose worker ops to user code (#22276) 2024-02-06 00:58:06 +01:00
Bartek Iwańczuk b94dabdb81
refactor: don't expose ops to user code (#22273)
Brings the number of ops exposed to user code down to 58.
2024-02-06 00:26:36 +01:00
Matt Mastracci 2c621f5894
refactor(cli): Move op descriptions into Rust and prepare for op import (#22271)
This moves the op sanitizer descriptions into Rust code and prepares for
eventual op import from `ext:core/ops`. We cannot import these ops from
`ext:core/ops` as the testing infrastructure ops are not always present.

Changes:
- Op descriptions live in `cli` code and are currently accessible via an
op for the older sanitizer code
 - `phf` dep moved to workspace root so we can use it here
- `ops.op_XXX` changed to to `op_XXX` to prepare for op imports later
on.
2024-02-05 20:26:59 +00:00
Matt Mastracci 0a3d329dd8
Reland refactor(cli): use new sanitizer for resources (#22226)
Originally in #22125
Reverted in #22153 because of #22148

Fixed in deno_core https://github.com/denoland/deno_core/pull/538

Test plan: 

1. Check out: https://github.com/poolifier/poolifier-deno.git

2. `PATH=.../deno/target/release/:$PATH deno task test`

3. `ok | 13 passed (188 steps) | 0 failed (18s)`
2024-02-05 12:21:29 -07:00
Divy Srivastava d13094c821
fix(os): total and free memory in bytes (#22247) 2024-02-05 18:41:24 +05:30
Matt Mastracci 56f58a047e
chore: bump deno core (#22243)
Migrations:

- Error registration no longer required for Interrupted or BadResource
(these are core exception)
 - `include_js_files!`/`ExtensionFileSource` changes
2024-02-04 17:03:14 -07:00
Bartek Iwańczuk 8edb36fea4
fix(jupyter): ensure op is available (#22240)
Closes https://github.com/denoland/deno/issues/22231
2024-02-02 20:20:18 +00:00
Asher Gomez 3f4639c330
docs: point to new "Deno 1.x to 2.x Migration Guide" (#22199)
Signed-off-by: Asher Gomez <ashersaupingomez@gmail.com>
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2024-02-02 02:32:46 +01:00
Divy Srivastava ca11536f3f
chore: forward v1.40.3 release commit to main (#22220)
This is the release commit being forwarded back to main for 1.40.3

Ref https://github.com/denoland/deno/pull/22219
2024-02-01 18:11:35 +09:00
Bartek Iwańczuk 95e4741f00
refactor: migrate runtime/ and ext/canvas/ to virtual ops module (#22196) 2024-01-31 23:17:49 +01:00
Bartek Iwańczuk 13a91a69f8
refactor: remove imported ops from Deno.core.ops (#22194)
This commit adds a list of ops to `runtime/99_main.js` that are
currently relying on getting them from `Deno.core.ops`. All ops that are not
present in the list are removed from `Deno.core.ops` on startup (they are
imported from "virtual op module" - `ext:core/ops`) making them effectively
inaccessible to user code.

This change lowers the number of ops exposed to user code from 650 to
around 260. This number should be gradually decreased in follow-up PRs.
2024-01-31 22:39:56 +01:00
Yusuke Tanaka ab8b1b11d7
fix(runtime): return number from op_ppid instead of bigint (#22169)
Fixes #22166
2024-01-30 15:34:31 +09:00
Bartek Iwańczuk 345423cf76
refactor: Use virtul ops module (#22175)
Follow up to #22157.

This leaves us with 4 usages of `ensureFastOps()` in `deno` itself.
There's also about 150 usages of `Deno.core.ops.<op_name>` left as well.
2024-01-29 22:02:26 +01:00
Bartek Iwańczuk 462ce14a78
refactor: migrate extensions to virtual ops module (#22135)
First pass of migrating away from `Deno.core.ensureFastOps()`.

A few "tricky" ones have been left for a follow up.
2024-01-26 23:46:46 +01:00
Bartek Iwańczuk 942fb5e038
chore: upgrade deno_core (#22124)
Co-authored-by: Matt Mastracci <matthew@mastracci.com>
2024-01-26 14:04:07 -05:00
Bartek Iwańczuk 9ed713153c
chore: forward v1.40.2 commit to main (#22133)
Co-authored-by: denobot <33910674+denobot@users.noreply.github.com>
Co-authored-by: bartlomieju <bartlomieju@users.noreply.github.com>
2024-01-26 18:59:16 +00:00
Bartek Iwańczuk 9e0495baa7
fix: make deprecation warnings less verbose (#22128)
This commit makes deprecation warnings less verbose by default.

Only a single warnings is issued per deprecated API use.

`DENO_VERBOSE_WARNINGS` env var can be provided to enable more detailed
logging for each use of API including a stack trace.

https://github.com/denoland/deno/assets/13602871/9c036c84-0044-4cb6-9c8e-deb641f43712
2024-01-26 16:41:16 +01:00
Bartek Iwańczuk 0b0fb94ce2
fix(fs): instanceof check for Deno.FsFile (#22121)
Regression caused by https://github.com/denoland/deno/pull/22072.

I added a relevant test so we don't regress again.

Fixes https://github.com/denoland/deno/issues/22115
2024-01-25 23:51:29 +01:00
Bartek Iwańczuk d4153bb117
chore: forward v1.40.1 commit to main (#22107)
Co-authored-by: denobot <33910674+denobot@users.noreply.github.com>
Co-authored-by: bartlomieju <bartlomieju@users.noreply.github.com>
2024-01-25 16:24:11 +00:00
denobot 9e575a2862
1.40.0 (#22096)
Bumped versions for 1.40.0

Co-authored-by: bartlomieju <bartlomieju@users.noreply.github.com>
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2024-01-25 03:48:50 +01:00
Bartek Iwańczuk 174bb70eda
fix: don't use public rid accessors in internal APIs (#22091)
Co-authored-by: Asher Gomez <ashersaupingomez@gmail.com>
2024-01-25 00:45:19 +01:00
Asher Gomez 8dd71b6f1d
fix: don't call .rid in Deno.FsWatcher.close() (#22090)
Otherwise, a deprecation warning will be printed.
2024-01-24 23:05:22 +00:00
Bartek Iwańczuk 801ed74118
revert: Remove deprecations of file sync APIs (#22085)
- `Deno.FsFile.dataSync` -> `Deno.FsFile.syncData`
- `Deno.FsFile.dataSyncSync` -> `Deno.FsFile.syncDataSync`

Also marks these APIs as unstable
2024-01-24 23:38:18 +01:00
Bartek Iwańczuk fb24b004ba
chore: improve deprecation hint for Deno.isatty() (#22086) 2024-01-24 20:09:19 +00:00
Bartek Iwańczuk 8e67bf829a
Revert "feat: deprecate window global (#22057)" (#22084)
This reverts commit 930ce20870.

This is producing false-positives that are not actionable to users.
We're gonna address this in another release.
2024-01-24 20:43:31 +01:00
Asher Gomez 547468e625
feat: deprecate Deno.FsWatcher.rid (#22074)
For removal in Deno v2. I've also updated the deprecation of
`Deno.FsWatcher.return()`, which, to be clear, I'm not in favour of
deprecating. I mention this in #15499. Either way, it's safe to merge
this PR, then decide against the deprecation.
2024-01-24 18:57:28 +01:00
Asher Gomez 48c19d0bab
feat: deprecate Deno.fstat() and Deno.fstatSync() (#22068)
For removal in Deno v2.
2024-01-24 18:53:20 +01:00
Asher Gomez f5097d9d3b
feat: Deno.FsFile.{utime,utimeSync}() and deprecate Deno.{futime,futimeSync} (#22070)
For removal in Deno v2.

---------

Co-authored-by: Divy Srivastava <dj.srivastava23@gmail.com>
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2024-01-24 17:26:49 +01:00
Asher Gomez a5a973e93c
feat: deprecate Deno.write() and Deno.writeSync() (#22064)
For removal in Deno v2.
2024-01-24 16:36:13 +01:00
Bartek Iwańczuk 50eaeabefb
feat: Change deprecation warning formatting (#22080)
Removes weird "frame like" characters and simplifies the output:

```
warning: Use of deprecated "Deno.isatty()" API. This API will be removed in Deno 2.

Stack trace:
  at file:///Users/ib/dev/deno/foo.js:2:8

hint: Use `stdStream.isTerminal()` instead.

warning: Use of deprecated "Deno.isatty()" API. This API will be removed in Deno 2.

Stack trace:
  at file:///Users/ib/dev/deno/foo.js:7:8

hint: Use `stdStream.isTerminal()` instead.

```

https://github.com/denoland/deno/assets/13602871/7a6e24bf-44ec-4dbf-ac96-2af1db9f2ab9
2024-01-24 16:35:47 +01:00
Asher Gomez 62786cfebb
feat: deprecate Deno.close() (#22066)
For removal in Deno v2.

---------

Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2024-01-24 15:59:55 +01:00
Asher Gomez 4af121687c
feat: deprecate Deno.ftruncate() and Deno.ftruncateSync() (#22069)
For removal in Deno 2.0.
2024-01-24 15:12:22 +01:00
Bartek Iwańczuk 064a6c048a
feat: Add warnings for more deprecated APIs (#21992)
Follow up to https://github.com/denoland/deno/pull/21939 that adds
deprecation warnings to more `Deno` APIs:

- `Deno.copy()`
- `Deno.iter()`
- `Deno.iterSync()`
- `new Deno.Buffer()`
- `Deno.readAll()`
- `Deno.readAllSync()`
- `Deno.writeAll()`
- `Deno.writeAllSync()`
- `Deno.FsWatcher.return`
- `Deno.serveHttp()`
- `Deno.metrics()`

---------

Signed-off-by: Asher Gomez <ashersaupingomez@gmail.com>
Co-authored-by: Asher Gomez <ashersaupingomez@gmail.com>
2024-01-24 14:57:54 +01:00
Bartek Iwańczuk 930ce20870
feat: deprecate window global (#22057)
This commit deprecates `window` global and adds deprecation
notice on each use of `window`.

We decided to proceed with removal of `window` global variable in Deno
2.0. There's a lot of code
in the wild that uses pattern like this:
```
if (typeof window !== "undefined) {
  ...
}
```
to check if the code is being run in browser. However, this check passes
fine in Deno and
most often libraries that do this check try to access some browser API
that is not available
in Deno, or use DOM APIs (which are also not available in Deno).

This situation has occurred multiple times already
and it's unfeasible to expect the whole ecosystem to migrate to new
check (and even if that
happened there's a ton of code that's already shipped and won't change).

The migration is straightfoward - replace all usages of `window` with
`globalThis` or `self`.
When Deno encounters use of `window` global it will now issue a warning,
steering users
towards required changes:

```
Warning
├ Use of deprecated "window" API.
│
├ This API will be removed in Deno 2.0. Make sure to upgrade to a stable API before then.
│
├ Suggestion: Use `globalThis` or `self` instead.
│
├ Suggestion: You can provide `window` in the current scope with: `const window = globalThis`.
│
└ Stack trace:
  └─ at file:///Users/ib/dev/deno/foo.js:7:1
```

Ref https://github.com/denoland/deno/issues/13367.
2024-01-24 14:20:51 +01:00
Asher Gomez aac0ad32bd
feat: deprecate Deno.FsFile constructor and Deno.FsFile.rid (#22072) 2024-01-24 13:36:35 +01:00
Asher Gomez c98ab51746
feat: deprecate Deno.read() and Deno.readSync() (#22063)
For removal in Deno v2.
2024-01-24 09:42:03 +05:30
Asher Gomez ea48bee3f7
feat: deprecate Deno.seek() and Deno.seekSync() (#22065)
For removal in Deno v2.
2024-01-24 09:39:56 +05:30
Asher Gomez 4c5ce90883
chore: update Deno.{fsync,fsyncSync}() deprecation notices (#22071)
To align with other deprecations.
2024-01-24 09:38:59 +05:30