1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-12-02 17:01:14 -05:00
denoland-deno/cli/tests/testdata
Bartek Iwańczuk c62615bfe5
feat: Start warning on each use of a deprecated API (#21939)
This commit introduces deprecation warnings for "Deno.*" APIs.

This is gonna be quite noisy, but should tremendously help with user
code updates to ensure
smooth migration to Deno 2.0. The warning is printed at each unique call
site to help quickly
identify where code needs to be adjusted. There's some stack frame
filtering going on to
remove frames that are not useful to the user and would only cause
confusion.

The warning can be silenced using "--quiet" flag or
"DENO_NO_DEPRECATION_WARNINGS" env var.

"Deno.run()" API is now using this warning. Other deprecated APIs will
start warning
in follow up PRs.

Example:

```js
import { runEcho as runEcho2 } from "http://localhost:4545/run/warn_on_deprecated_api/mod.ts";

const p = Deno.run({
  cmd: [
    Deno.execPath(),
    "eval",
    "console.log('hello world')",
  ],
});
await p.status();
p.close();

async function runEcho() {
  const p = Deno.run({
    cmd: [
      Deno.execPath(),
      "eval",
      "console.log('hello world')",
    ],
  });
  await p.status();
  p.close();
}

await runEcho();
await runEcho();

for (let i = 0; i < 10; i++) {
  await runEcho();
}

await runEcho2();

```

```
$ deno run --allow-read foo.js
Warning
├ Use of deprecated "Deno.run()" API.
│
├ This API will be removed in Deno 2.0. Make sure to upgrade to a stable API before then.
│
├ Suggestion: Use "Deno.Command()" API instead.
│
└ Stack trace:
  └─ at file:///Users/ib/dev/deno/foo.js:3:16

hello world
Warning
├ Use of deprecated "Deno.run()" API.
│
├ This API will be removed in Deno 2.0. Make sure to upgrade to a stable API before then.
│
├ Suggestion: Use "Deno.Command()" API instead.
│
└ Stack trace:
  ├─ at runEcho (file:///Users/ib/dev/deno/foo.js:8:18)
  └─ at file:///Users/ib/dev/deno/foo.js:13:7

hello world
Warning
├ Use of deprecated "Deno.run()" API.
│
├ This API will be removed in Deno 2.0. Make sure to upgrade to a stable API before then.
│
├ Suggestion: Use "Deno.Command()" API instead.
│
└ Stack trace:
  ├─ at runEcho (file:///Users/ib/dev/deno/foo.js:8:18)
  └─ at file:///Users/ib/dev/deno/foo.js:14:7

hello world
Warning
├ Use of deprecated "Deno.run()" API.
│
├ This API will be removed in Deno 2.0. Make sure to upgrade to a stable API before then.
│
├ Suggestion: Use "Deno.Command()" API instead.
│
└ Stack trace:
  ├─ at runEcho (file:///Users/ib/dev/deno/foo.js:8:18)
  └─ at file:///Users/ib/dev/deno/foo.js:17:9

hello world
hello world
hello world
hello world
hello world
hello world
hello world
hello world
hello world
hello world
Warning
├ Use of deprecated "Deno.run()" API.
│
├ This API will be removed in Deno 2.0. Make sure to upgrade to a stable API before then.
│
├ Suggestion: Use "Deno.Command()" API instead.
│
├ Suggestion: It appears this API is used by a remote dependency.
│             Try upgrading to the latest version of that dependency.
│
└ Stack trace:
  ├─ at runEcho (http://localhost:4545/run/warn_on_deprecated_api/mod.ts:2:18)
  └─ at file:///Users/ib/dev/deno/foo.js:20:7

hello world

```

Closes #21839
2024-01-18 23:30:49 +00:00
..
assets chore(core): fix flaky flock_test on windows (#19477) 2023-06-12 20:30:29 +00:00
bench fix(bench): added group banner to bench output. (#21551) 2023-12-17 22:57:14 +00:00
benches refactor: move out test files from root testdata directory into sub directories (#15949) 2022-09-19 10:32:21 -04:00
bundle feat: upgrade deno_ast to 0.26 (#18795) 2023-04-21 21:16:25 +00:00
cache perf: more efficient deno cache and npm package info usage (#16592) 2022-11-11 11:33:57 -05:00
cert chore: update std to 0.208.0 (#21318) 2023-12-02 03:20:06 +01:00
check fix(check): should not panic when all specified files excluded (#21929) 2024-01-13 16:06:18 -05:00
commonjs chore: update copyright to 2024 (#21753) 2024-01-01 19:58:21 +00:00
compile fix(compile): preserve granular unstable features (#21827) 2024-01-06 19:31:09 +05:30
coverage fix(coverage): error if no files found (#21615) 2023-12-18 11:43:27 +01:00
doc perf: skip expanding exclude globs (#21817) 2024-01-08 17:18:42 +00:00
dynamic_import feat(cli): don't check permissions for statically analyzable dynamic imports (#18713) 2023-04-26 16:23:28 -04:00
encoding
eval chore(tests): ability to pattern match unordered lines (#20488) 2023-09-14 16:21:57 +00:00
file_extensions fix(cli): restore deno run - to handle stdin as typescript (#18391) 2023-03-23 12:45:43 -04:00
fmt feat(fmt): support formatting code blocks in Jupyter notebooks (#21310) 2023-11-27 10:32:12 -05:00
import_attributes chore: upgrade deno_core to 0.246.0 (#21904) 2024-01-14 18:28:46 -07:00
import_maps fix(lsp): resolve remote import maps (#20651) 2023-09-24 18:00:15 +01:00
info chore(tests): ability to pattern match unordered lines (#20488) 2023-09-14 16:21:57 +00:00
inspector feat: add --inspect-wait flag (#17001) 2022-12-12 15:33:30 +01:00
install feat: subcommands type-check only local files by default (#14623) 2022-05-17 23:53:42 +02:00
jsr feat(unstable): fast subset type checking of JSR dependencies (#21873) 2024-01-10 22:40:30 +00:00
jsx feat: precompile JSX (#20962) 2023-11-01 20:30:23 +00:00
jupyter feat(jupyter): don't require --unstable flag (#21963) 2024-01-18 23:16:14 +01:00
lint feat: add support for globs in the config file and CLI arguments for files (#19102) 2023-05-23 03:39:59 +02:00
lockfile feat: lockfile v3 (#20424) 2023-09-08 14:34:57 -04:00
lsp fix(lsp): remove quotes and period surrounding specifier in uncached messages (#19794) 2023-07-11 02:27:22 +00:00
malformed_config feat: auto-discover config file (#13313) 2022-01-17 20:10:17 -05:00
module_graph
node feat: "rejectionhandled" Web event and "rejectionHandled" Node event (#21875) 2024-01-12 22:10:42 +00:00
npm refactor: change tests to not rely on Deno.run() (#21961) 2024-01-17 02:18:19 +01:00
package_json chore(task): remove warning for npm "scripts" (#20880) 2023-10-12 07:33:59 +01:00
publish fix(publish): support deno.jsonc file (#21948) 2024-01-15 15:07:57 +00:00
repl refactor: move out test files from root testdata directory into sub directories (#15949) 2022-09-19 10:32:21 -04:00
run feat: Start warning on each use of a deprecated API (#21939) 2024-01-18 23:30:49 +00:00
runtime refactor: move out test files from root testdata directory into sub directories (#15949) 2022-09-19 10:32:21 -04:00
subdir fix(unstable): vendor cache should support adding files to hashed directories (#20070) 2023-08-06 12:25:48 -04:00
task fix(task): do not eagerly auto-install packages in package.json when "nodeModulesDir": false (#21858) 2024-01-08 19:30:36 -05:00
test refactor: change tests to not rely on Deno.run() (#21961) 2024-01-17 02:18:19 +01:00
tls fix(ext/net): implement a graceful error on an invalid SSL certificate (#20157) 2023-08-15 00:11:12 +00:00
tsc
tsc2
type_definitions
types refactor: move out test files from root testdata directory into sub directories (#15949) 2022-09-19 10:32:21 -04:00
vendor feat(vendor): support for npm specifiers (#19186) 2023-05-19 22:39:27 +00:00
webcrypto fix(ext/crypto): decode id-RSASSA-PSS with default params (#12147) 2021-10-01 11:14:16 +02:00
webgpu feat: bring back WebGPU (#20812) 2023-12-09 01:19:16 +01:00
workers chore: update copyright to 2024 (#21753) 2024-01-01 19:58:21 +00:00
allow_run_allowlist_resolution.ts fix(runtime/permissions): Resolve executable specifiers in allowlists and queries (#14130) 2023-08-30 18:52:01 +01:00
allow_run_allowlist_resolution.ts.out fix(runtime/permissions): Resolve executable specifiers in allowlists and queries (#14130) 2023-08-30 18:52:01 +01:00
cat.ts chore: update std submodule and its imports (#17408) 2023-01-15 21:09:26 +01:00
echo.ts
echo_server.ts chore: update std submodule and its imports (#17408) 2023-01-15 21:09:26 +01:00
env feat(unstable): deno run --env (#20300) 2023-11-01 15:21:13 +00:00
error_cause_recursive_aggregate.ts feat(cli): show error cause recursion information (#16384) 2022-10-26 15:37:45 +02:00
error_cause_recursive_aggregate.ts.out chore: bump deno_core and update tests (#21467) 2023-12-06 17:02:52 -07:00
error_cause_recursive_tail.ts fix: add error cause in recursive cause tail (#16306) 2022-10-16 21:16:46 +02:00
error_cause_recursive_tail.ts.out chore: bump deno_core and update tests (#21467) 2023-12-06 17:02:52 -07:00
navigator_language.ts feat: introduce navigator.language (#12322) 2022-10-18 15:33:35 +02:00
navigator_languages.ts feat: introduce navigator.language (#12322) 2022-10-18 15:33:35 +02:00
spawn_kill_permissions.ts chore(cli): Don't assume deno is in path for spawn_kill_permissions (#19198) 2023-05-22 09:54:58 -06:00
symlink_to_subdir
welcome.ts chore: update std to 0.208.0 (#21318) 2023-12-02 03:20:06 +01:00