Skip to content

Commit 13ea8b6

Browse files
committed
Don't make people read the same thing twice
1 parent 4f9eefd commit 13ea8b6

File tree

1 file changed

+3
-30
lines changed

1 file changed

+3
-30
lines changed

UPGRADING.md

Lines changed: 3 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -4,42 +4,15 @@ This document describes breaking changes and how to upgrade. For a complete list
44

55
## 10.0.0
66

7-
This release upgrades to `abstract-level` 3. Please see its [upgrade guide](https://github.com/Level/abstract-level/blob/v3.0.0/UPGRADING.md) for details. On this end we'll only summarize its new features, because they're not supported in all environments.
7+
This release upgrades to `abstract-level` 3. Please see its [upgrade guide](https://github.com/Level/abstract-level/blob/v3.0.0/UPGRADING.md).
88

9-
In Node.js (but not browsers) you can now create "explicit snapshots" to read previous versions of a database:
10-
11-
```js
12-
await db.put('example', 'before')
13-
const snapshot = db.snapshot()
14-
await db.put('example', 'after')
15-
await db.get('example', { snapshot })) // Returns 'before'
16-
await snapshot.close()
17-
```
18-
19-
In Node.js with TypeScript (5.2) that last `close()` call can be skipped because we added support of [`Symbol.asyncDispose`](https://github.com/tc39/proposal-explicit-resource-management) on databases, iterators and snapshots:
20-
21-
```ts
22-
await db.put('example', 'before')
23-
await using snapshot = db.snapshot()
24-
await db.put('example', 'after')
25-
await db.get('example', { snapshot })) // Returns 'before'
26-
```
27-
28-
In Node.js and browsers you can use newly-added `has()` and `hasMany()` methods to check if keys exist without the cost of fetching values:
29-
30-
```js
31-
if (await db.has('fruit')) {
32-
console.log('We have fruit')
33-
}
34-
```
35-
36-
In Node.js you can (in certain cases) improve application performance using a new `getSync()` method that blocks the event loop but can be significantly faster than the asynchronous `db.get()` method:
9+
Not mentioned in that guide is the later addition of `db.getSync()`. This new method blocks the event loop but can be significantly faster than `db.get()`:
3710

3811
```js
3912
const value = db.getSync('example')
4013
```
4114

42-
Lastly, `has()`, `hasMany()` and `getSync()` also support explicit snapshots. Bon appétit!
15+
It is only supported in Node.js (via `classic-level`) and not in browsers.
4316

4417
## 9.0.0
4518

0 commit comments

Comments
 (0)