Coder Social home page Coder Social logo

Comments (4)

jsdevel avatar jsdevel commented on August 17, 2024

Very coincidental that you've opened this. Over the weekend I published difunc. It uses esprima which handles arrow functions (the current solution does not).

While object destructuring works great for shortening code, it doesn't validate that the dependency you're wanting to use is actually defined.

from open-api.

bugeats avatar bugeats commented on August 17, 2024

Very coincidental that you've opened this. Over the weekend I published difunc. It uses esprima which handles arrow functions (the current solution does not).

... and the entire babel runtime apparently. You'll probably find yourself updating regexes with every new JS runtime that comes out.

While object destructuring works great for shortening code, it doesn't validate that the dependency you're wanting to use is actually defined.

I don't find this to be a problem, and at a higher level I believe it to be fighting the nature of JS. Module tests are good enough for me.


Hmm... given that you just authored a project just for introspective dependency injection, I don't think we're ever going to agree on this topic. I wish you well, but at this point it's clear to me that I need to go in a different direction.

BTW, I was attracted to the word "unopinionated" when picking an openapi framework last week. IMHO, dep injection magic and forced directory layouts are not unopinionated. Might just want to embrace the opposite terminology.

from open-api.

jsdevel avatar jsdevel commented on August 17, 2024

I don't think we're ever going to agree on this topic. I wish you well, but at this point it's clear to me that I need to go in a different direction.

There are less abrasive means of engaging in dialog on github for an open source project that a maintainer is voluntarily donating their time to. I'm not opposed to any of your ideas. I appreciate you for raising your concerns. My goal is to make the framework better for everyone.

BTW, I was attracted to the word "unopinionated" when picking an openapi framework last week. IMHO, dep injection magic and forced directory layouts are not unopinionated. Might just want to embrace the opposite terminology.

  1. I'm not opposed to object destructuring. I just hadn't considered it as an option. And just because I published a package (difunc), doesn't mean I'm 100% sold on using it.
  2. I agree that babel-runtime is a non-starter. I'll remove that from difunc so it's not required.
  3. For me the danger in destructuring is the potential to unknowingly break your API by removing a dependency in .initialize. Up until now, users of express-openapi who've used the DI feature have had some level of confidence knowing that the framework has their back in terms of ensuring that the dependency is defined. With object destructuring there's no way to provide that guarantee. Stability is a priority for this framework.
  4. There's nothing forcing people to use DI. Going with object destructuring is just as opinionated as supporting angular style DI. There's also nothing stopping you from defining api documentation in the global api doc. This was added recently. I'm also open to PRs that provide support for wiring up the handlers through operation name or some other means.

from open-api.

jsdevel avatar jsdevel commented on August 17, 2024

See #96

from open-api.

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.