Sure, I can switch my code to use this, but how compatible is this with common 3rd party libraries that are dependent on jquery? For example, will this run the bootstrap js code ok? If it doesn't run that code cleanly, then we are still stuck importing jquery.
Not at all. While some things use a similar syntax, Minified is not compatible with jQuery (and does not try to be).
Show HN: Minified.js – a fully-featured, 4K alternative to jQuery and MooTools
41–50 of 145 posts
Re: Show HN: Minified.js – a fully-featured, 4K alternative to jQuery and MooTools
#42Earlier quoted context omitted.
Not at all. While some things use a similar syntax, Minified is not compatible with jQuery (and does not try to be).
Anyone working on a project that has the remote chance of ever including a 3rd party dependency on jquery should never use this project. Otherwise you risk ending up needing to import jquery AND this project and now you're even farther down the rabbit hole.
But yes, your point is valid. Also, jquery is so ubiquitous that I see no reason to steer clear of it. If you use a CDN version of it, it's most probably already in client's cache.
Re: Show HN: Minified.js – a fully-featured, 4K alternative to jQuery and MooTools
#43Thanks for putting this out there. I understand this is supposed to be a swiss-army-knife style library, but I thought we were moving toward focused (Unix philosophy) libraries. For example, why would I use your HTTP request functionality when I could use Superagent, microjax, etc.?
Also, if you want to optimize for file-size, you won't get very good results with a collection of micro-libraries. A compiler like Closure is capable of inlining functions and removing unused code only as long as you have all of it in a single file as private functions. But when every library exports all its features, Closure is not able to optimize them properly anymore.
Re: Show HN: Minified.js – a fully-featured, 4K alternative to jQuery and MooTools
#44Re: Show HN: Minified.js – a fully-featured, 4K alternative to jQuery and MooTools
#45So where does this library compromise? Why isn't jQuery this small?
Re: Show HN: Minified.js – a fully-featured, 4K alternative to jQuery and MooTools
#46Earlier quoted context omitted.
Not at all. While some things use a similar syntax, Minified is not compatible with jQuery (and does not try to be).
Anyone working on a project that has the remote chance of ever including a 3rd party dependency on jquery should never use this project. Otherwise you risk ending up needing to import jquery AND this project and now you're even farther down the rabbit hole.
And yes, if you want to use third-party libraries that use jQuery, using Minified does not make any sense. Currently it's mostly interesting if you want complete control over your JS environment and want to optimize for size.
Re: Show HN: Minified.js – a fully-featured, 4K alternative to jQuery and MooTools
#47(disclaimer: I'm one of the authors)
Re: Show HN: Minified.js – a fully-featured, 4K alternative to jQuery and MooTools
#48Trying it out right now! Nice work Tim.
Re: Show HN: Minified.js – a fully-featured, 4K alternative to jQuery and MooTools
#49A novice question - how significant is the relative size here. Sure - 4 is smaller than 32, but is that really the biggest concern with a JS library (and modern internet speeds)?
In my opinion absolute relative size is actually less important than how many TCP roundtrips it takes. It is no accident the author of this library is trying to fit in under 4KB specifically.
While 4kB may fit well in certain packet sizes, this does not help with HTTP headers that can easily have 100 bytes or more.
Re: Show HN: Minified.js – a fully-featured, 4K alternative to jQuery and MooTools
#50The more experienced I become as a programmer, the more respect I have for minimal programs that work very well. It's often very hard to "work your way up to simplicity," as my father likes to call it. (He's an EE.)