Minified Web is a universal JavaScript library for HTML applications. It gives you a clean and simple API that provides you with everything that you need to work interact with the browser on an HTML page.
While the purpose and scope of Minified Web are comparable to jQuery and MooTools, its size is smaller almost by an order of magnitude. The compressed size under 9kb, and the gzip'd size is less than 4kb. You can make it even smaller if you don't require all modules of Minified Web. The build tool allows you to remove everything that you don't need to reduce its size even more.
Name | Legacy IE Support | Compiled Size | Compiled and GZip'd |
---|---|---|---|
minified-web.js | IE6 and higher | 9.1kb | 4089 bytes |
minified-web.noie.js | no | 7.7kb | 3429 bytes |
jQuery 1.10.2 | IE6 and higher | 91kb | 32kb |
jQuery 2.0.3 | no | 82kb | 29kb |
MooTools Core NoCompat 1.4.5 | IE6 and higher | 88kb | 29kb |
Zepto.js 1.0 | no | 27kb | 9.7kb |
The goal of Minified Web is to provide everything you need on an HTML page to interact with the web browser. Everything else is out-of-scope. Specifically, it does not include polyfills, a class framework, helper for JavaScript core types or similar things. If you need them, microjs.com is a great place to find them.
Feature | Minified | jQuery | MooTools | Zepto.js |
---|---|---|---|---|
CSS Selector | yes CSS1 or browser engine | yes CSS3 subset + extensions | yes CSS3 subset + extensions | yes browser engine |
CSS Style Changes | yes | yes | yes | yes |
CSS Class Changes | yes | yes | yes | yes |
Element Creation | yes | yes HTML-strings only | yes | yes HTML-strings only |
Element Cloning | yes | yes | yes | yes |
DOM Manipulation | yes | yes | yes | yes |
Animation (numeric) | yes | yes | yes | yes CSS transitions only |
Animation (color) | yes | no | yes | yes CSS transitions only |
Events | yes | yes | yes | yes |
DOMReady | yes | yes | yes | yes |
Ajax/XHR | yes | yes | yes | yes |
Promises/A+-compatible | yes | yes | no | no |
JSON | yes | yes | yes | yes |
Cookies | yes | no | yes | no |
Form Serialization | no | yes | no | yes |
Array Helpers (Iteration) | no | yes | yes | yes |
AMD support | yes | yes | no | no |
Online Builder | yes modules and functions | no | yes modules | no |
Internet Explorer compatible | yes | yes jQuery 1.x only | yes | no |
- General purpose functions to effectively write HTML-based web applications
- A very small footprint. It will always be smaller than 4kb.
- A clean and simple, easy to use API.
- A stable API that won't change.
Public Domain. Use, modify and distribute it any way you like. No attribution required. To the extent possible under law, Tim Jansen has waived all copyright and related or neighboring rights to Minified. Please see http://creativecommons.org/publicdomain/zero/1.0/
Call me old-fashioned, but the size of JavaScript libraries like jQuery and MooTools has always bothered me. Don't get me wrong, they are fantastic libraries and I really like to use them, but they contain about 90kb of code even after minification. This code needs to be parsed and executed on every page that you include them on. For me, that just feels too large for what that they offer, and especially for what I need. The 30kb size that they have after gzipping will can also cause a significant delay on low-bandwidth networks.
In the last years I worked on some personal projects (jarfiller.org is the only one that has been published), and when I work on them, I usually strive for perfection. Every unnecessary kilobyte hurts. So instead of using jQuery, I started writing my own little helper functions to replace jQuery functionality without the overhead. As I worked on several other projects, I wrote more and more helper functions and started sharing them between projects until they became a library of their own. By now they are so mature that I believe that this library, called Minified, became a valid alternative to jQuery and MooTools at a fraction of the size.
What you see here is only the beginning, a 4kb module for building web sites. The plan is to have three modules, each under 4kb:
- Minified Web is a browser interaction library, comparable to jQuery or MooTools. It is available now.
- Minified Util offers utilities for lists and maps, functions, promises, string and number formatting, date handling and internationalization. Its scope and size can be compared to Underscore, but it omits the more obscure functional helpers and replaces them with date and string helpers. You can find an early version in the /src directory on GitHub.
- Minified Apps will be a MVC-oriented library for single-page applications and complex multi-page apps. The scope will be somewhat similar to Backbone or Angular.js, but with a Plain-Old-JSON-Object (POJO) principles and a template/binding concept that is closely tied to the page's DOM and is predestinated for HTML5 templates. It is built upon the other two modules. A preview should be available by the end of 2013.
Thank you for checking out Minified. Tim Jansen