Live data from Hacker News

Show HN: Minified.js – a fully-featured, 4K alternative to jQuery and MooTools

minifiedjs.com

41–50 of 145 posts

Re: Show HN: Minified.js – a fully-featured, 4K alternative to jQuery and MooTools

#41
post #37

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).

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.

Re: Show HN: Minified.js – a fully-featured, 4K alternative to jQuery and MooTools

#42
post #37

Earlier 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.

That's why it's called alternative, not a drop-in replacement.

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

#43

Thanks 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.?

Personally I don't think it's worthwhile to use a large number of micro-libraries, because of the huge overhead that comes with it. Every library has slightly different naming conventions, you have to be sure that they play well with another (e.g. compatible collections and Promises implementations), you don't have a single point to look for documentation and so on.

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

#44
post #6
post #4

Probably 4kB more than loading jQuery from cache :)

That was what I was thinking. What's the selling point since jQuery is already cached?

On average > 50% of visitors have an empty cache.

Re: Show HN: Minified.js – a fully-featured, 4K alternative to jQuery and MooTools

#46
post #37

Earlier 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.

I thought that 'alternative to jQuery or MooTools' makes it very clear that it's just a library that offers similar functionality, especially since I mentioned two completely incompatible libraries. Unfortunately I don't know any better way to describe what the library does and its scope in only a few words. "JavaScript framework" is also misleading, and "client-side JavaScript library" too generic. But I would be thankful for suggestions.

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

#48
Minified.js has potential. If given the chance, it will be successful and I for one love rooting for the under dogs. The Custom Builder is a lovely addition. The Library is well documented and easy to understand.

Trying it out right now! Nice work Tim.

Re: Show HN: Minified.js – a fully-featured, 4K alternative to jQuery and MooTools

#49
post #23
post #13

A 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.

Frankly it is an arbitrary number, mostly. I started with the goal of having no more than 7 functions, because that's the number of functions the first version had. It didn't take long for me to figure out that this wasn't enough for every-day use. My next goal was to be a number of magnitude smaller than jQuery, and thus 3.3kB. That was a lot better, but still not enough to be a viable alternative. So I settled with 4kB.

While 4kB may fit well in certain packet sizes, this does not help with HTTP headers that can easily have 100 bytes or more.

Post reply on HN