9 ms·
Show HN: Minified.js – a fully-featured, 4K alternative to jQuery and MooTools
- Link- 13y agoNice work! But it always starts small, then users need a feature here, a feature there next thing you know you have a fat ass library just like the pre-existing ones.
- tjansen 13y agoActually my goal is that the library will always stay under 4kB. Setting yourself a limit is the only way to prevent feature creep, and 4kB seems quite ok. Over time, when support for older browsers can be dropped, there will be space for additional features. I am already working on a second <4kB module though, with support for collections, strings, templates, dates and number/date formatting and parsing. So yes, I know that 4kB is not realistic goal for a complete app framework. But I am confident that I can do it in 12-16 kB.
- Link- 13y agoThe problem with optimization is that you always have to compromise, either speed, features and performance for size or features and size for speed etc.. I think a probable solution would be to create a dynamically generated framework which allows the user to specify the needed features (jQuery-ui style).
- tjansen 13y agoActually there's a builder that allows you to pick the functions you need and compiles custom versions: http://minifiedjs.com/builder/ http://minifiedjs.com/builder/ I don't think that this is a practical approach for most people though. After a while it becomes quite annoying to create a new version everytime you need a function. It would be great, but unfortunately also quite difficult, to automate this.
- rschmitty 13y agoIs this the full comparison? http://minifiedjs.com/#featCmp http://minifiedjs.com/#featCmp It seems like that would cover most things I would use, however surely there is more to jquery (that I may or may not be using..) I like that they are including IE6-8, that was a bummer when zepto came out aimed at mobile/modern only
- tjansen 13y agoWhat exactly would you miss (other than some utilities like each(), which are I would like to keep out of the library)? Actually one of the ways I used to decide what features to squeeze in was making a list of all jQuery functions and re-implementing the functionality with Minified. To make sure that I don't miss anything important. There are some things that are more complicated to do, because you need to work with anonymous functions, but honestly most of them were functions that I had never heard of before and would probably have re-implemented even when using jQuery :)
- rschmitty 13y agoThats what I was asking lol :) When I look at that list it seems like it covers most of what I do, was just curious. Like "jquery gives you all of this, do you really use all of it?" I suppose it's a bad sign when we are using jquery blindly and not really knowing what all that includes..
- mtrimpe 13y agoBy the way ... one big use case I'm seeing for jQuery replacements lately is being a drop-in replacement for BackBone apps, since they need just a tiny fraction of jQuery's capabilities but do carry around all it's weight for no particularly good reason. I'm not sure if Minified.js qualifies for that, but if it does you should definitely make a bigger point of that ;)
- mattmanser 13y agoSizzle is actually a big one, CSS1 doesn't really cut it for anything but the most trivial use cases, although if you're only targeting modern browsers than I guess you can rely on their support. Also, if you don't support each, I assume you don't support method chaining on enumerables? As for actual missing features, the jQuery data stuff is really useful, but if the intention is to use minified with something like backbone, I guess it's kinda moot. EDIT: I forgot to say nice library and I like the source code too.
- colinm 13y agoProbably 4kB more than loading jQuery from cache :)
- nawitus 13y agoThat was what I was thinking. What's the selling point since jQuery is already cached?
- rschmitty 13y agoAt one time jquery wasnt cached... and when you want to use a new version of jquery, there goes your cache anyways. Doesnt seem like a really big argument against, especially considering the size of the library for the first non-cache hit
- ricardobeat 13y agoOn average > 50% of visitors have an empty cache.
- dclowd9901 13y agoAre people really referencing jquery from other servers in production environments?
- adventured 13y agoYes, it's extremely common to call jQuery from, for example, Google's googleapis.com domain. Here's a quick sampling from a random group of top sites: stackoverflow.com (googleapis.com), kickstarter.com (googleapis.com), cnn.com (their own cdn), businessinsider.com (jquery.com), foxnews.com (their own cdn), nbcnews.com (aspnetcdn.com), espn.com (espncdn.com), tumblr.com (secure.assets.tumblr.com), lastfm.com (googleapis.com), lyricsmode.com (googleapis.com), reference.com (sfdict.com, cdn for ask etc), qz.com (googleapis.com), theverge.com (googleapis.com), ehow.com (googleapis.com), wikia.com (googleapis.com), chacha.com (googleapis.com)
- toble 13y ago
- Nurdok 13y agoA 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)?
- mtrimpe 13y agoSize itself is actually not that important. The time to load and process it still is to some degree, especially on mobile, and that increases almost linearly with size.
- adventured 13y agoIt's meaningful in a few ways I can think of. 1) For poorer countries with spotty internet, or mobile only that is slow. 2) For mobile, where data use matters. 3) Ideally with a library this small, it's mostly doing exactly what you need it to and nothing else. So it should be faster for what you're using it for. It's not trying to be all things to all people, and the trade off for that should be giving up long-tail features in exchange for more speed.
- markdown 13y ago> Sure - 4 is smaller than 32, but is that really the biggest concern with a JS library (and modern internet speeds)? Yes, it is.
- recuter 13y agoIn 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.
- tjansen 13y agoFrankly 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.
- dfischer 13y agoHow does this compare to Zepto.js?
- Ziomislaw 13y agohas support for old browswers
- detay 13y agonot enough jquery.
- ggurgone 13y agoDid you make performance tests and comparisons with other libraries?
- tjansen 13y agoNo, actually I wasn't really interested in that yet. I wouldn't expect it to be that bad performance-wise, but if performance would be my goal, there'd be a number of things I would have done differently. I also guess that almost all sites the cost of parsing and executing the libraries is more significant than the actual runtime. I mean, there are sites that parse 200kb of ungzipped source code only to execute the 2 kb of them that are required to have some pull-down menus or sliders a couple of times.
- ggurgone 13y agoIn the real world preformance matters my friend. Personally I care more about that than 4kb vs 32 or 69 :P
- LocalPCGuy 13y agoI would make this a priority if you want to try to differentiate in something besides size as compared to jQuery. Performance is quite important, and I frequently find myself spending the time testing pure JS solutions compared to a jQuery solution to make sure my code is optimized. jQuery does a really good job in this regard most of the time, but there is always room for improvements.
- Alex3917 13y agoThis is interesting, but what percentage of the time spent downloading jQuery is actually transferring the file? I would imagine that jQuery is already small enough that the majority of the time is spent just establishing the server connection.
- SkyMarshal 13y agoMost browsers probably have all versions of it cached by now too.
- graue 13y agoTest this, you might be surprised. I strongly doubt it, because there are so many versions in use, and as of 2012 only 25% of jQuery sites even used Google CDN, by far the most popular CDN — most hosted it elsewhere. http://royal.pingdom.com/2012/06/20/jquery-numbers/ http://royal.pingdom.com/2012/06/20/jquery-numbers/ I have vague memories of reading a post with a stronger conclusion — that CDN caching was basically a non-issue, it would so rarely work — but to my frustration I can't find that right now.
- youngtaff 13y agoYou might be looking for this - http://statichtml.com/2011/google-ajax-libraries-caching.html http://statichtml.com/2011/google-ajax-libraries-caching.htm...
- graue 13y agoYes! Thank you. tl;dr for lazy HN readers: "using Google's CDN to load jQuery isn't likely to benefit the majority of your first-time visitors." As of 2011, jQuery 1.4.2 was by far the most common version and even that was only loaded via googleapis.com on 2.7% of websites.
- youngtaff 13y agoThe most commonly used version is slightly better these days http://www.stevesouders.com/blog/2013/03/18/http-archive-jquery/#comment-37023 http://www.stevesouders.com/blog/2013/03/18/http-archive-jqu... Note the difference in version Steve found vs my comment (due to query strings etc., which will of course destroy caching)
- latchkey 13y agoSure, 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.
- tjansen 13y agoNot at all. While some things use a similar syntax, Minified is not compatible with jQuery (and does not try to be).
- latchkey 13y agoAnyone 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.
- lrem 13y agoThat'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.
- LocalPCGuy 13y agoThe point about the CDN cache is not true. It is commonly claimed, but often times it is not the case that jQuery is often cached if you use a CDN. It is "sometimes" cached, and best performance for most websites is probably to concatenate and minify jQuery in with the site's JS files.
- lrem 13y agoI can see why your statement can be true, but do you have any actual data on this? Or are we both just guessing? ;) (No, I don't have data on mine, I don't even work in this field.)
- robinduckett 13y agoIt's a bit misleading when you say Zepto has no AMD support, when it actually does.
- tjansen 13y agoIn the standard version on zeptojs.com? Just did a short search on the source code and can't find any 'define' invocations.
- pearjuice 13y agoSo where does this library compromise? Why isn't jQuery this small?
- ricardobeat 13y agojQuery has a lot of bloat from edge cases and bugs accumulated over the years, and still ships with it's own selector engine.
- tjansen 13y agoThere are a lot of specialized features in jQuery that Minfied does not have. For example, the only way to register an event with Minified is using on(). jQuery has on() as well, but it also has a number specialized functions like 'click()' and the legacy 'bind()'. Another example are jQuery's the complex selector/stacked set features, like 'andSelf()' or 'next()'. Minified only has simple lists and a couple of callback-using helper methods like 'collect()' and 'filter()'. If you are doing something complex and know jQuery's API well enough, jQuery is more powerful.
- Yver 13y agoIt's nice to see a library use Closure Compiler's advanced compilation mode.
- tjansen 13y agoWhat's funny is that it hardly makes any difference. If you feed the source code into Closure in advanced mode, the size is 9258 bytes pre-gzip and 4109 post-gzip. In simple mode, the numbers are 9267 pre-gzip and ... also 4109 post-gzip! It was hardly worth the (relatively huge) effort to get the library working correctly in advanced mode. BTW to get down to the final size of 4089, I compress the source code with Closure Compiler in Advanced Mode, and then compress again using UglifyJS to get rid of the last 20 bytes. Closure is not perfect...
- cromwellian 13y agoThat's mostly because its a library, and so most of the optimizations you're getting are purely local in-method and no dead-code pruning. Where Closure shines is building an app whole-world, compiling both the client code, and library code together, then it can prune away all unused methods in the library.
- ahallock 13y agoThanks 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.?
- tjansen 13y agoPersonally 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.
- ricardobeat 13y agoRyeJS is another alternative, though it focuses on speed, modularity and having an understandable source instead of size. Clocking at 6.2kb. http://ryejs.com/ http://ryejs.com/ (disclaimer: I'm one of the authors)
- przemoc 13y agoFocus on speed and modularity next to the clear code sounds interesting, but supporting IE 9+ only is kind of a bummer here, because it means "no" for XP users (I use XP64 on my desktop for instance) and there is still substantial number of them. (And I do curse Microsoft for making IE 9 Vista+ only browser, which is quite likely explainable by use of some shiny new undocumented API, that wasn't available in XP and before. Microsoft and their browser tightly coupled with OS...)
- deleted 13y ago[deleted]
- ricardobeat 13y agoIt does support it if you include es5-shim, though IE8 is effectively dead. It's at < 5% share globally, around the same point we all dropped IE6 in the past, and effectively at 0% for any web service / startup out there. It's commonly surpassed by visits from Safari/iOS/Android. Firefox, Chrome and Opera are available for Windows XP :)
- tmzt 13y agoI wonder if libraries from Wine or Reactos could be used to run IE9 on XP. I seriously doubt the reasons Microsoft gave for not supporting it are valid. Even if the sandbox mode could not be used there is no reason why the browser and rendering engine could not run on XP if the proper system DLLs were present, and these could have easily been included with the install as Microsoft does in many other cases.
- yuhong 13y agoUndocumented?
- samguddy 13y agoMinified.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.
- api 13y agoLove it! The 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.)
- hippich 13y agoIn case you need mobile support and not IE, also checkout Zepto. I updated test with Zepto - http://jsperf.com/test-jquery-vs-minified/4 http://jsperf.com/test-jquery-vs-minified/4 URL: http://zeptojs.com/ http://zeptojs.com/
- camus 13y agoPoor name , sounds like a uglify like lib , not a DOM manipulation lib. You should changed it. And it's no alternative to jQuery or Mootools since your lib doesnt support a lot of stuffs these libs provide.
- bpicolo 13y agoNot providing the same features doesn't mean it isn't an alternative. It has different goals.
- VMG 13y agoThe headline says fully featured
- tjansen 13y agoAnd I believe it is. It does not support every single feature that jQuery and MooTools have, but you probably wouldn't say that jQuery is not fully featured because it lacks support for Cookies and color animation. It's true that Minified doesn't support many features in the same breadth as the other libraries. Instead the focus is on making the essentials easy (often easier) and offering you powerful functions to do the rest. Basically that's how I keep both API size and file size down.
- wiradikusuma 13y agothis looks good! probably its sweet spot is for HTML5-based apps, e.g. PhoneGap, BlackBerry WebWorks and even Firefox OS.
- gioele 13y agoI see a licensing problem. Releasing thing into the public domain is not as easy as writing "Minified has been released into the Public Domain. You can use, copy, distribute and modify Minified without any copyright restrictions. You may even release it under your name and call it yours, if that's your thing." As the CC0 page explains [1]: > a waiver may not be effective in most jurisdictions > Dedicating works to the public domain is difficult if not impossible for those wanting to contribute their works for public use before applicable copyright or database protection terms expire. Few if any jurisdictions have a process for doing so easily and reliably. Please use a proper PD waiver tool such as CC0. [1] http://creativecommons.org/about/cc0 http://creativecommons.org/about/cc0
- tjansen 13y agoI have CC0 on the download page, but yes, I should also add this to the source code. Thanks.
- wassago 13y agoLooks good! Added it to the official list of frameworks on JSFiddle.
- ctoestreich 13y agoJust on the surface the potential for the minified library with its reduced size and browser support sounds great. In just checking a few features it seems as though the performance doesn't line up with jquery atm. In a large application space would I rather trade off js performance for saving initial DL time (cache)? I start to wonder where diminishing returns set in, if I should I really care about IE6 anymore or if the clean and simple API you say won't change will in fact never change. http://jsperf.com/test-jquery-vs-minified http://jsperf.com/test-jquery-vs-minified And to the community at large, feel free to add more tests.
- tjansen 13y agoThat's cool, thank you (even if the results don't look so good, but it's not that surprising).
- microcolonel 13y agoWhy use the .val() method with the jQuery test, but .text() for the minified test?
- Wintamute 13y agoThe full, concatenated and uglified source of one-page JS web apps can easily run to >600kB. Whether my DOM manipulation library consumes 4kB of that or 35kB isn't especially important to me. I'm more concerned about features, cross browser support and familiarity other developers may, or may not have, with the API. I'll be happy to check this lib out though, the API and docs look nicely put together.
- sehrope 13y agoThis is even more so if your site is served over HTTPS given the latency for the initial SSL handshake[1]. Even better not to load anything and have it properly cached on the client side. If you do it right you don't even have the client send/receive an HTTP 304. For our app we have a lot of modular dependencies but we serve all of them from a unique prefix per build (eg. 'assets-SHA(build)/js/foo.js'). The second page load and beyond has zero requests for the same static asset. Whenever we have a new build of the app the unique prefix gets auto updated to force clients to use the latest versions. For HTTPS make sure to mark your assets as public or they won't be cached: Cache-Control:max-age=31557600, public [1]: http://www.semicomplete.com/blog/geekery/ssl-latency.html http://www.semicomplete.com/blog/geekery/ssl-latency.html
- corresation 13y agoWhether my DOM manipulation library consumes 4kB of that or 35kB isn't especially important to me. Now that jQuery 2.x drops IE 8- support, a credible question is whether such libraries (which are more in the 95KB range, minified) are even necessary at all. Quite outside of the time to download, there is a measurable cost to parse all of that boilerplate code as well. This has more of an impact on mobile, obviously.
- dmethvin 13y ago> Now that jQuery 2.x drops IE 8- support, a credible question is whether such libraries (which are more in the 95KB range, minified) are even necessary at all. Well my answer to the credible question is that jQuery has to normalize and fix bugs for just about all the browsers it supports, it's not just an oldIE problem. Plus, jQuery provides abstractions above the basic DOM operations which are pretty low level. So if you don't want to use jQuery you'd probably want some other library to provide equal or greater abstraction. > Quite outside of the time to download, there is a measurable cost to parse all of that boilerplate code as well. This has more of an impact on mobile, obviously. Measurable of course. Significant as a portion of the page load time for most pages? Well that's a different thing. And of course if you want it, jQuery 1.8+ provides the ability to create custom builds if you know you don't need parts of it.
- przemoc 13y agoI see: tml xmlns:fn="http://www.w3.org/2005/xpath-functions" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:page="http://tjansen.de/minifiedPage" xmlns:i="http://tjansen.de/internal" xmlns="http://www.w3.org/1999/xhtml"> at the top of the page. Apparently the minification went too far. :)
- platz 13y agoWhat about event delegation? In JQuery there exists an overload to .on() that can pass a selector string to filter the descendants of the selected elements that trigger the event. Is there something similar in Minified?
- tjansen 13y agoNo, not directly. From the jQuery API docs: $("#dataTable tbody").on("click", "tr", function(event){ alert($(this).text()); }); In Minified, the easiest way to get exactly the same event handler is this: $("#dataTable tbody").each(function(tbody) { $('tr', tbody).on("click", function(){ alert($(this).text()); }, tbody);
- dmethvin 13y agoThat's not exactly the same at all.
- tjansen 13y agoWhere's the difference? Admittedly I don't know that function in jQuery very well, but I though it would register a 'click' handler for every tr, just with the difference that it passes the parent tbody instead of the tr in 'this' to the handler. What else does it do?
- LocalPCGuy 13y agoI love what you are doing, but if you are trying to provide a comparable framework, a thorough understanding of what the functionality you are replicating is vital. The delegation of .on() is quite handy (for reasons others have elaborated already).
- dmethvin 13y agoDelegated events let you handle events for child elements that aren't even in the DOM at the time you attach the handler. The jQuery docs explain it: api.jquery.com/on/#direct-and-delegated-events > Delegated events have the advantage that they can process events from descendant elements that are added to the document at a later time. By picking an element that is guaranteed to be present at the time the delegated event handler is attached, you can use delegated events to avoid the need to frequently attach and remove event handlers. This element could be the container element of a view in a Model-View-Controller design, for example, or document if the event handler wants to monitor all bubbling events in the document. The document element is available in the head of the document before loading any other HTML, so it is safe to attach events there without waiting for the document to be ready. ... In addition to their ability to handle events on descendant elements not yet created, another advantage of delegated events is their potential for much lower overhead when many elements must be monitored.
- kailuowang 13y ago30KB distributed by a free CDN with a high chance that it's already cached in the browser VS 4KB that probably have to be served by myself. I am sorry, I probably would still go with the 30KB solution.
- js-coder 13y agojQuery might be directly cached but does that really matter? You could make the browser cache Minified.js after the first loading. And I'm pretty sure it's faster to parse / run a 4KB script than a 30KB script.
- jasonlotito 13y ago> And I'm pretty sure it's faster to parse / run a 4KB script than a 30KB script. That's always a dangerous assumption to make. I can guarantee you that size has nothing to do with parsing and running times. As others have already pointed out, this library is already less performant than jQuery for their needs.
- LocalPCGuy 13y agoMight want to research whether or not there is really any benefit from using the CDN other than offloading the bandwidth and getting a (relatively small) chance at a cached solution. From a pure performance standpoint, concatenating/minifying on your own server is more performant in most cases.
- tmlee 13y agoNice one! i am digging it so far! Gonna try using it in one of my smaller projects to see how it goes. btw anybody would like to use this in their Rails project, just drop https://github.com/tmlee/minifiedjs-rails https://github.com/tmlee/minifiedjs-rails into your app for asset pipeline. just did a quick one for that.
- deleted 13y ago[deleted]
- dmethvin 13y agoI know it's awfully tempting to obsess on something that is easy to measure, like file size. I also know it's tempting to imply things like "twice the file size means twice the page load time". But it's not true. It's NOT true. Look at this video at 6m30s: http://channel9.msdn.com/Events/Build/2012/3-132 http://channel9.msdn.com/Events/Build/2012/3-132 Productively optimizing a web page is no different than optimizing any other code. If you want to know why a web site is slow, profile it or run it through a tool like webpagetest.org. Don't just set off to rewrite all your loops to run backwards, or eliminate function calls, or reduce the amount of this or that without any understanding of the result.
- corresation 13y agoLook at this video at 6m30s What does that video possibly prove? That if you compare completely different sites, you can't use reductionist measures of individual attributes to compare speed? Is there anyone on HN who actually doesn't already know that? This is asking which of a collection of mystery vehicles is the fastest by engine size, and then revealing that one is a dump truck, one a train, and the other a motorcycle, with results that should surprise no one. The only people who would possibly be interested in this project are people who are attempting to optimize the experience their app provides, presumably in a holistic fashion. It is pretty much part and parcel that such a person is going to minimize elements, CSS, images, and scripts in such a case, and aren't simply going to replace jQuery with something like this and assumes that it will make everything fast. The reality of something like jQuery, like Ruby on Rails or MongoDB, is if you start with it you'll likely be stuck with it. You can't simply make a full site and run it through the profiler and swap out components without significant rewriting.
- dmethvin 13y ago> Is there anyone on HN who actually doesn't already know that? I see a lot of discussion here based on the premise that this smaller script will make a big difference in overall page load time. It's why the audience in that video was leaning towards the site with the most JavaScript being the slowest. The first benefit listed on the minified.js page is "Minified is smaller!" so exactly what benefits does "smaller" imply? > The only people who would possibly be interested in this project are people who are attempting to optimize the experience their app provides, presumably in a holistic fashion. I agree, and creating your own homebrew framework for a large project in a holistic fashion has its own pitfalls. Especially if you've never done it before.
- EGreg 13y agoThe first caveat I saw is all the uses of $left, $top etc. Makes me wonder what other variables the library puts into the global namespace.
- roryokane 13y agoIn JavaScript’s syntax, if $left and $top are not defined as variables, then {$left: '10px', $top: '10px'} is equivalent to {'$left': '10px', '$top': '10px'} The library doesn’t have to define global variables for that code to work. So it probably doesn’t define them as global variables.
- hk__2 13y agoEven if $left and $top are defined as variables, these codes are equivalent.
- WickyNilliams 13y agoThis month I decided to go on a jQuery diet, as a kind of fun challenge. I'd increase my familiarity with the standard DOM and selector APIs, and reduce my dependency on jQuery. After a few hours of working without jQuery, it became obvious that the standard DOM & selection APIs are verbose and a little awkward. In about 20 minutes I produced a little wrapper that was compatible with a small - but common - chunk of jQuery's surface, and it made life so much more bearable. It clocked in at about 1kb minified (no GZIP). Obviously it wasn't battle hardened and didn't deal with cross browser issues, as it was just for hacking with - but it felt like proof that a wrapper of some form, if not jQuery, is pretty much always necessary
- jakejake 13y agoI think that's an accurate observation. Ironically, if you only code with a library then it's easy to lose track of what that library actually does for you. Writing a bit of "raw" code can really make you understand why jQuery may do things in a certain way or why they have chosen certain abstractions.
- ishbits 13y agoAaaq
- halayli 13y agoIf you use a common cdn to load jquery, chances are it's in the user's browser cache is very high.
- pacomerh 13y agoA good choice would be to customize a download of jQuery to fit your project needs. Similar to what you do with initalizr based on checkboxes. And just unselect any stuff you wont use.