Comments (3)
The id
property is needed for VueFire to apply certain optimizations, as noted in documentation. You will need to name your property something else. Adding a dot in front makes it annoying to use object['.id']
in v-for loops and db writes that's why it wasn't used.
Regarding other properties, that same page also explains how to add custom data to the document. Adding everything by default would bloat the data, especially in SSR.
from vuefire.
Yes, it may be annoying, but it at least does not break things which is more importance.
You will need to name your property something else.
If this issue is not planned to be fixed, this should be stated in document with highlighting.
But I think, Vuefire should use .id
internally, user can still define a custom converter to add a id
field back to the object and keep v-for clean. So that, .id
is not annoying any more. BUT, now we have NO WAY to get the real id field in document even adding custom converter since vuefire is not working properly with a "wrong" id.
Since useDocument() return VueFirestoreDocumentData, defining a global firestore converter does not make typescript happy when reading other field. Type casting or bypassing the TS rule every where is needed, it is annoying.
How about just add ref by default? If it is still too big to have a DocumentReference object, a full path string is still very useful for everyone.
I really hope this issue be fixed, this commit may help.
from vuefire.
For the moment, id
is a very practical default and will likely stay that way. What is actionable in the near future is allowing overwriting the global type so one can customize the global converters while things being typed and of course document it with some practical examples like adding the ref like you propose
from vuefire.
Related Issues (20)
- First SSR call to useDocument fails but refresh and second call works HOT 6
- Currently you are not able to use auth module without a service account
- Readonly `id` field is undefined by default (despite filled other data)
- Support Multi tenancy HOT 2
- Customize cookie minting auth endpoint path
- Doesnt with NuxtImage
- ProtobufJS critical dependency vulnerability HOT 1
- firebase sensitive data (.env) appear when view page source HOT 1
- Add the Nuxt VueFire example repos to the docs. HOT 1
- Dependency errors for latest versions of `firebase-functions` and `firebase-admin` HOT 9
- Nuxt Module is not compatible with `compatibilityVersion: 4` HOT 3
- Nuxt Crashes During Prerendering with Vuefire Module
- [Bug]: `@firebase/component/dist/index.cjs.js' does not provide an export named 'Component'` HOT 1
- Nuxt module support for firebase-admin 12.x and firebase-functions 5.x
- Awaiting current user with Nuxt3
- `useFirestore` should allow to select a non `(default)` database HOT 2
- `vitest` run in a `nuxt-vuefire` project results in warnings about INTERNAL ASSERTION FAILED (@firebase/auth) HOT 3
- useFirestore breaks the app when used in a function in the utils folder and the page is refreshed (nuxt)
- Appcheck with Custom Provider HOT 1
- Vuefire + Nuxt3 Layers seems broken
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vuefire.