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
It's super confusing that for a given object with some props, JSON.strinfigy produces an object with a different set of props. Also, I really don't see any reason to override toString but that's a minor issue.
It's hard to imagine anyone can use FaunaDB driver with this design. That's not how JavaScript/TypeScript should be written (classes, getters, toJSON/toString overrides). People serialize things all the time. With the current design, it's not even possible to serialize the simple document with Ref.
parseJSON really should not be required. Not at all and definitely not in the browser (I don't want to bundle the whole driver just for parseJSON). Hopefully, this will be addressed with the new TypeScript version.
Evidently it is not, given that we have users today building on top of this driver. Issue closed. Come back when you can offer your technical expertise without the superfluous negativity.
It's super confusing that for a given object with some props, JSON.strinfigy produces an object with a different set of props. Also, I really don't see any reason to override toString but that's a minor issue.
It's hard to imagine anyone can use FaunaDB driver with this design. That's not how JavaScript/TypeScript should be written (classes, getters, toJSON/toString overrides). People serialize things all the time. With the current design, it's not even possible to serialize the simple document with Ref.
Related to #256, #222, #254
parseJSON really should not be required. Not at all and definitely not in the browser (I don't want to bundle the whole driver just for parseJSON). Hopefully, this will be addressed with the new TypeScript version.
Btw, if we really need a different type for serialization, for example, Date to a string, io-ts has a concept of Output type for such case. Check https://github.com/gcanti/io-ts-types/blob/master/src/DateFromISOString.ts
The text was updated successfully, but these errors were encountered: