Skip to content

Update Dash dependencies #1367

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ jobs:
command: |
. venv/bin/activate && pip install --no-cache-dir --upgrade -e . --progress-bar off && mkdir packages
cd dash-renderer && renderer build && python setup.py sdist && mv dist/* ../packages/ && cd ..
git clone --depth 1 https://github.com/plotly/dash-core-components.git
git clone -b 20200814-update-deps --depth 1 https://github.com/plotly/dash-core-components.git
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Run against the modified branches of Core components

cd dash-core-components && npm ci && npm run build && python setup.py sdist && mv dist/* ../packages/ && cd ..
ls -la packages
- persist_to_workspace:
Expand Down Expand Up @@ -152,7 +152,7 @@ jobs:
name: ️️🏗️ build misc
command: |
. venv/bin/activate && pip install --no-cache-dir --upgrade -e . --progress-bar off && mkdir packages
git clone --depth 1 https://github.com/plotly/dash-table.git
git clone -b 20200810-update-deps --depth 1 https://github.com/plotly/dash-table.git
cd dash-table && npm ci && npm run build && python setup.py sdist && mv dist/* ../packages/ && cd ..
git clone --depth 1 https://github.com/plotly/dash-html-components.git
cd dash-html-components && npm ci && npm run build && python setup.py sdist && mv dist/* ../packages/ && cd ..
Expand Down Expand Up @@ -205,7 +205,7 @@ jobs:
command: |
source venv/Scripts/activate && pip install --no-cache-dir --upgrade -e . --progress-bar off && mkdir packages
cd dash-renderer && renderer build && python setup.py sdist && mv dist/* ../packages/ && cd ..
git clone --depth 1 https://github.com/plotly/dash-core-components.git
git clone -b 20200814-update-deps --depth 1 https://github.com/plotly/dash-core-components.git
cd dash-core-components && npm ci && npm run build && python setup.py sdist && mv dist/* ../packages/ && cd ..
ls -la packages
- persist_to_workspace:
Expand Down Expand Up @@ -234,8 +234,8 @@ jobs:
pip install --no-cache-dir --upgrade -e .[dev,testing] --progress-bar off
git clone --depth 1 https://github.com/plotly/dashR.git -b dev dashR
git clone --depth 1 https://github.com/plotly/dash-html-components.git
git clone --depth 1 https://github.com/plotly/dash-core-components.git
git clone --depth 1 https://github.com/plotly/dash-table.git
git clone -b 20200814-update-deps --depth 1 https://github.com/plotly/dash-core-components.git
git clone -b 20200810-update-deps --depth 1 https://github.com/plotly/dash-table.git
shopt -s extglob
cd dash-html-components; npm ci && npm run build; rm -rf !(.|..|DESCRIPTION|LICENSE.txt|LICENSE|NAMESPACE|.Rbuildignore|R|man|inst|vignettes|build)
cd ../dash-core-components; npm ci && npm run build; rm -rf !(.|..|DESCRIPTION|LICENSE.txt|LICENSE|NAMESPACE|.Rbuildignore|R|man|inst|vignettes|build)
Expand Down
1 change: 1 addition & 0 deletions .pylintrc37
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ disable=invalid-name,
long-suffix,
old-ne-operator,
old-octal-literal,
import-outside-toplevel,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was previously ignored

import-star-module-level,
non-ascii-bytes-literal,
raw-checker-failed,
Expand Down
3 changes: 2 additions & 1 deletion dash-renderer/.prettierrc
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"tabWidth": 4,
"singleQuote": true,
"arrowParens": "avoid",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Default changed

"bracketSpacing": false,
"trailingComma": "es5"
"trailingComma": "none"
}
9,952 changes: 4,884 additions & 5,068 deletions dash-renderer/package-lock.json

Large diffs are not rendered by default.

78 changes: 39 additions & 39 deletions dash-renderer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
"scripts": {
"prepublishOnly": "rm -rf lib && babel src --extensions=\".ts,.tsx,.js,.jsx\" --out-dir lib --copy-files",
"private::format.js-eslint": "eslint --quiet --fix .",
"private::format.js-prettier": "prettier --config .prettierrc --write \"src/**/*.js\"",
"private::format.js-prettier": "prettier --config .prettierrc --write \"src/**/*.{js,ts,tsx}\"",
"private::format.ts": "tslint --fix --project tsconfig.json --config tslint.json",
"private::lint.js-eslint": "eslint .",
"private::lint.js-prettier": "prettier --config .prettierrc \"src/**/*.js\" --list-different",
"private::lint.js-prettier": "prettier --config .prettierrc \"src/**/*.{js,ts,tsx}\" --list-different",
"private::lint.ts": "tslint --project tsconfig.json --config tslint.json",
"build:js": "webpack --build release",
"build:dev": "webpack --build local",
Expand All @@ -24,63 +24,63 @@
"author": "chriddyp",
"license": "MIT",
"dependencies": {
"@babel/polyfill": "7.8.7",
"@babel/polyfill": "^7.10.4",
"@plotly/dash-component-plugins": "^1.2.0",
"cookie": "^0.4.0",
"cookie": "^0.4.1",
"dependency-graph": "^0.9.0",
"fast-isnumeric": "^1.1.3",
"fast-isnumeric": "^1.1.4",
"prop-types": "15.7.2",
"radium": "^0.26.0",
"ramda": "^0.27.0",
"react": "16.13.0",
"react-dom": "16.13.0",
"react-redux": "^7.2.0",
"ramda": "^0.27.1",
"react": "^16.13.1",
"react-dom": "^16.13.1",
"react-redux": "^7.2.1",
"redux": "^4.0.5",
"redux-actions": "^2.6.5",
"redux-thunk": "^2.3.0",
"viz.js": "2.1.2"
},
"devDependencies": {
"@babel/cli": "^7.10.3",
"@babel/core": "^7.10.3",
"@babel/plugin-proposal-class-properties": "^7.10.1",
"@babel/plugin-transform-modules-commonjs": "^7.10.1",
"@babel/preset-env": "^7.10.3",
"@babel/preset-react": "^7.10.1",
"@babel/preset-typescript": "^7.10.1",
"@svgr/webpack": "^5.2.0",
"@babel/cli": "^7.10.5",
"@babel/core": "^7.11.1",
"@babel/plugin-proposal-class-properties": "^7.10.4",
"@babel/plugin-transform-modules-commonjs": "^7.10.4",
"@babel/preset-env": "^7.11.0",
"@babel/preset-react": "^7.10.4",
"@babel/preset-typescript": "^7.10.4",
"@svgr/webpack": "^5.4.0",
"@types/ramda": "^0.27.6",
"@types/react": "^16.9.34",
"@types/react-redux": "^7.1.7",
"@types/react": "^16.9.46",
"@types/react-redux": "^7.1.9",
"@types/redux": "^3.6.0",
"@types/redux-actions": "^2.6.1",
"babel-eslint": "^10.1.0",
"babel-loader": "^8.0.6",
"babel-loader": "^8.1.0",
"css-loader": "^3.4.2",
"es-check": "^5.1.0",
"eslint": "^6.8.0",
"eslint-config-airbnb": "^18.0.1",
"eslint-config-prettier": "^6.10.0",
"eslint-plugin-import": "^2.20.1",
"eslint-plugin-jsx-a11y": "^6.2.3",
"eslint-plugin-prettier": "^3.1.2",
"eslint-plugin-react": "^7.18.3",
"jest": "^25.1.0",
"eslint": "^7.6.0",
"eslint-config-airbnb": "^18.2.0",
"eslint-config-prettier": "^6.11.0",
"eslint-plugin-import": "^2.22.0",
"eslint-plugin-jsx-a11y": "^6.3.1",
"eslint-plugin-prettier": "^3.1.4",
"eslint-plugin-react": "^7.20.6",
"jest": "^26.4.0",
"npm-run-all": "^4.1.5",
"prettier": "^1.19.1",
"prettier-eslint": "^9.0.1",
"prettier": "^2.0.5",
"prettier-eslint": "^11.0.0",
"prettier-eslint-cli": "^5.0.0",
"prettier-stylelint": "^0.4.2",
"style-loader": "^1.1.3",
"ts-jest": "^26.0.0",
"ts-loader": "^7.0.2",
"tslint": "^6.1.2",
"typescript": "^3.8.3",
"webpack": "^4.42.0",
"webpack-cli": "^3.3.11",
"webpack-dev-server": "^3.10.3",
"style-loader": "^1.2.1",
"ts-jest": "^26.2.0",
"ts-loader": "^8.0.2",
"tslint": "^6.1.3",
"typescript": "^3.9.7",
"webpack": "^4.44.1",
"webpack-cli": "^3.3.12",
"webpack-dev-server": "^3.11.0",
"webpack-serve": "^3.2.0",
"whatwg-fetch": "^3.0.0"
"whatwg-fetch": "^3.4.0"
},
"files": [
"/dash_renderer/*{.js,.map}",
Expand Down
16 changes: 8 additions & 8 deletions dash-renderer/src/APIController.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
onError,
setGraphs,
setPaths,
setLayout,
setLayout
} from './actions';
import {computePaths} from './actions/paths';
import {computeGraphs} from './actions/dependencies';
Expand All @@ -36,7 +36,7 @@ const UnconnectedContainer = props => {
error,
layoutRequest,
layout,
loadingMap,
loadingMap
} = props;

const [errorLoading, setErrorLoading] = useState(false);
Expand All @@ -55,8 +55,8 @@ const UnconnectedContainer = props => {
_dashprivate_config: propsRef.current.config,
_dashprivate_dispatch: propsRef.current.dispatch,
_dashprivate_graphs: propsRef.current.graphs,
_dashprivate_loadingMap: propsRef.current.loadingMap,
}),
_dashprivate_loadingMap: propsRef.current.loadingMap
})
});

useEffect(storeEffect.bind(null, props, events, setErrorLoading));
Expand Down Expand Up @@ -120,7 +120,7 @@ function storeEffect(props, events, setErrorLoading) {
error,
graphs,
layout,
layoutRequest,
layoutRequest
} = props;

if (isEmpty(layoutRequest)) {
Expand Down Expand Up @@ -180,7 +180,7 @@ function storeEffect(props, events, setErrorLoading) {
UnconnectedContainer.propTypes = {
appLifecycle: PropTypes.oneOf([
getAppState('STARTED'),
getAppState('HYDRATED'),
getAppState('HYDRATED')
]),
dispatch: PropTypes.func,
dependenciesRequest: PropTypes.object,
Expand All @@ -190,7 +190,7 @@ UnconnectedContainer.propTypes = {
loadingMap: PropTypes.any,
history: PropTypes.any,
error: PropTypes.object,
config: PropTypes.object,
config: PropTypes.object
};

const Container = connect(
Expand All @@ -204,7 +204,7 @@ const Container = connect(
graphs: state.graphs,
history: state.history,
error: state.error,
config: state.config,
config: state.config
}),
dispatch => ({dispatch})
)(UnconnectedContainer);
Expand Down
2 changes: 1 addition & 1 deletion dash-renderer/src/AccessDenied.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,6 @@ function AccessDenied(props) {
);
}
AccessDenied.propTypes = {
config: PropTypes.object,
config: PropTypes.object
};
export default AccessDenied;
8 changes: 4 additions & 4 deletions dash-renderer/src/AppContainer.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ class UnconnectedAppContainer extends React.Component {
credentials: 'same-origin',
headers: {
Accept: 'application/json',
'Content-Type': 'application/json',
},
'Content-Type': 'application/json'
}
};

dispatch(setConfig(config));
Expand All @@ -59,13 +59,13 @@ class UnconnectedAppContainer extends React.Component {
UnconnectedAppContainer.propTypes = {
hooks: PropTypes.object,
dispatch: PropTypes.func,
config: PropTypes.object,
config: PropTypes.object
};

const AppContainer = connect(
state => ({
history: state.history,
config: state.config,
config: state.config
}),
dispatch => ({dispatch})
)(UnconnectedAppContainer);
Expand Down
2 changes: 0 additions & 2 deletions dash-renderer/src/AppProvider.react.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,3 @@ AppProvider.defaultProps = {
};

export default AppProvider;


76 changes: 33 additions & 43 deletions dash-renderer/src/StoreObserver.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
import {
any,
filter,
forEach,
map,
path
} from 'ramda';
import {any, filter, forEach, map, path} from 'ramda';

import { Store, Unsubscribe } from 'redux';
import {Store, Unsubscribe} from 'redux';

type Observer<TStore> = (store: TStore) => void;
type UnregisterObserver = () => void;
Expand All @@ -20,7 +14,7 @@ interface IStoreObserverState<TStore> {

export interface IStoreObserverDefinition<TStore> {
observer: Observer<Store<TStore>>;
inputs: string[]
inputs: string[];
}

export default class StoreObserver<TStore> {
Expand Down Expand Up @@ -48,33 +42,31 @@ export default class StoreObserver<TStore> {
this.add(observer.observer, observer.inputs);
return () => this.remove(observer.observer);
}
}
};

setStore = (store: Store<TStore>) => {
this.__finalize__();
this.__init__(store);
}
};

private __finalize__ = () => this._unsubscribe?.()
private __finalize__ = () => this._unsubscribe?.();

private __init__ = (store?: Store<TStore>) => {
this._store = store;
if (store) {
this._unsubscribe = store.subscribe(this.notify);
}

forEach(o => o.lastState = null, this._observers);
}
forEach(o => (o.lastState = null), this._observers);
};

private add = (
observer: Observer<Store<TStore>>,
inputs: string[]
) => this._observers.push({
inputPaths: map(p => p.split('.'), inputs),
lastState: null,
observer,
triggered: false
});
private add = (observer: Observer<Store<TStore>>, inputs: string[]) =>
this._observers.push({
inputPaths: map(p => p.split('.'), inputs),
lastState: null,
observer,
triggered: false
});

private notify = () => {
const store = this._store;
Expand All @@ -85,29 +77,27 @@ export default class StoreObserver<TStore> {
const state = store.getState();

const triggered = filter(
o => !o.triggered && any(
i => path(i, state) !== path(i, o.lastState),
o.inputPaths
),
o =>
!o.triggered &&
any(i => path(i, state) !== path(i, o.lastState), o.inputPaths),
this._observers
);

forEach(o => o.triggered = true, triggered);
forEach(o => (o.triggered = true), triggered);

forEach(
o => {
o.lastState = store.getState();
o.observer(store);
o.triggered = false;
},
triggered
);
}
forEach(o => {
o.lastState = store.getState();
o.observer(store);
o.triggered = false;
}, triggered);
};

private remove = (observer: Observer<Store<TStore>>) => this._observers.splice(
this._observers.findIndex(
o => observer === o.observer,
this._observers
), 1
);
private remove = (observer: Observer<Store<TStore>>) =>
this._observers.splice(
this._observers.findIndex(
o => observer === o.observer,
this._observers
),
1
);
}
Loading