Elementals.js

Latest Version: 2.0 RC 3 14 March 2017

RELEASE CANDIDATE 3 -- 14 March 2017 -- This library is now feature complete and internally debugged, and SHOULD be suitable for testing in deployment environments. It will remain in release candidate status until 25 March 2017, at which point if no further bugs have been found it will be updated to "Production" status.

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. Size targets of 24k or less uncompressed, 16k or less minified, and gzipped at 8k or less. A fraction the size of your typical "framework".
  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: 23056 bytes
Minified: 16405 bytes
Raw gZip: 6593 bytes
Minified gZip: 5470 bytes

Advertisement