Releases: nx-js/framework
Releases · nx-js/framework
v1.0.0-beta.2.0.0
Breaking changes
- The
appcomponent now extends thepagecomponent, and it has the render, meta and params middlewares added by default. - The
$hasAttributemethod is removed from the attribute middleware. - Changed attribute handling order. Custom attributes are handled synchronously before native prefixed attributes. Until now it was the other way around.
- The
$unobserveand$queuemethods are removed from the observe middleware and observer util.
The$observemethod returns an object signal andsignal.unobserve()should be called instead. - Functions passed to
$observerun synchronously for the first time, previously they were always async. - The
$routemethod of the ref middleware has an object parameter from now on. - Parameters of the
paramsmiddleware are no longer reflected in the URL by default, you have to pass the newurl: trueconfig to keep this behavior.
Features
- Added the new props middleware.
- Added the new display and control components.
- Added the new router utility.
- Active anchors - which point to the current page and parameters - receive the
activeCSS class automatically from now on. - Added the
urlanddurableconfig options to theparamsmiddleware. - Added an
paramsevent, which is fired before synchronization on parameter changes. - The
templateconfig is now optional in the render middleware config. - Added a
levelproperty to therouteevent's detail. - The
$attributemethod of the attributes middleware optionally accepts an object with more granular control.
Fixes
- Elements now have correct width and height during their
leave-animation. - The
to(previouslypath) config is now optional in the$routemethod. - Fixed occasional double routing.
v1.0.0-beta.1.1.0
Features
- Added the new meta middleware, which handles analytics and metadata for single-page apps.
Docs
- Added a page for the new meta middleware.
- Modified page component's docs.
v1.0.0-beta.1.0.0
Breaking changes
- Changed to framework's npm package from
@risingstack/nx-frameworkto@nx-js/framework. - Removed the
content,expressionandcodelow level middlewares.contentis moved into@nx-js/dom-util,expressionandcodeis moved into@nx-js/compiler-util.
Refactor
- Moved every module (core and middlewares) into its own GitHub repo and npm package, this opens up the possibility for custom frameworks.
Fixes
- Fixed URI encoding and decoding in
params-middleware.
Docs
- Docs are completely rewritten and there is a new
Getting startedguide.
v1.0.0-alpha.6.1.0
Features
- Added elem.$hasAttribute method (added by attributes middleware).
- Added elem.$queue method (added by observe middleware). It queues a function to be executed together with the triggered observed functions.
Fixes
- Fixed
for inloop and built in object (Map, Set, WeakMap, Date, etc) observation.
Performance
- Changed observed function execution to be always async (no more synchronous first run).
v1.0.0-alpha.6.0.0
Breaking
track-by="$index"is deprecated. You can pass a function totrack-byinstead with$track-by="fn"
ortrack-by="fn". See the relevant docs for details.node.$rootpoints to the nearest root element or shadow root for every node, instead of being a boolean. (Low level API change).
Features
- Added an
nx.supportedboolean flag, which indicates if NX is supported in the current browser.
Fixes
- Fixed attribute processing order in
attributesmiddleware. From now the processing order is- Every
$or@prefixed attribute without a special handler. (Like@hiddenor$required) - Attributes that have a handler in handler definition order. This means the order of
elem.$attribute(name, handler)calls. (Likerepeat-keyand@repeat).
- Every
- Fixed
observable.$rawsometimes not pointing to the raw (non observable) object in case of nested observables.
Performance
- Refactored the router, params, ref, animate, render, bind and bindable middlewares for better performance.
Others
- Adding content middlewares to and
isolated: truecomponent will log a warning instead of throwing an error from now on.
v1.0.0-alpha.5.0.0
Breaking
- The default
isolatesetting of app component is changed from undefined to 'middlewares'. - The style passed to the
rendermiddleware is parsed and attached as a scoped style by default. - The throttle limiter is tweaked a bit. Previously it could emit a final event even after the triggering events are finished. This won't happen anymore.
- The
cachesetting is removed from therendermiddleware. Templates are now always cached internally. (Should not affect you.)
Features
- Added shadow DOM support to the
rendermiddleware. It is toggleable with theshadowboolean config property. - Added scoped style support to the
rendermiddleware.
Fixes
- Fixed throttle limiter sometimes not triggering at all.
- Fixed incorrect animation default durations in firefox.
v1.0.0-alpha.4.0.0
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.
v1.0.0-alpha.3.0.1
Fixed
- Fixed double Web Component registration in browsers not supporting native Web Components.
- Fixed a flickering issue with Safari (caused by a native Safari bug, which incorrectly queues some microtask as task when Promises and MutationObservers interact with eachother).
- Fixed the animationFillMode in Firefox to default to 'both'.
v1.0.0-alpha.3.0.0
Breaking changes and new features
- Added the
animatemiddleware. - Removed the
composeoption from the render middleware. It is always true from now on. If it finds a slot element it composes. - Added a
styleoption to the render middleware, which expects a css string. - Added the
defaultandrequiredoptions to the params middleware config. - Removed
element.$schedule. - The attributes middleware supports boolean attributes from now on, by removing the attribute if it has a falsy value.
- Removed the
showattribute, use the nativehiddenboolean attributes instead. - Calling
next()asynchronously in middlewares won't work anymore. next()calls can be omitted if it is at the end of the middleware. It is called automatically when the middleware finishes execution.- Added a
repeat-keyattribute for performance optimizations with loops in the view. - Added
state.$rawto every state, which provides acces to the raw, unreactive version of the state. - The core filters and limiters are exposed on
nx.filtersandnx.limiters. - Inline JS expressions will return undefined instead of throwing a TypeError when you try to access a property of
undefined(a not yet fetched object).
Fixed
- The
refattribute triggers correctly, when a descendant element of the link is clicked. - The
hrefattribute is generated correctly fromirefattributes.
Performance
- The Web Components polyfill is replaced by a smaller and more performant subset.
- The core is reworked to make execution order more predictable and less bug prone.
- The repeat attribute is refactored to reuse existing DOM nodes more efficiently.
v1.0.0-alpha.2.3.1
Fixed
- Fixed the
repeatattribute not mapping arrays correctly some times. - Inline event handlers are now triggered in the capture phase of events. This makes them works with events, which has no bubbling phase (scroll event for example).
Performance
- Internal improvement by removing
Object.setPrototype(). Currently it improvesrepeatattribute performance only.