v1.0.0-alpha.4.0.0
Pre-release
Pre-release
·
58 commits
to master
since this release
This update contains mainly low level and performance related changes.
Breaking
- Renamed the
repeat-keyattribute totrack-by. - Changed the
filterandlimitermiddlewares to be regular functions instead. They are accessible asnx.middlewares.expression.filterandnx.middlewares.code.limiter. See this and this pages for details. - Observability is moved from the core to the new
observemiddleware. Most others middlewares depend on it.observeis added to theappcomponent. - Changed the
$useand$requirecore 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-byattribute is set to$index(or the value ofrepeat-index), therepeatattribute 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. $observeaccepts 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.$compileCodeaccepts a second object argument, which may contain temporary variables for the compiled function. See this page for details.$cleanupaccpepts any number of injectable arguments, similarly to$observe.- The
thiscontext is now the element everywhere (in middlewares and$cleanup,$observeand$attributecallbacks.) $normalizeContentis 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.