Releases: almin/almin
almin@0.19.0
almin@0.18.0
almin@0.17.0
almin@0.16.0
almin@0.16.0
features
You can write follows in Almin 0.16+
const context = new Context({
- dispatcher: new Dispatcher(),
store: storeGroup
});
Breaking Changes
almin-react-container@0.6.4
fixes
almin@0.15.3
Almin 0.15.0
🌟 Features
Support UseCase#shouldExecute
#292 #298
What it UseCase#shouldExecute
?
Currently, the user can not prevent to execute of UseCase by declaratory.
Also, almin-logger does log the execute, but this usecase is not executed actually,
class MyUseCase extends UseCase {
execute(args){
if(condition){
return; // Should not execute this UseCase
}
// do something
}
}
The user can prevent to execute of UseCase by declaratory.
This UseCase#shouldExecute
allow to write following.
class MyUseCase extends UseCase {
shouldExecute(args): boolean {
return false; // if this usecase should not execute
}
execute(args){
// do something
}
}
If shouldExecute
return false
, almin-logger does not log the execution of the UseCase.
But, you can observe this log by onWillNotExecuteEachUseCase
handler.
For more details, see LifeCycleEventHub · Almin.
📝 Documentation
New documentation design
🔥 Breaking Change
TypeScript
- Improve
type
check on subclass ofPayload
#296
Before:
// OK
class P1 extends Payload{
type = "P1"
}
// OK
class P2 extends Payload {
type: string;
constructor() {
super({ type: "P2" });
}
}
// OK
class P3 extends Payload{
constructor() {
super({ type: "P2" });
}
}
// OK - It is a bug
class P4 extends Payload{
// no type
}
After:
If you have inherited Payload
class, should have defined type
property.
// OK
class P1 extends Payload{
type = "P1"
}
// OK
class P2 extends Payload {
type: string;
constructor() {
super({ type: "P2" });
}
}
// NG - Need to defined `type: string`
class P3 extends Payload{
constructor() {
super({ type: "P2" });
}
}
// NG: Fix a bug #295
class P4 extends Payload{
// no type
}
♻️ Remove deprecated API
You can migrate this deprecated API to new API by @almin/migration-tools.
How to migrate?
Run following command and select x.x.x → 0.15.x
npm install -g @almin/migration-tools
almin-migration-tools "src/**/*.js"
What is changed?
ChangedPayload
has been removed.
import { UseCase, ChangedPayload } from "almin";
export class ExampleUseCase extends UseCase {
execute() {
this.context.useCase(new ChangedPayload()).execute();
}
}
to
import { UseCase } from "almin";
export class ExampleUseCase extends UseCase {
execute() {
this.context.useCase({ type: "ChangedPayload" }).execute();
}
}
For more information, see @almin/migration-tools.
almin-react-container@0.5.0
0.5.0 (2017-11-11)
Features
const storeGroup = new StoreGroup({
myState: new MyStore()
});
// Context
const context = new Context({
dispatcher: new Dispatcher(),
store: storeGroup
});
// View
type AppState = typeof storeGroup.state & {
// defined by App View
custom?: string;
};
class App extends React.Component<AppState, {}> {
render() {
return <div>{this.props.myState.value}</div>;
}
}
// Create Container
const RootContainer = AlminReactContainer.create(App, context);
ReactDOM.render(<RootContainer custom={"value" }/>, document.body);
almin@0.14.0
⭐️ Features
Blog Post: Almin + React/Vue optimizing performance visually – azu – Medium
Introduce Almin Instruments #280
You can profiling UseCase execute, StoreGroup write/read, Store update using the browser developer tool timeline.
Video: https://twitter.com/azu_re/status/909418278153478144
You can turn on performance profile by performanceProfile
option.
const appContext = new Context({
dispatcher: new Dispatcher(),
store: yourStoreGroup,
options: {
strict: true,
performanceProfile: true
}
});
For more details, See Performance profile · Almin.js
TypeScript
- Make Payload abstract #276
Deprecated
If you want to know Roadmap, see Almin 0.15.0 · Issue #287 · almin/almin
almin@0.13.11
almin-logger@6.0.0
BREAKING CHANGES
- almin-logger: Remove SyncLogger
If you use commonjs require, please use require("almin-logger").default
.
-const AlminLogger = require("almin-logger");
-import AlminLogger from "almin-logger";
+import { AlminLogger } from "almin-logger";
Chores
Features
- almin-logger: Support Transaction#id (#267) (bea2b3a)
- TypeScript: Add TodoMVC TypeScript (#263) (b05f7aa)
Chores
-
docs(almin-logger): Reflect removal synclogger
-
test(almin-logger): add start/stop test
-
docs(almin-logger): Update README