Skip to content

Commit a846f53

Browse files
authored
Merge branch 'dev' into clientside-triggered_id
2 parents 09fb52b + f70b3db commit a846f53

File tree

7 files changed

+1031
-933
lines changed

7 files changed

+1031
-933
lines changed

CHANGELOG.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,15 @@
22
All notable changes to `dash` will be documented in this file.
33
This project adheres to [Semantic Versioning](https://semver.org/).
44

5-
65
## [UNRELEASED]
76
### Added
87
- [#2695](https://github.com/plotly/dash/pull/2695) Adds `triggered_id` to `dash_clientside.callback_context`. Fixes [#2692](https://github.com/plotly/dash/issues/2692)
98

9+
## [2.14.2] - 2023-11-27
10+
11+
## Fixed
12+
13+
- [#2700](https://github.com/plotly/dash/pull/2700) Fix `_allow_dynamic_callbacks` for newly-added components.
1014

1115
## [2.14.1] - 2023-10-26
1216

dash/dash-renderer/package-lock.json

Lines changed: 976 additions & 914 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dash/dash-renderer/package.json

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "dash-renderer",
3-
"version": "1.17.0",
3+
"version": "1.17.1",
44
"description": "render dash components in react",
55
"main": "build/dash_renderer.min.js",
66
"scripts": {
@@ -23,15 +23,15 @@
2323
"dependencies": {
2424
"@babel/polyfill": "^7.12.1",
2525
"@plotly/dash-component-plugins": "^1.2.3",
26-
"cookie": "^0.5.0",
27-
"cytoscape": "^3.25.0",
26+
"cookie": "^0.6.0",
27+
"cytoscape": "^3.27.0",
2828
"cytoscape-dagre": "^2.5.0",
2929
"cytoscape-fcose": "^2.2.0",
3030
"dependency-graph": "^0.11.0",
3131
"fast-isnumeric": "^1.1.4",
3232
"node-polyfill-webpack-plugin": "^2.0.1",
3333
"prop-types": "15.8.1",
34-
"ramda": "^0.29.0",
34+
"ramda": "^0.29.1",
3535
"react": "16.14.0",
3636
"react-cytoscapejs": "^2.0.0",
3737
"react-dom": "16.14.0",
@@ -43,14 +43,14 @@
4343
"regenerator-runtime": "^0.13.11"
4444
},
4545
"devDependencies": {
46-
"@babel/cli": "^7.23.0",
47-
"@babel/core": "^7.23.0",
46+
"@babel/cli": "^7.23.4",
47+
"@babel/core": "^7.23.3",
4848
"@babel/plugin-proposal-class-properties": "^7.18.6",
49-
"@babel/preset-env": "^7.22.20",
50-
"@babel/preset-react": "^7.22.15",
51-
"@babel/preset-typescript": "^7.23.0",
49+
"@babel/preset-env": "^7.23.3",
50+
"@babel/preset-react": "^7.23.3",
51+
"@babel/preset-typescript": "^7.23.3",
5252
"@plotly/prettier-config-dash": "0.0.1",
53-
"@svgr/webpack": "^8.0.1",
53+
"@svgr/webpack": "^8.1.0",
5454
"@types/chai": "^4.3.5",
5555
"@types/mocha": "^10.0.1",
5656
"@types/ramda": "0.29.1",
@@ -60,7 +60,7 @@
6060
"@typescript-eslint/eslint-plugin": "^5.59.7",
6161
"@typescript-eslint/parser": "^5.59.7",
6262
"babel-loader": "^9.1.3",
63-
"chai": "^4.3.7",
63+
"chai": "^4.3.10",
6464
"css-loader": "^6.8.1",
6565
"es-check": "^7.1.1",
6666
"eslint": "^8.41.0",
@@ -75,11 +75,11 @@
7575
"npm-run-all": "^4.1.5",
7676
"prettier": "^2.8.8",
7777
"style-loader": "^3.3.3",
78-
"ts-loader": "^9.4.4",
78+
"ts-loader": "^9.5.1",
7979
"typescript": "^5.1.6",
80-
"webpack": "^5.88.2",
80+
"webpack": "^5.89.0",
8181
"webpack-cli": "^5.1.4",
82-
"whatwg-fetch": "^3.6.2"
82+
"whatwg-fetch": "^3.6.19"
8383
},
8484
"files": [
8585
"build/*{.js,.map}",

dash/dash-renderer/src/APIController.react.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ function storeEffect(props, events, setErrorLoading) {
166166
);
167167
} else if (
168168
dependenciesRequest.status === STATUS.OK &&
169-
isEmpty(graphs)
169+
(isEmpty(graphs) || graphs.reset)
170170
) {
171171
dispatch(
172172
setGraphs(

dash/dash-renderer/src/actions/requestDependencies.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,10 @@ import {setGraphs} from './index';
33
import apiThunk from './api';
44

55
export function requestDependencies() {
6-
return (dispatch: any) => {
6+
return (dispatch: any, getState: any) => {
77
batch(() => {
8-
dispatch(setGraphs({}));
8+
const {graphs} = getState();
9+
dispatch(setGraphs({...graphs, reset: true}));
910
dispatch(
1011
apiThunk('_dash-dependencies', 'GET', 'dependenciesRequest')
1112
);

dash/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "2.14.1"
1+
__version__ = "2.14.2"

tests/integration/callbacks/test_dynamic_callback.py

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,3 +42,34 @@ def on_click2(n_clicks2):
4242

4343
dash_duo.wait_for_element("#dynamic").click()
4444
dash_duo.wait_for_text_to_equal("#output-2", "Dynamic clicks 2")
45+
46+
47+
def test_dync002_dynamic_callback_without_element(dash_duo):
48+
app = Dash()
49+
50+
app.layout = html.Div(
51+
[
52+
html.Button("Add callbacks", id="add-callbacks"),
53+
html.Div(id="output"),
54+
]
55+
)
56+
57+
@app.callback(
58+
Output("output", "children"),
59+
Input("add-callbacks", "n_clicks"),
60+
_allow_dynamic_callbacks=True,
61+
prevent_initial_call=True,
62+
)
63+
def on_add_callback(_):
64+
@app.callback(Output("no-exist", "children"), Input("invalid", "n_clicks"))
65+
def addition(_):
66+
return "additional"
67+
68+
return html.Div("add callbacks")
69+
70+
dash_duo.start_server(app)
71+
72+
dash_duo.wait_for_element("#add-callbacks").click()
73+
dash_duo.wait_for_text_to_equal("#output", "add callbacks")
74+
75+
assert dash_duo.get_logs() == []

0 commit comments

Comments
 (0)