AmpersandJS / ampersand-router

Clientside router with fallbacks for browsers that don't support pushState. Mostly lifted from Backbone.js.
MIT License
70 stars 16 forks source link

ampersand-router pulls in underscore #30

Closed qubyte closed 9 years ago

qubyte commented 9 years ago

ampersand-router depends on underscore, but looking through the source the only non-trivial method used is extend, which can be more minimally done using a module such as object-assign. Alternatively, the individual lodash sub-modules available on npm are an option. For example isRegExp.

Some background: I'm working on something that I want to use ampersand-router with, but not the rest of ampersand (for now at least). It would be a shame to add underscore as an indirect dependency.

If this proposal seems good, I'd be happy to make a pull request.

kamilogorek commented 9 years ago

Hey @qubyte, it'll be replaced with https://github.com/AmpersandJS/amp/tree/master/modules/extend really soon, so please jut bear with us for a moment.

Actually we're using bind, extend, result, isRegExp and isFunction there.

Cheers!

qubyte commented 9 years ago

Thanks for the quick response, good to hear!

To clarify though, will you be keeping underscore for bind etc.? I know these are in use (I consider extend to be the only non-trivial method used here).

latentflip commented 9 years ago

@qubyte no, we'll be removing underscore entirely in all the ampersand core modules and replacing them with modules from http://amp.ampersandjs.com

qubyte commented 9 years ago

Lovely. :)