13 April 2018 -
Elementals 3.6.4 Relased!
By Jason M. Knight (aka Deathshadow)
This latest update to elementals.js brings with it some code efficiency improvements that speeds up some functions and shrunk others, making room for some new functionality. At 7.71k in size gzipped and minified it still fits under the 8k hard ceiling we have set for a code limit... more than enough room to add a few new features shoould anything come up.
The most noteworthy addition to the codebase is the forceThis argument on
_.Event.add(), which lets you pass an object that inside the event callback will be treated as the this object. It is passed using
Function.call() so that the headaches -- and legacy compatibility woes -- of
Function.bind don't get involved. Be warned though, this means that if you omit said parameter inside your event callbacks this will be NULL.
String.splitSelector has been changed to return a null string instead of "DIV" when no tagName is included in a DSS. This simplifies loose boolean tests when needed and reduced the overall code size. The default in a DOM-JON of an empty tag-name defaulting to
DIV is now handled inside
The "fast content selector" for DSS has been changed so that for
OPTION tags it is applied as text content, not VALUE. To set the value on a
OPTION tag you should be using the "speical value selector" instead.
I'm still banging my head against the wall undoing code revisions made by a former team member that just plain broke a number of things. The AJAX
getXMLValuesByTagName implementation for example was using the wrong
for loop style which resulted in the limit parameter being ignored. Whilst the "iterate by value" appraoch is faster and one I advocate, it was completely the wrong tool for the job there! It's almost like when I showed it to the person in question they just started blindly applying it to everything... In another spot I found two routines were source-order swapped when the source order actually mattered!
But for all that I'm finally getting it hammered out how I originally envisioned the whole thing. The creation of DOM-JON as a separate "specification" separate from elementals.js has not only made documentation of it easier to create and maintain, it has also let me focus more clearly on the implementation and how both
Now I just REALLY need to get off my arse and write some REAL tutorials about it.
As always if you find any bugs or issues please report them through the contact form on the official site.