Releases: hexydec/dabby
Dabby.js v0.9.16
This is a maintenance release to bring the release branch up to date with the changes in the master branch:
- Fixed bug in
$.fn.remove()
where if a node was not attached to a parent, an error was produced - Updated
$.fn.remove()
to support removing the attached events from the removed nodes - Added new properties to
getprop.js
, also compressed how properties where only the case is different - Fixed issue in
$.fn.off()
where it had trouble comparing the callback function, it now usestoString()
to compare the code as a string - Removed code in
$.fn.off()
that checks if the event list is an array as it is an array when created. Made code shorter - Used spread operator instead of
Object.assign()
orArray.from()
where possible - Fixed bug in
$.fn.off()
where removals were missed as it removes items from the list of events you are looping though, which causes the index to change, and the array to be offset by one for every item you remove. It now works on a copy of the array and tracks the offset - Fixed issue in
width-height.js
where the current value callback was called on the native object rather than the dabby object and method - Fixed incorrect syntax in
README.md
- Fixed issue in
$.fn.trigger()
where it didn't attach the extra parameters to the event in the best way - Updated
$.fn.on()
to receive the extra parameters correctly and fixed bug where it was not passed to the event handler correctly, it now spreads the data as separate parameters - Updated the documentation to note that it doesn't support objects as extra parameters as jQuery does as it is not clear how this is supposed to work.
- Replaced all references to
core/core.js
withcore/dabby/dabby.js
as the core file is no longer needed - Updated
$.ajax()
to useObject.assign()
instead of the spread operator as some older versions of iOS don't support spreading objects - Fixed bug in
$.fn.on()
where the data from the event was picked up with the wrong variable name - Fixed issue in
$.fn.on()
where delegated items were not triggered by their child objects, e.g. if an image was clicked, but the deleted object was an anchor that wrapped it, the anchor would not be triggered. It now considers its parents when seeing if the target element was triggered - Fixed issue in
$.fn.on()
where the trigger arguments were not enforced to be an array, which caused it to crash when the value was spread to the callback - Fixed issue in
$.fn.map()
where in jQuery, a jQuery object can contain an array, as well as a set of nodes, whereas in Dabby it can only be nodes. Therefore this method, whilst it should return a Dabby object, but was just returning an array. It must also restrict the result of the callback to just being either nodes or another Dabby object, which are now all merged together into the output - Fixed issue in delegated events where the delegated target was not filtered correctly if a child element was clicked
- Removed
console.log()
calls from tests - Updated dependencies
- Added tests
Dabby.js v0.9.15
This release fixes a number of bugs, improves code optimisation, and adds some documentation:
- Updated
$.fn.attr()
to use a switch statement - Optimised code in
$()
to do less work when no context is specified - The functions for
$.isPlainObject()
,$.isWindow()
,$.isPLainObject()
, and$.parseHTML()
are now stored as standalone methods the internal folder, this is because they are used bydabby.js
and did cause circular references - Rewired all usage of the above functions to use the internal methods
- Updated
dabby.js
to only filter nodes by type in a single place and to check items are nodes by using instanceof instead of checking for thenodeType
property - Fixed issue with how context is handled in
dabby.js
, it was handled manually and if there were no nodes it would be ignored. It is now parsed as a dabby object, and if thecontext
is empty, this will now result in an empty dabby object being returned - Fixed issue in
dabby.js
where if you passed a dabby object as theselector
, it would just return that object, whereas it should copy the nodes to a new object - Simplified the
proxy
object to not allow numeric or thelength
property to be always writeable. - The
length
property is now read only as it is only written when a dabby object is created. - Removed
$.each()
and$.fn.each()
from core.js as it is not used - Added dependencies to
$.each()
and$.fn.each(
) now it is not included in core - Fixed bug in
$.fn.wrapall()
where isfunction.js wasn't imported correctly - Fixed bug in
$.fn.extend()
where the method was a arrow function so don't have a scope. - Updated
class.js
to useslice()
instead ofsubstr()
as it requires less code and is not deprecated - Optimised loops in
$.fn.off()
- Fixed issue in
camelise()
where it shouldn't change the case of CSS variables - Updated code to use
includes()
instead ofindexOf()
where possible - Updated files that contain multiple methods to use the index to determine the method instead of string checks
- Fixed bug in
$.fn.prop()
where the current value in the callback may not have the correct prop name - Fixed bug in
$.fn.val()
and$.fn.offset()
where the current value was called on a node rather than a dabby object $.fn.offsetParent()
now creates an empty dabby object if there are no nodes in the collection, whereas previously it passednull
- Optimised
$.fn.scrollTop()
/$.fn.scrollLeft()
to remove special code for thewindow
object, as it is not needed - Fixed bug in
getProp()
where the input property might not be lowercased - Improved
isFunction()
- Fixed bug in
isWindow()
where a check fornull
shouldn't be strict to coverundefined
- Updated Node type constants to use numbers
- Fixed bug in
$.each()
where it should have iterated over objects with alength
parameter as if it was an array - Various code improvements/optimisations
- Updated build minifier to use Terser instead of Babel minify and uglify.
- Updated
README.md
to show correct start file and how to use attributes when creating elements - Updated package
qunitjs
to bequnit
as its name has changed - Updated tests to include the new qunit
- Added tests for bugs
- Added new documentation
- Pruned and Updated dependencies
- Fixed issues with the benchmark suite
- Bumped version to 0.9.15
Dabby.js v0.9.14
This release imrpoves the security of the dabby object and prototype:
- Added a proxy class to dabby to prevent methods being overwritten
- Added proxy class to the $.fn alias to proxy the prototype, that sets the methods as read only except for the length property and indexes
Dabby.js v0.9.13
This release fixes a number of bugs and adds some features to improve compatibility with jQuery, reworks a few components and documentation:
$.ajax()
now supports blob objects- Updated readme files to correct errors and improve examples
- Added
readme.md
for$.fn.trigger()
- Added
$.fn.triggerHandler()
- Moved
$.fn.slice()
to traversal, and added more tests - Fixed bug in
$.fn.clone()
where it read the wrong property when copying events - Fixed bug where certain objects already have an
event.data
property, and in some cases it is also read-only which causes an error. The code now checks to see if the property is set and uses a fallback ofevent._data
if it is - Fixed bug in
$.fn.empty()
where awhile
statement had all its commands inside the condition, but no commands in the block - Reworked
$.extend()
to replicate the jQuery version more closely, and to check types when merging to prevent problems with objects merging with arrays. It now merges with dabby if only one argument is supplied - Added documentation and updated tests
- Reworked
$.isPlainObject()
to only use a modern method to detect plain objects - Reworked
$.map()
to remove dependency on$.each()
and be more performant - Added
isobj.js
for detecting objects - Updated dependencies
Dabby.js v0.9.12
This release fixes a number of bugs and adds some features to improve compatibility with jQuery, along with more tests and documentation:
- Fixed bug in $.fn.attr() where if you try to set an empty collection, it returned undefined, whereas it should return the collection
- Removed settings.scriptCharset and added settings.scriptAttrs to $.ajax()
- Fixed issues in $.ajax() with setting the default content type, it now sets settings.contentType to application/x-www-form-urlencoded when the method is POST and the data is a url encoded string
- Fixed bugs and missing features in
$.on() and $ .off() where they didn't support objects as the event list - Fixed bug in $.off() where it had a redundant data argument, and it didn't support removing all bound handlers
- Added more tests for
$.on() and $ .off() - Added documentation for
$.on() and $ .off() - Updated all NPM packages in package.json
- Fixed issue in gruntfile.js where the comments option was not correctly specified in babel
Dabby.js v0.9.11
This release fixes a number of bugs, improve compatibility with jQuery and also improves performance through a new benchmarking suite. Currently the suite only tests a small part of the code.
The core $() has seen a lot of refactoring to fix compatibility issues and improve performance,
There is also more documentation and a smaller package on NPM. In this release:
- Added code comments and made code more readable in getVal()
- Added documentation for named.js
- Added the beginnings of a benchmark suite, it currently benches against jQuery, with only tests for the core
$() and $ .fn.attr() - Reworked dabby.js to improve performance
- Updated benchmark to run asynchronously so it shows results as they are run, layout and usability better
- Added files to package.json so they are available in NPM
- Added
$.parseHTML() to fix issues with adding scripts and document contexts within $ (), updated $.fn.load() to use - Updated when HTML is created within $() to simplify the creatorDocument argument, you now must pass a document
- Fixed issue in $() where a context sent as an empty object or array would cause an error
- Fixed bug in $() where if you sent an empty object as a context, it would default to using the document, whereas it actually shouldn't lookup the selector at all
- Fixed bug where 'this' can exist in the context of the dabby function, so the properties got attached to the wrong object
- Fixed bug in $() where it would only search for nodes in the first context item supplied, whereas it should find child nodes in all contexts that are supplied
- Removed build files from version control for tests and benchmarking
- Fixed bug in getprop.js where it always lowercased property names, where as it should have just used the lowercase name to check against the conversion list
Dabby.js v0.9.10
This release fixes a number of bugs in the codebase that add stability when using the library in more advanced and detailed ways. It also improves versatility with regards to using the library with minified HTML, where some attributes won't be set such as a form action.
More documentation has also be added as well as improved compatibility with jQuery:
- Added licence info
- Added documentation for
$.fn.offset(), $ .fn.offsetParent(),$.fn.position() and $ .fn.scroll() - Added more tests for $.fn.val()
- Updated $.fn.ajax() to make location.href default for settings.url
- Replaced typeof val === "undefined" with val === undefined where possible
- Updated $.fn.val() to cast to a string with a string concatenation.
- Used a shorter check for null or undefined in $.map()
- Fixed issue in $.fn.ajax() where if the URL was null, the settings were not handled correctly
- Fixed bug in insert.js where if you requested an insert on multiple items using a callback, nothing would be inserted
-
$.fn.attr(), $ .fn.class(),$.fn.prop(), $ .fn.off() and getVal() is now faster when the collection is empty - Reworked $.fn.prop() to do its work in a single loop rather than two
- Fixed bug in $.fn.val() where when setting select values, the value attribute was used which doesn't work in IE11
- Fixed bug in $() where it was using new Set() which couldn't be converted to ES5 without more polyfills, it now integrates a unique check into the filter() call that refines by node type.
- Fixed bug in $.fn.on() where events weren't correctly delegated, it now looks up the target against the children of the currentTarget correctly
- Added missing functionality to $.fn.clone() where it didn't have the ability to copy and deep copy data and events on cloned elements
- Fixed bug in insert.js, replace.js and wrapall.js where cloned elements didn't have their data and events copied, cloning is now routed through $.fn.clone()
- Removed builds from version control, they will now be attached to releases
- Fixed bug in $.post() where if the URL is null, it detected it as a settings object which cause it to crash
Dabby.js v0.9.9
This release fixes a number of bugs in the codebase and improves compatibility with jQuery, as well as adding new tests and more documentation:
- Fixed issue in show-hide.js where the initial display property was not remembered and restored on toggle
- Rewrote
$.fn.insertBefore()/$ .fn.prependTo()/$.fn.appendTo()/$.fn.insertAfter() to use their sans "to" equivalent but swap the argument order, as it was using methods that are not supported by IE11 - Rewrote
$.fn.before/$ .fn.prepend()/$.fn.append()/$.fn.after() to better handle copying and cloning nodes. Added lots of new tests - Fixed bug in $.fn.add() where it was adding items to the current collection rather than creating a new collection which was causing the output to not be immutable
- Fixed bug in next-prev/next-prev.js where
$.fn.next() and $ .fn.nextAll()'s functionality was swapped, also$.fn.prev() and $ .fn.prevAll() - Fixed bugs in next-prev.js where the order of returned elements was not always correct
- Added tests for all methods in next-prev.js
- Fixed bug in
$.fn.nextUntil() and $ .fn.prevUntil() where it returned the until element, whereas it shouldn't - Added documentation for .show-hide.js(), .hide(), .toggle(), .width(), .height(), .innerWidth(), .innerHeight(), .outerWidth(), and .outerHeight()
- Added display parameter to $.fn.toggle()
- Reworked show-hide.js to enable the above and to remove the display property if it was removed by default and we are going back to the default state
- Updated $() to remove duplicates from the input nodes when create dabby objects
- Fixed ordering bugs in insert.js, it now matches jQuery in the insert order
- Added tests to check ordering in insert.js
- Fixed documentation issue in show-hide/readme.md where it was incorrectly noted that there were no differences to jQuery, whereas they don't support animations
- Reworked $.fn.closest() as it was returning more than one node per item in the collection
- Updated layout of width-height/readme.md and added examples for all methods
- Added more tests for $.fn.add()
- Fixed issues with ordering in next-prev/test.js
- Removed browserslist definitions from gruntfile.js and added to package.json
- Code optimisations for next-prev/next-prev.js and parents/parents.js.
- Added map file for dabby.js
Dabby.js v0.9.8
This release fixes a number of bugs to make the output more stable and improve compatibility with jQuery:
- Fixed issue with $.fn.load() where innerHTML doesn't execute any included scripts
- Fixed issues in $.ajax() where the textStatus returned was not always correct, and the same setting was used to choose the callback which meant that sometimes callbacks were not fired
- Added onerror callback to $.ajax()
- Fixed bug in
$.ajax() where an object was looped over with forEach() instead of $ .each() - Fixed issue in trigger.js where in chrome, the submit event didn't trigger the native event, only its handlers
- Fixed bug in scroll.js where the dimension variable was overwritten when checking the window scroll, causing it to measure the wrong dimension for $.fn.scrollTop()
- Updated packages in gruntfile.js
- Fixed issue in $.fn.trigger() where if the submit event was triggered and then default was prevented, the native event was still triggered
- Added test to $.fn.filter() to check it has the correct context
Dabby.js 0.9.7
This release fixes a number of bugs to make the output more stable and improve compatibility with jQuery. It also moves the documentation around a little to make it easier to use when looking through the repository. Some methods were added and some removed:
- Fixed bug in $.fn.attr() where it was handling the input attributes as an array instead of an object.
- Split
$.fn.on() and $ .fn.off() into different files. - Update $() to create a dabby object at the end, and send it raw nodes, which are then handled first, which creates a more efficient path through the function and uses less code
- Fixed issues in $.fn.trigger() where the native event wasn't called, and to make a special case for the submit event, where when triggered it doesn't fire any attached event handlers. It now uses a custom event to do this
- Fixed issues with radio boxes in $.fn.val() where it should return the value of the item requested, not the currently selected value, it also now only sets the value where the object is in the collection
- Updated $.fn.serialize() to select only checked radio and checkbox controls
- $.param() can now handle a function as a value and handles null's correctly
- Fixed bug in setCss() where the properties were not processed correctly
- Fixed bug in $.map() where the callback return value was not set properly
- Updated $.map() to support the callback returning an array
- Fixed bug in $.fn.attr() where it did not support using a callback as the value
- Fixed bug in $.each() where the keys returned from an array were strings instead of numbers. Fixes #4
- Fixed #3 where $.fn.toggleClass() didn't support the state parameter
- Fixed bug in $.fn.prop() where the gathered values were assigned to an array instead of an object
- Fixed bugs in $.fn.parentsUntil() where it returned the matching element, and didn't filter the nodes correctly
- core.js now doesn't include $.fn.attr(), it must be included manually if needed to create nodes with properties
- Removed $.isArray(), use Array.isArray() instead
- Updated getVal() to calculate the values for all objects in a collection and return an array, and then updated all usages. This is to enable all the property reads to be done before writes and limit layout thrashing
- Fixed some missing dependencies
- Added
$.fn.show(), $ .fn.hide(), and $.fn.toggle() - Added tests for
$.each(), $ .fn.closest() and $.fn.parentsUntil() - Added more tests to getVal()
- Added documentation for
$.fn.removeProp() and $ .fn.val() - Various code size optimisations