ractive v0.4.0 Release Notes
-
2014-04-08
- ๐ฅ BREAKING: Filenames are now lowercase. May affect you if you use Browserify etc.
- ๐ฅ BREAKING:
set()
,update()
,teardown()
,animate()
,merge()
,add()
,subtract()
, andtoggle()
methods return a Promise that fulfils asynchronously when any resulting transitions have completed - BREAKING: Elements are detached when all transitions are complete for a given instance, not just transitions on descendant nodes
- ๐ฅ BREAKING: Default options are placed on
Ractive.defaults
(andComponent.defaults
, whereComponent = Ractive.extend(...)
) - ๐ฅ BREAKING: The
adaptors
option is nowadapt
. It can be a string rather than an array if you're only using one adaptor - Reactive computed properties
- Two-way binding works with 'keypath expressions' such as
{{foo[bar]}}
- ๐ Support for single-file component imports via loader plugins such as http://ractivejs.github.io/ractive-load/
- ๐ A global runloop handles change propagation and other batchable operations, resulting in performance improvements across the board
- Promises are used internally, and exposed as
Ractive.Promise
(Promises/A+ compliant, a la ES6 Promises) - ๐
Components can have encapsulated styles, passed in as the
css
option (disable withnoCssTransform: true
) ractive.reset()
method allows you to replace an instance'sdata
object- โก๏ธ Decorators are updated when their arguments change (with specified
update()
method if possible, otherwise by tearing down and reinitialising) - Inline components inherit surrounding data context, unless defined with
isolated: true
- Transitions will use JavaScript timers if CSS transitions are unavailable
- A global variable (
window.Ractive
) is always exported, butRactive.noConflict()
is provided to prevent clobbering existingRactive
variable - Inline component
init()
methods are only called once the component has entered the DOM - Any section can be closed with
{{/...}}
, where...
can be any string other than the closing delimiter - ๐จ Evaluators that throw exceptions will print an error to the console in debug mode
ractive.observe(callback)
- i.e. with no keypath - observes everythingractive.observe('foo bar baz', callback)
will observe all three keypaths (passed to callback as third argument)- ๐ Better whitespace preservation and indenting when using
ractive.toHTML()
- ๐ Calling
ractive.off()
with no arguments removes all event listeners - Triples work inside SVG elements
<option>{{foo}}</option>
works the same as<option value='{{foo}}'>{{foo}}</option>
- More robust data/event propagation between components
- More robust magic mode
- ๐ Fixed a host of edge case bugs relating to array mutations
- ๐ Many minor fixes and tweaks: #349, #351, #353, #369, #370, #376, #377, #390, #391, #393, #398, #401, #406, #412, #425, #433, #434, #439, #441, #442, #446, #451, #460, #462, #464, #465, #467, #479, #480, #483, #486, #520, #530, #536, #553, #556