Skip to content

Commit 4999db9

Browse files
committed
docs: add missing isReady breaking change
1 parent d0cce25 commit 4999db9

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

docs/guide/migration/index.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,26 @@ router.resolve({
168168

169169
**Reason**: Vue Router doesn't use `path-to-regexp` anymore, instead it implements its own parsing system that allows route ranking and enables dynamic routing. Since we usually add one single catch-all route per project, there is no big benefit in supporting a special syntax for `*`.
170170

171+
### Replaced `onReady` with `isReady`
172+
173+
The existing `router.onReady()` function has been replaced with `router.isReady()` which doesn't take any argument and returns a Promise:
174+
175+
```js
176+
// replace
177+
router.onReady(onSuccess, onError)
178+
// with
179+
router.isReady().then(onSuccess).catch(onError)
180+
// or use await:
181+
try {
182+
await router.isReady()
183+
// onSuccess
184+
} catch (err) {
185+
// onError
186+
}
187+
```
188+
189+
**Reason**: As Promises become available in all major browsers, we try to natively integrate them in Vue Router's API.
190+
171191
### Removal of `router.match` and changes to `router.resolve`
172192

173193
Both `router.match`, and `router.resolve` have been merged together into `router.resolve` with a slightly different signature. [Refer to the API](#TODO) for more details.

0 commit comments

Comments
 (0)