UNPKG

@talend/react-cmf

Version:

A framework built on top of best react libraries

100 lines (78 loc) 2.62 kB
# Breaking changes list on 6.0.0 ## csrf : mergeCSRFToken ```diff -import { mergeCSRFToken } from '@talend/react-cmf/lib/middlewares/http/csrfHandling'; + import cmf from '@talend/react-cmf'; +const mergeCSRFToken = cmf.middlewares.http.csrf.mergeCSRFToken; ``` ## constants ```diff -import CMF_CONST from '@talend/react-cmf/lib/constant'; +import cmf from '@talend/react-cmf'; +const CMF_CONST = cmf.constants; ``` ## onError ```diff -import onError from '@talend/react-cmf/lib/onError'; +import cmf from '@talend/react-cmf'; +const onError = cmf.onError; ``` ## settings ```diff -import settingsAPI from '@talend/react-cmf/lib/settings'; +import cmf from '@talend/react-cmf'; export default function withSettings(MyComponent) { function mapStateToProps(state, ownProps) { - return settingsAPI.mapStateToProps(state, ownProps, MyComponent.displayName, ownProps.componentId); + return cmf.settings.mapStateToProps(state, ownProps, MyComponent.displayName, ownProps.componentId); } ``` ## cmfModule.merge ```diff -import { getReduceConfig, mergeObjects, getUnique } from '@talend/react-cmf/lib/cmfModule.merge'; +import cmf from '@talend/react-cmf'; import { fork, takeLatest } from 'redux-saga/effects'; import UIRouter from './UIRouter'; import expressions from './expressions'; @@ -13,14 +12,14 @@ import cmfRouterMiddleware from './middleware'; import { REGISTRY_HOOK_PREFIX } from './route'; const mergeConfig = { - history: getUnique, - sagaRouterConfig: mergeObjects, - routerFunctions: mergeObjects, - startOnAction: getUnique, + history: cmf.module.merge.getUnique, + sagaRouterConfig: cmf.module.merge.mergeObjects, + routerFunctions: cmf.module.merge.mergeObjects, + startOnAction: cmf.module.merge.getUnique, }; function mergeRouterConfig(...configs) { - return configs.reduce(getReduceConfig(mergeConfig), {}); + return configs.reduce(cmf.module.merge.getReduceConfig(mergeConfig), {}); } ``` ## matchPath ```diff -import match from '@talend/react-cmf/lib/matchPath'; +import cmf from '@talend/react-cmf'; export function matchPath(state, options) { - return match(getPath(state), options); + return cmf.router.matchPath(getPath(state), options); } ``` ## http constants ```diff - import { - ACTION_TYPE_HTTP_ERRORS, - HTTP_METHODS, - HTTP_STATUS, - testHTTPCode, -} from '@talend/react-cmf/lib/middlewares/http/constants'; +import cmf from '@talend/react-cmf'; +const { + ACTION_TYPE_HTTP_ERRORS, + HTTP_METHODS, + HTTP_STATUS, + testHTTPCode, +} = cmf.middlewares.http.constants; ```