Comments (3)
Okay, after inspecting the codebase a little closer, I already regret promising that PR 😄
I'm all for putting my money where my mouth is, however, the coupling with class-validator is quite tight. It permeates a good portion of the code base. The tests reach far into class-validator's internals, where it really should be agnostic and just be based on a contract. The validation error type from class-validator is replicated here, which makes it difficult to adapt to other libraries.
Please don't take this as critisism in any way. These were just my observations trying to estimate the work required to implement my ideas. At the moment, I can't invest the the time needed to decouple fireorm and class-validator and properly test it. Especially since I'm not very initimate with the code base to begin with.
Since my hack was rather trivial, I expected the changes required to be minimal. So I guess I'll just leave this here as a suggestion and should you ever find the time to implement it, I'll be among the takers.
from fireorm.
Thanks for your help @juni0r! How coupled fireorm is with class-validator is one of the reasons I don't like the integration. Thanks for your help, your insights have been helpful!
from fireorm.
That's an excellent idea.
I didn't really loved the dependency on class-validator and having to do hacks like this to provide good DX.
Instead of returning Array<any>
I'd try to return an array of a type parameter you pass to initialize, if that doesn't work at least I'd try to return an array of unknown
.
Go ahead and make the PR, we can continue the discussion there.
from fireorm.
Related Issues (20)
- Can't resolve 'class-validator' typescript HOT 1
- Support for BulkWriter HOT 2
- Getter methods decorated with @Ignore() are still saved HOT 2
- plainToClass is undefined HOT 2
- TypeError: classTransformer.plainToClass error when trying to find document from DB HOT 2
- Rename id in collection to _id HOT 2
- The result of build has some nulls removed
- Error: Collection with name ClubPlayers has already been registered HOT 1
- how to parameterize the complex query options? HOT 1
- There is a way to auto query subcollections? HOT 2
- If we are inside a transaction, our subcollections should also be TransactionRepositories HOT 1
- Querying subcollection of subcollection seems to inject random doc number on its path HOT 1
- SubCollection does not create HOT 2
- Project Status HOT 2
- Querying missing fields HOT 3
- Add firestore timestamps to entities HOT 1
- Error: Firestore must be initialized first - on using customRepository HOT 2
- firebase-admin SDK Timestamps no longer compatible with fireorm collection-update method HOT 1
- Feature Request: Graceful Handling of Duplicate Collections/Subcollections for Fireorm v >=0.18.0 HOT 1
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 fireorm.