Skip to content

Commit 52fe27f

Browse files
authored
Merge branch 'dev' into fix-upload-style
2 parents e627c6f + 28e8162 commit 52fe27f

File tree

22 files changed

+288
-147
lines changed

22 files changed

+288
-147
lines changed

.github/CODEOWNERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
# These owners will be the default owners for everything in
22
# the repo. Unless a later match takes precedence
3-
* @alexcjohnson @T4rk1n @ndrezn @gvwilson @emilykl
3+
* @T4rk1n @ndrezn @gvwilson @emilykl
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
ignore_props = ['ignored_prop']

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"scripts": {
1111
"build:js": "webpack --mode production",
1212
"setup": "python setup.py sdist",
13-
"build:py_and_r": "dash-generate-components ./src/components dash_generator_test_component_typescript && cp base/** dash_generator_test_component_typescript/ && dash-generate-components ./src/components dash_generator_test_component_typescript --r-prefix 'dgtc_ts'",
13+
"build:py_and_r": "dash-generate-components ./src/components dash_generator_test_component_typescript -t _dash_prop_typing && cp base/** dash_generator_test_component_typescript/",
1414
"build": "run-s build:js build:py_and_r setup",
1515
"test": "jest"
1616
},

CHANGELOG.md

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

5+
## [unreleased]
6+
7+
## Changed
8+
- [#3113](https://github.com/plotly/dash/pull/3113) Adjusted background polling requests to strip the data from the request, this allows for context to flow as normal. This addresses issue [#3111](https://github.com/plotly/dash/pull/3111)
9+
10+
11+
## [3.0.1] - 2025-03-24
12+
13+
## Fixed
14+
15+
- [#3239](https://github.com/plotly/dash/pull/3239) Remove stringcase dependency, fix [#3238](https://github.com/plotly/dash/issues/3238)
16+
- [#3232](https://github.com/plotly/dash/pull/3232) Add error handling for when localStorage is disabled
17+
518
## [3.0.0] - 2025-03-17
619

720
## Added
@@ -45,6 +58,7 @@ This project adheres to [Semantic Versioning](https://semver.org/).
4558
- `Dash.run_server` has been removed in favor of `Dash.run`.
4659
- Removed `dcc.LogoutButton` component.
4760
- Renamed all `long` references to `background`.
61+
- Removed `dash_core_components`, `dash_html_components` and `dash_table` stub packages from `dash` install requirements.
4862

4963
## Changed
5064

components/dash-html-components/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,6 @@
5959
"/dash_html_components/*{.js,.map}"
6060
],
6161
"browserslist": [
62-
"last 9 years and not dead"
62+
"last 10 years and not dead"
6363
]
6464
}

dash/_dash_renderer.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import os
22

3-
__version__ = "2.0.4"
3+
__version__ = "2.0.5"
44

55
_available_react_versions = {"18.3.1", "18.2.0", "16.14.0"}
66
_available_reactdom_versions = {"18.3.1", "18.2.0", "16.14.0"}
@@ -64,7 +64,7 @@ def _set_react_version(v_react, v_reactdom=None):
6464
{
6565
"relative_package_path": "dash-renderer/build/dash_renderer.min.js",
6666
"dev_package_path": "dash-renderer/build/dash_renderer.dev.js",
67-
"external_url": "https://unpkg.com/[email protected].4"
67+
"external_url": "https://unpkg.com/[email protected].5"
6868
"/build/dash_renderer.min.js",
6969
"namespace": "dash",
7070
},

dash/_utils.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
import secrets
1212
import string
1313
import inspect
14+
import re
15+
1416
from html import escape
1517
from functools import wraps
1618
from typing import Union
@@ -302,3 +304,14 @@ def get_caller_name():
302304
return s.frame.f_locals.get("__name__", "__main__")
303305

304306
return "__main__"
307+
308+
309+
def pascal_case(name: Union[str, None]):
310+
s = re.sub(r"\s", "_", str(name))
311+
# Replace leading `_`
312+
s = re.sub("^[_]+", "", s)
313+
if not s:
314+
return s
315+
return s[0].upper() + re.sub(
316+
r"[\-_\.]+([a-z])", lambda match: match.group(1).upper(), s[1:]
317+
)

dash/dash-renderer/package-lock.json

Lines changed: 2 additions & 2 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: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "dash-renderer",
3-
"version": "2.0.4",
3+
"version": "2.0.5",
44
"description": "render dash components in react",
55
"main": "build/dash_renderer.min.js",
66
"scripts": {

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

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -440,6 +440,7 @@ function handleServerside(
440440
const fetchCallback = () => {
441441
const headers = getCSRFHeader() as any;
442442
let url = `${urlBase(config)}_dash-update-component`;
443+
let newBody = body;
443444

444445
const addArg = (name: string, value: string) => {
445446
let delim = '?';
@@ -448,11 +449,19 @@ function handleServerside(
448449
}
449450
url = `${url}${delim}${name}=${value}`;
450451
};
451-
if (cacheKey) {
452-
addArg('cacheKey', cacheKey);
453-
}
454-
if (job) {
455-
addArg('job', job);
452+
if (cacheKey || job) {
453+
if (cacheKey) addArg('cacheKey', cacheKey);
454+
if (job) addArg('job', job);
455+
456+
// clear inputs as background callback doesnt need inputs, just verify for context
457+
const tmpBody = JSON.parse(newBody);
458+
for (let i = 0; i < tmpBody.inputs.length; i++) {
459+
tmpBody.inputs[i]['value'] = null;
460+
}
461+
for (let i = 0; i < (tmpBody?.state || []).length; i++) {
462+
tmpBody.state[i]['value'] = null;
463+
}
464+
newBody = JSON.stringify(tmpBody);
456465
}
457466

458467
if (moreArgs) {
@@ -465,7 +474,7 @@ function handleServerside(
465474
mergeDeepRight(config.fetch, {
466475
method: 'POST',
467476
headers,
468-
body
477+
body: newBody
469478
})
470479
);
471480
};

0 commit comments

Comments
 (0)