Skip to content

Commit a530052

Browse files
authored
Merge pull request #3291 from plotly/master-3.0.4
Master 3.0.4
2 parents 551d149 + 0827c93 commit a530052

File tree

208 files changed

+8488
-10400
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

208 files changed

+8488
-10400
lines changed

@plotly/dash-component-plugins/package-lock.json

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

@plotly/dash-generator-test-component-nested/package-lock.json

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

@plotly/dash-generator-test-component-standard/package-lock.json

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

@plotly/dash-generator-test-component-typescript/package-lock.json

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

@plotly/dash-test-components/package-lock.json

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

CHANGELOG.md

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

5+
## [3.0.4] - 2025-04-24
6+
7+
## Fixed
8+
- [#3278](https://github.com/plotly/dash/pull/3278) Fix loading selector with children starting at the same digit. Fix [#3276](https://github.com/plotly/dash/issues/3276)
9+
- [#3280](https://github.com/plotly/dash/pull/3280) Remove flask typing import not available in earlier versions.
10+
- [#3284](https://github.com/plotly/dash/pull/3284) Fix component as props having the same key when used in the same container.
11+
- [#3287](https://github.com/plotly/dash/pull/3287) Fix typing component generation & explicitize_args.
12+
- [#3282](https://github.com/plotly/dash/pull/3282) Fix incorrect cancellation of pattern matched long callbacks.
13+
- [#3289](https://github.com/plotly/dash/pull/3289) Fixed issue with debugTitle where status doesnt exist and allow_duplicates to ignore the hash for prop loading in the target.
14+
- [#3281](https://github.com/plotly/dash/pull/3281) Use routes_pathname_prefix for internal Alive URL in Dash app. Fix [#3270](https://github.com/plotly/dash/issues/3270)
15+
516
## [3.0.3] - 2025-04-14
617

718
## Fixed

components/dash-core-components/package-lock.json

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

components/dash-core-components/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "dash-core-components",
3-
"version": "3.0.5",
3+
"version": "3.0.6",
44
"description": "Core component suite for Dash",
55
"repository": {
66
"type": "git",
@@ -63,9 +63,9 @@
6363
"uniqid": "^5.4.0"
6464
},
6565
"devDependencies": {
66-
"@babel/cli": "^7.26.4",
66+
"@babel/cli": "^7.27.0",
6767
"@babel/core": "^7.26.10",
68-
"@babel/eslint-parser": "^7.26.10",
68+
"@babel/eslint-parser": "^7.27.0",
6969
"@babel/plugin-syntax-dynamic-import": "^7.8.3",
7070
"@babel/preset-env": "^7.26.9",
7171
"@babel/preset-react": "^7.26.3",
@@ -86,7 +86,7 @@
8686
"rimraf": "^5.0.5",
8787
"style-loader": "^3.3.3",
8888
"styled-jsx": "^3.4.4",
89-
"webpack": "^5.98.0",
89+
"webpack": "^5.99.6",
9090
"webpack-cli": "^5.1.4"
9191
},
9292
"optionalDependencies": {

components/dash-core-components/src/components/Loading.react.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,9 @@ const coveringSpinner = {
3131

3232
const loadingSelector = (componentPath, targetComponents) => state => {
3333
let stringPath = JSON.stringify(componentPath);
34-
// Remove the last ] for easy match
35-
stringPath = stringPath.substring(0, stringPath.length - 1);
34+
// Remove the last ] for easy match and add `,` to make sure only children
35+
// trigger the loading. See issue: https://github.com/plotly/dash/issues/3276
36+
stringPath = stringPath.substring(0, stringPath.length - 1) + ',';
3637
const loadingChildren = toPairs(state.loading).reduce(
3738
(acc, [path, load]) => {
3839
if (path.startsWith(stringPath) && load.length) {

components/dash-core-components/src/fragments/Loading/spinners/CircleSpinner.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ const CircleSpinner = ({
1616
style,
1717
}) => {
1818
let debugTitle;
19-
if (debug) {
19+
if (debug && status) {
2020
debugTitle = status.map((s) => <DebugTitle {...s} />);
2121
}
2222
let spinnerClass = fullscreen ? 'dash-spinner-container' : '';

components/dash-core-components/src/fragments/Loading/spinners/CubeSpinner.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import DebugTitle from './DebugTitle.jsx';
77

88
const CubeSpinner = ({status, color, fullscreen, debug, className, style}) => {
99
let debugTitle;
10-
if (debug) {
10+
if (debug && status) {
1111
debugTitle = status.map((s) => <DebugTitle {...s} />);
1212
}
1313
let spinnerClass = fullscreen ? 'dash-spinner-container' : '';

components/dash-core-components/src/fragments/Loading/spinners/DefaultSpinner.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const DefaultSpinner = ({
1515
style,
1616
}) => {
1717
let debugTitle;
18-
if (debug) {
18+
if (debug && status) {
1919
debugTitle = status.map((s) => <DebugTitle {...s} />);
2020
}
2121
let spinnerClass = fullscreen ? 'dash-spinner-container' : '';

components/dash-core-components/src/fragments/Loading/spinners/DotSpinner.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import DebugTitle from './DebugTitle.jsx';
88
*/
99
const DotSpinner = ({status, color, fullscreen, debug, className, style}) => {
1010
let debugTitle;
11-
if (debug) {
11+
if (debug && status) {
1212
debugTitle = status.map((s) => <DebugTitle {...s} />);
1313
}
1414
let spinnerClass = fullscreen ? 'dash-spinner-container' : '';

components/dash-core-components/src/fragments/Loading/spinners/GraphSpinner.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import DebugTitle from './DebugTitle.jsx';
55

66
const GraphSpinner = ({status, fullscreen, debug, className, style}) => {
77
let debugTitle;
8-
if (debug) {
8+
if (debug && status) {
99
debugTitle = status.map((s) => <DebugTitle {...s} />);
1010
}
1111
let spinnerClass = fullscreen ? 'dash-spinner-container' : '';

components/dash-core-components/tests/integration/loading/test_loading_component.py

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -689,3 +689,69 @@ def updateDiv(n_clicks):
689689
dash_dcc.wait_for_text_to_equal("#div-1", "changed")
690690

691691
assert dash_dcc.get_logs() == []
692+
693+
694+
# multiple components, only one triggers the spinner
695+
def test_ldcp017_loading_component_target_components_duplicates(dash_dcc):
696+
697+
lock = Lock()
698+
699+
app = Dash(__name__)
700+
701+
app.layout = html.Div(
702+
[
703+
dcc.Loading(
704+
[
705+
html.Button(id="btn-1"),
706+
html.Button(id="btn-2", children="content 2"),
707+
],
708+
className="loading-1",
709+
target_components={"btn-2": "children"},
710+
debug=True,
711+
)
712+
],
713+
id="root",
714+
)
715+
716+
@app.callback(Output("btn-1", "children"), [Input("btn-2", "n_clicks")])
717+
def updateDiv1(n_clicks):
718+
if n_clicks:
719+
with lock:
720+
return "changed 1"
721+
722+
return "content 1"
723+
724+
@app.callback(
725+
Output("btn-2", "children", allow_duplicate=True),
726+
[Input("btn-1", "n_clicks")],
727+
prevent_initial_call=True,
728+
)
729+
def updateDiv2(n_clicks):
730+
if n_clicks:
731+
with lock:
732+
return "changed 2"
733+
734+
return "content 2"
735+
736+
dash_dcc.start_server(app)
737+
738+
dash_dcc.wait_for_text_to_equal("#btn-1", "content 1")
739+
dash_dcc.wait_for_text_to_equal("#btn-2", "content 2")
740+
741+
with lock:
742+
dash_dcc.find_element("#btn-1").click()
743+
744+
dash_dcc.find_element(".loading-1 .dash-spinner")
745+
dash_dcc.wait_for_text_to_equal("#btn-2", "")
746+
747+
dash_dcc.wait_for_text_to_equal("#btn-2", "changed 2")
748+
749+
with lock:
750+
dash_dcc.find_element("#btn-2").click()
751+
spinners = dash_dcc.find_elements(".loading-1 .dash-spinner")
752+
dash_dcc.wait_for_text_to_equal("#btn-1", "")
753+
754+
dash_dcc.wait_for_text_to_equal("#btn-1", "changed 1")
755+
assert spinners == []
756+
757+
assert dash_dcc.get_logs() == []

0 commit comments

Comments
 (0)