Zepto 1.1: Moar performance, IE 10+, Deferreds
December 5th, 2013Mislav and I just released Zepto 1.1, which brings updates across the board. Even if you don’t need to new features, upgrading is worth it for “free” IE 10 support (which makes mobile sites work great on Windows Phone 8) as well as the huge performance speedups for common operations (benchmarks).
Notable changes
- IE10+ support
- Huge speed optimizations for simple CSS selectors (classname, ID) and DOM element creation
- Provide
$.Callbacks
and$.Deferred
in optional modules - Removed
fx
anddetect
modules from default build
Ajax
- New supported
$.ajax()
options:xhrFields
mimeType
jsonpCallback
-
username
&password
- Promise interface supported when loading the optional “callbacks” and “deferred” modules:
xhr.done(function(data, status, xhr){ ... })
xhr.fail(function(xhr, errorType, error){ ... })
xhr.always(function(){ ... })
- Enable mutating Ajax settings in the
beforeSend
callback - Fix JSONP callbacks for errored responses on Android
- Ensure consistent
Accept
request HTTP header across browsers - Fix
$.param()
for jQuery compatibility when handling complex nested objects - Support IIS JavaScript MIME type
- Pass “abort” and “timeout” status to global
ajaxError
event handlers
Event
- Provide
isDefaultPrevented()
,stopImmediatePropagation()
, and related methods for all events - Support the
data
argument in.bind()
,.on()
, and.one()
- Support CSS selector argument in
.one()
for event delegation - Support
.on('ready')
as an alias for.ready()
- Enable event handlers on plain old JS objects
- Many fixes related to event delegation
Data
- Cleanup
.data()
values on DOM element removal with.remove/empty()
-
.data()
now assumes that numbers that begin with zeroes are strings -
.removeData()
(no argument) now removes all data on the element - Enable reading
data-*
attributes that have underscores in the name
Other updates
- Support simple DOM property names in
.prop(name)
such asfor
,class
,readonly
… - Implement the
.scrollLeft([value])
method - Support setting
.scrollTop(value)
- Fix
$(document).width/height()
- Support fetching multiple CSS values via array in
.css(['prop1', 'prop2', ...])
- Support setting CSS transition delay via
delay
option for.animate()
- Ensure that
.animate()
callback always fires
All in all, our most bestest release yet. A big thank-you to all our contributors for making this awesome! 🙂
Tweet