Releases: Antontelesh/athletic
v3.0.2
v3.0.1
v3.0.0
This release is a full rewrite.
The library has been totally rewritten in TypeScript.
It means, that it's now can be used in other TypeScript projects with full typings support, including IDE intellisence.
The inner architecture has been rethought and changed dramatically while external API remained almost the same.
Here is the full list of API changes:
API changes (breaking)
-
App
is no more a constructor function, but a factory. Now it should be called without thenew
keyword. -
The return value of
App()
is not the real application object, but simply an interface to register components and model. -
App#bootstrap
now returns a destroy function. You can store it somewhere and then call it to clean-up listeners of your model.
This unsubscription function also callsonDestroy
method on every registered component instance.
This lifecycle hook can be used to remove all event listeners registered in a component. -
App#model
now accepts not an actual data object, but an instance ofModel
.
Model
is another factory exported fromathletic
.
It's intended to being called without thenew
keyword.
You can pass your data to the factory function when creating an instance ofModel
:import {App, Model} from 'athletic'; let model = Model({prop: 'value'}); App() .model(model)
This change allows you to store reference to your model instance to mutate application state from outside of it:
let model = Model(); // ...somewhere later model.set('prop', 'value'); // => this will also trigger `update` methods in all components
It means now you can use redux or another library for state management.
-
Component
constructor now accepts only two arguments:element
andmodel
.
Previously it was accepting alsoapp
.
Now there is no such thing asapp
at all.
This change also means that there is nothis.app
in components.
This property wasn't very usable, so I think we can delete it safely.
Be careful to remove it from your component constructors.
Other changes (non-breaking)
athletic
now is bundled with rollup.
This dramatically decreases the size of the library.
v2.1.0
v2.0.1
- Fixed
lodash/array/remove
dependency.
2.0.0
- Now module is prebuilt with babel and ready to use