Comments (6)
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.
"should be easy"
from depject.
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.
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.
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.
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)
- idea: depject image manipulation app based around canvas HOT 4
- module terminology HOT 2
- overriding give/needs on a specific module
- idea: depject app as script tags HOT 4
- gives and needs sugar HOT 7
- better error message for when needs: true
- [apply] super / extend / around HOT 3
- has anyone used reduce yet? HOT 12
- [apply] be able to pass in custom apply function HOT 8
- better error message when created plug is not a function HOT 1
- dynamic modules HOT 8
- A needed module that returns a number returns undefined if the number is zero HOT 1
- should `combine` and `first` order be reversed? HOT 7
- Using reduce for decorators HOT 11
- module path override is undocumented HOT 8
- a silly idea: frameworks and plug paths as files paths
- examples make no sense HOT 1
- asynchronous create functions? HOT 2
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 depject.