You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/cookbook/migration-v2-v3.md
+51-2Lines changed: 51 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,7 +9,7 @@ Therefore, these are the requirements to upgrade to VueFire v3:
9
9
10
10
## General recommendations
11
11
12
-
VueFire 3 introduces a Composition API that is more flexible and powerful than the Options API. It keeps the existing Options API as a wrapper around the Composition API but we recommend you to give the Composition API a try as it gives you more control over your data state.
12
+
VueFire 3 introduces a Composition API that is more flexible and powerful than the Options API. However, it keeps the existing Options API as close as possible to the existing version in v2. Internally, it is implemented as a wrapper around the Composition API.
13
13
14
14
## Breaking changes
15
15
@@ -20,9 +20,58 @@ Firestore supports a native equivalent of the `serialize` option: [Firestore Dat
20
20
VueFire does support a **global `converter` option** that is equivalent to the previous global `serialize` option. Note that, like the its predecessor `serialize`, VueFire uses a default converter that adds the `id` property to your data, you can import it to use it:
21
21
22
22
```ts
23
-
// TODO:
23
+
import { firestorePlugin } from'vuefire'
24
+
import { createApp } from'vue'
25
+
26
+
const app =createApp(App)
27
+
app.use(firestorePlugin, {
28
+
converter: {
29
+
toFirestore() {
30
+
// ...
31
+
},
32
+
fromFirestore() {
33
+
// ...
34
+
}
35
+
}
36
+
})
24
37
```
25
38
39
+
If you were using it locally when calling `$bind()`, you should now use the `.withConverter()` method on your data source:
const data =firestoreDefaultConverter.fromFirestore(snapshot, options)
64
+
returnnewUser(data)
65
+
}
66
+
})
67
+
```
68
+
69
+
### Rename `$bind` to `$firestoreBind`
70
+
71
+
The `$bind` method is now called `$firestoreBind` to avoid conflicts with other libraries. In the same way, `$unbind` is now called `$firestoreUnbind`.
72
+
73
+
The `$rtdbBind` and `$rtdbUnbind` methods are unchanged.
0 commit comments