Skip to content

Commit

Permalink
docs: add missing symbols to "Deno 1.x to 2.x Migration Guide" (denol…
Browse files Browse the repository at this point in the history
  • Loading branch information
iuioiua authored Sep 9, 2024
1 parent ae5ccac commit 37cb296
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions runtime/manual/advanced/migrate_deprecations.md
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,30 @@ methods instead.

See [Deno 1.40 blog post][Deno 1.40 blog post] for details.

### Deno.FsWatcher.prototype.return()

Ensure that the `Deno.FsWatcher` instance is closed once iteration is complete
by instantiating it with the `using` keyword.

```diff
- const watcher = Deno.watchFs("./foo/bar");
+ using watcher = Deno.watchFs("./foo/bar");
for await (const event of watcher) {
// ...
}
```

Alternatively, you can close the watcher resource by explicitly calling
`.close()`.

```diff
const watcher = Deno.watchFs("./foo/bar");
for await (const event of watcher) {
// ...
}
+ watcher.close();
```

### Deno.ftruncateSync()

Use
Expand Down Expand Up @@ -586,6 +610,10 @@ using listener = Deno.listenTls({

See [deno#12639](https://github.com/denoland/deno/issues/12639) for details.

### Deno.metrics()

There is no replacement API for this symbol.

### Deno.readAllSync()

Use [`readAllSync()`](https://jsr.io/@std/io/doc/read-all/~/readAllSync) from
Expand Down Expand Up @@ -708,6 +736,11 @@ Use the `.read()` method on the resource itself.

See [deno#9795][deno#9795] for details.

### Deno.resources()

There is no replacement API for this symbol, as resource IDs (RIDs) are being
phased-out.

### Deno.run()

Use [`new Deno.Command()`](https://docs.deno.com/api/deno/~/Deno.Command)
Expand Down

0 comments on commit 37cb296

Please sign in to comment.