v1.0.0-alpha.4.0.0
Pre-release
Pre-release
solkimicreb
released this
24 Nov 07:08
·
58 commits
to master
since this release
This update contains mainly low level and performance related changes.
Breaking
- Renamed the
repeat-key
attribute totrack-by
. - Changed the
filter
andlimiter
middlewares to be regular functions instead. They are accessible asnx.middlewares.expression.filter
andnx.middlewares.code.limiter
. See this and this pages for details. - Observability is moved from the core to the new
observe
middleware. Most others middlewares depend on it.observe
is added to theapp
component. - Changed the
$use
and$require
core methods to be middleware function properties instead. Fromfunction middleware (elem) { elem.$require('name'); elem.$use('name') }
tofunction middleware () {} middleware.$require = ['name']; middleware.$name = 'name'
Features
- If the
track-by
attribute is set to$index
(or the value ofrepeat-index
), therepeat
attribute will cause minimal DOM changes. Make sure to always combine this feature with dynamic@
attributes and interpolations instead of single$
ones in the content for proper updating. $observe
accepts any number of injectable arguments after the passed function. It also returns a singnal, which should be passed to unobserve (similarly tosetTimeout
,clearTimeout
).
See this page for details.$compileCode
accepts a second object argument, which may contain temporary variables for the compiled function. See this page for details.$cleanup
accpepts any number of injectable arguments, similarly to$observe
.- The
this
context is now the element everywhere (in middlewares and$cleanup
,$observe
and$attribute
callbacks.) $normalizeContent
is now added by the content middleware. It removes empty text nodes from the node content.
Performance
The core and observe, code, expression, interpolate, attributes, events, flow, style and content middleware performance has be greatly improved.