Skip to content

v1.0.0-alpha.4.0.0

Pre-release
Pre-release
Compare
Choose a tag to compare
@solkimicreb 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 to track-by.
  • Changed the filter and limiter middlewares to be regular functions instead. They are accessible as nx.middlewares.expression.filter and nx.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 the app component.
  • Changed the $use and $require core methods to be middleware function properties instead. From function middleware (elem) { elem.$require('name'); elem.$use('name') } to function middleware () {} middleware.$require = ['name']; middleware.$name = 'name'

Features

  • If the track-by attribute is set to $index (or the value of repeat-index), the repeat 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 to setTimeout, 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.