Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update deprecated APIs for Deno v1.40 #1234

Merged
merged 12 commits into from
Jan 24, 2024
47 changes: 47 additions & 0 deletions docs/rules/no_deprecated_deno_api.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,3 +114,50 @@ function foo(file: Deno.FsFile) {
// ...
}
```

- `Deno.fdatasync`
- `Deno.fdatasyncSync`

`Deno.fdatasync` and `Deno.fdatasyncSync` are deprecated in favor of
`Deno.FsFile.datasync` and `Deno.FsFile.datasyncSync` respectively.
bartlomieju marked this conversation as resolved.
Show resolved Hide resolved

- `Deno.fsync`
- `Deno.fsyncSync`

`Deno.fsync` and `Deno.fsyncSync` are deprecated in favor of `Deno.FsFile.sync`
and `Deno.FsFile.syncSync` respectively.
bartlomieju marked this conversation as resolved.
Show resolved Hide resolved

- `Deno.isatty`

`Deno.isatty` was deprecated in favor of `Deno.stdin.isTerminal()`,
`Deno.stdout.isTerminal()` and `Deno.stderr.isTerminal()`.

### Invalid:

```typescript
Deno.isatty(Deno.stdin.rid);
Deno.isatty(Deno.stdout.rid);
bartlomieju marked this conversation as resolved.
Show resolved Hide resolved
Deno.isatty(Deno.stderr.rid);
```

### Valid:

```typescript
Deno.stdin.isTerminal();
Deno.stdout.isTerminal();
bartlomieju marked this conversation as resolved.
Show resolved Hide resolved
Deno.stderr.isTerminal();
```

- `Deno.resources()`

Deno.resources() was deprecated. There are no replacements for this API.

- `Deno.metrics()`

Deno.metrics() was deprecated. There are no replacements for this API.

**HTTP server API**

- `Deno.serveHttp`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add examples for Deno.close()/Deno.write etc too?


`Deno.serveHttp` was deprecated in favor of `Deno.serve`.
Loading
Loading