bower / registry

The Bower registry
https://registry.bower.io/packages
MIT License
292 stars 66 forks source link

Faster dep resolution #48

Closed sindresorhus closed 8 years ago

sindresorhus commented 10 years ago

Stumbled upon this thread: https://groups.google.com/forum/#!topic/componentjs/rkCMeRlpnPU

simple idea but I wanted to get some feedback. now that I'm crawling around in npm I'm realizing how much it could gain from optimizing on the server side for dep resolution. I was thinking the client wouldn't ask for a semver version of a package, the client would send the entire dep tree, it gets fully resolved on the server & not a single dupliate in-flight request occurs.

Npm's way of dealing with this isn't as eager so it's not only really complicating client code but wasting network traffic, and from the resolving point of view there's a bunch of hacky non-eager crawling to see if the parent has the dep yet etc. Curious for feedback but I think this would be a lot more elegant

I think that's a really good idea and it might be smart of us to explore it too.

wibblymat commented 10 years ago

This works well when the full dependency tree is resolvable by the server. But let's say that I depend on angular: * and on foo: git://my-private-git-server/foo.git. If foo depends on angular: 1.0.1 that changes the dependency tree in a way that the server can't see.

sheerun commented 8 years ago

Unfortunately it's not possible (or quite hard to implement) for bower as we're using highly dynamic source repositories instead managed registry like npm.

I could imagine one could create 3rd party app for accelerating bower resolving though.