Git Product home page Git Product logo

Comments (3)

juni0r avatar juni0r commented on June 30, 2024 1

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.

wovalle avatar wovalle commented on June 30, 2024 1

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.

wovalle avatar wovalle commented on June 30, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.