connectivedx / Phoenix

http://connectivedx.github.io/Phoenix/
33 stars 5 forks source link

Add lodash to Phoenix #138

Open chadian opened 9 years ago

chadian commented 9 years ago

It's a base library that would easily save us a lot of time. It has a simple, clean API, is battle tested, and straight forward documentation. Covers a decent chunk of utility functions that we would probably end up writing ourselves each time, or worst the long hand form alternative. It's IE9 and up which should work, since we are focusing on dropping support for IE8.

https://lodash.com/

ajmueller commented 9 years ago

It looks like it has its modules separated pretty nicely on NPM. Do you think it would be better if we had more education about the modules available instead of including the whole library in the base of every project? Let's chat about this soon.

jdalton commented 9 years ago

:+1:

ajmueller commented 9 years ago

@jdalton thanks for checking this out! @chadian and I discussed this a week or so ago and my only hesitation about adding it to our base build is that it would add ~40% to our base JavaScript . I am an advocate for more education internally about what features lodash has so our devs can add only the modules they need for each project. The sites we build tend to not be terribly JavaScript heavy and for those that are, they'll more likely to be developed by a developer who has some knowledge of lodash and its features. @chadian remarked that the file size increase is merely that of a single small image and wouldn't add much to page load times. It's really a matter of weighing the cost/benefit. What are your thoughts?

stoff commented 9 years ago

Phoenix's native bias (because of what we do at Connective DX) is toward "traditional" brochureware sites. Because of this, I'd prefer to see lodash as an option to be turned on, not off. My thought is that it is included in packages.json as part of the build, but the actual require statement is commented out or alluded to with a comment. My reasoning is that for most brochureware, the utilities in jQuery are enough, and I don't want to create a situation where extra files get included in production because no one knew that they could be turned off, or had time to figure out that they should be turned off. Don't misunderstand - I am very excited to see this included, and it would be a very useful addition for the applications we do build. I just want to be cautious about how we frame its inclusion for a wider audience, and to avoid confusion about what Phoenix's base requirements are.