Releases: get-focus/deprecated-focus-graph
Version 3.2.0
On this new version, we focus on stability and bug fixes.
use
npm i -S focus-graph@3.2.0
to install focus-graph in its version 3.2.0
Thanks
Thank you everyone for your bugs' reports and issues in which we have discussed. It helped us improve focus-graph
What's new ?
Improvments
-
Validation translation :
PR #180 : Message for the validation of the domain is now translated -
The selectForListReference :
PR #163
It's a new selector, you just have to give an array of the names of the reference list to have the list in the props. -
The validator in the domain :
PR #115 : Now you can add some options in the domain for the HTML elements
It's possible to give some options in the validator of your domain like this :
validator: {
type: 'string',
options: {
maxLength: 200
}
}
- The fetch :
Before :
//In the file fetch.js in the folder : services
import createfocusFetchProxy from 'focus-application/fetch/fetch-proxy'
let fetch;
export const initFetch = dispatch => {
fetch = createfocusFetchProxy(dispatch);
}
export default (url, method, data) => {
return fetch(url, {
method: method,
body: JSON.stringify(data),
headers: {
'Content-Type': 'application/json'
}
});
}
//At the initialisation of the application :
initFetch(store.dispatch);
//For a service by example :
import fetch from './fetch';
export const loadFinance = async ({id}) => {
const response = await fetch(`http://localhost:9999/x/complex/${id}`)
const data = await response.response.json();
return data.finance;
}
After :
import focusFetch from 'focus-application/fetch/fetch-proxy'
export default {
loadMovieCaracteristics(id) {
return focusFetch({url: `http://localhost:8080/movies/${id}/caract`, method: 'GET'}).then((data) => {data.movId = id; return data;});
}
}
//No initialisation
Fixes
v0.2.0
Beta
Focus Redux
Why ?
- In focus components we provide a form which even if it was separated in sevral mixin, was really to use as a stand alone component.
- We also found that there was state related issue inside many components, some from focus, some from the one built inside the projects.
- We also want users to be able to have a better understanding of whats is going on, which actions are triggered, how is the state build.
- We want you to have better devtools to use focus, to have a great Developer Experience.
What is under the hood
- As in each focus extension, we use a tiny library to manage the application state called redux.
- Previously we use to have a dispatcher from
flux
library and build state overEventEmitter
- Now your state is build with functions and can be build with as many nodes as you need in structure like complex json object.
You need to read the awesome Redux documentation. At least the concepts.
Previous concepts
A component Component = f(state, props)
Everything is detailed here
Tutorial
A brand new tutorial is available (still under construction) here