Elementals.js

Latest Version: 3.0 RC 1 17 July 2017

VERSION 3.0 RC 1 -- 17 July 2017 -- First public release of 3.x, version 2.x/earlier is now dead, please pretend it never existed. 😁 Barring any major bugfixes this version will be released as "Production" sometime in August 2017.

elementals.js is a function library for JavaScript. I prefer not to call it a "framework" as it doesn't try to change how JavaScript works, it simply enhances the existing way of doing things and fills in what I consider to be some obvious 'blanks' in the specification. The new helper functions are provided through an object named "_" (yes, just an underscore character), and there are shim/polyfill to it to allow the use of some ECMAScript methods on strings and arrays for browsers that don't support them as yet.

Really most of the existing "frameworks" are WAY too massive to have any business on a normal website. Many of them by themselves gZip COMPRESSED are half the size I usually allow for an entire page template's HTML + CSS + scripts + images; yet amazingly their massive bloat is BEFORE you actually even start adding USEFUL scripting that actually does stuff to the page. In addition, they are quite often chock full of functions that most people would never use, outright abuse, are CSS' job, or just plain don't belong on a website!

Features

  1. Maximum download size targets once gzipped of 12k for the complete source (currently 8.98k), and 8k or less gzipped when both minification and gzip compression is applied. (currently 6.13k)
  2. Designed for inclusion before </body>, speeding load time.
  3. Encourages the use of scripts that attach themselves rather than called by the attributes in the markup or inlining scripting in the document.
  4. Provide shims in legacy browsers for missing ECMAScript functions like String.trim or Array.indexOf.
  5. Cross-browser AJAX object creation that allows passing a series of 'readystate' and 'status' handlers.
  6. uSort style method for Lists and Tables.
  7. DOM walking tools like various 'each', 'next' and 'prev' methods, that can be passed a 'mask' for either specific tags, or nodetypes.
  8. Class handling methods akin to those in the new Element.classList property, but with more consistent naming conventions, not quite so buried in an element's properties, and with a few extra bells and whistles. Laughably it turns out the regEx I made for backwards compatibility in older browsers runs faster than the actual ECMAScript style methods... I suspect this is because they actually use the classList Array, and Arrays/indexed objects are painfully slow in JavaScript.

For the time being news and announcements will be posted over on our sister site:
CutCodeDown - Minimalist Semantic Markup.

Downloads

Statistics

Current file sizes for elementals.js
Raw Size: 34294 bytes
Minified: 18340 bytes
Raw gZip: 9191 bytes
Minified gZip: 6272 bytes

Advertisement