Giter Club home page Giter Club logo

Comments (6)

dominictarr avatar dominictarr commented on June 3, 2024 3

dude bro don't just slap an issue down like it's a graffitti on a bathroom stall, yo gotta write a poem or short story about why it should be

from depject.

NHQ avatar NHQ commented on June 3, 2024

"should be easy"

from depject.

NHQ avatar NHQ commented on June 3, 2024

Uhm, it's like simply showing up to a convention, I've already made my contribution here... where's the snack table?

But all right, give me the mic: I believe the proposed upgrade needs to work through each combination, starting at the top or bottom, not flatly combining all tha deps, so that if you have multiple layers, lyk dis:

combo = combine([a,c,b])
comboPlugin = combine([combo, x, y, z])
comboDelux = combine([comboPlugin, e, f, g])

then your deps will resolve according to the combinations; comboDelux will need the output of comboPlugin, which needs the output from combo. Or maybe it goes the other direction, idk, maybe it can go both ways...

from depject.

dominictarr avatar dominictarr commented on June 3, 2024

so, for this to work - combine would have to return an object with {gives, needs, create} on it. So then to start the app you'd just call combine([...]).create() and call it empty because you shouldn't have any needs left right? but if a combination of modules is missing a need when you call combine it would return an object with those needs expressed.

would it actually behave differently as long as the order is the same?

combine([a,b,c]) == combine([combine([combine([a]), b]), c]) == combine([a, combine([b, c])])

This would be the same behaviour if combine is just concat

from depject.

NHQ avatar NHQ commented on June 3, 2024

neat, but forcing an order is imho not desirable, in general, but specifically b/c that will make things break awfully if you require a bunch of a features, but don't know which order to concat them (at which point you've truly resurrected script tag madness, tyvm)

But I really must cease my conjectures, until further review, right after this last one:

no... no, I mustn't.

from depject.

dominictarr avatar dominictarr commented on June 3, 2024

I agree concat was terrible, but depject relives most of the pressure on order, because dependencies (needs) and exports (gives) are explicitly described. If a module does not call anything syncronously in it's create method there won't be problems with order. One pattern is to use setImmediate to delay setup like that. In early versions of depject (before 3) module dependency was resolved and loaded in order, but cycles broke that.

I also worry a bit about ordering. avoiding ordering makes merges easy! but some ordering is hard to avoid.

from depject.

Related Issues (19)

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.