Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
73 commits
Select commit Hold shift + click to select a range
e5d7249
attempting to make polling requests not eat bandwidth
Dec 30, 2024
4059c3e
Allowing state to have a fallback of `[]`
Dec 30, 2024
9c25455
fixing for lint
Dec 30, 2024
e2c3bac
swapping for camelCase
Jan 6, 2025
4d25329
fixing last camelCase
Jan 6, 2025
4b67283
fixing other errors
Jan 6, 2025
214a798
updating changelog
Jan 7, 2025
701cd68
touch to rerun tests
Jan 8, 2025
f17a71d
Merge remote-tracking branch 'remote/dev' into strip-background-polls
BSd3v Feb 3, 2025
d3f6868
Merge branch 'dev' into strip-background-polls
T4rk1n Feb 12, 2025
6775756
Add initial support for collapsing devtools
marthacryan Mar 24, 2025
16ec592
Add rotation animation
marthacryan Mar 24, 2025
4c6d2df
Move toggle collapse logic into function
marthacryan Mar 24, 2025
6c37d5b
Merge branch 'dev' into strip-background-polls
BSd3v Mar 25, 2025
da8494d
Update CHANGELOG.md
BSd3v Mar 25, 2025
5dc9a11
Merge pull request #3113 from BSd3v/strip-background-polls
T4rk1n Mar 25, 2025
e9f6826
Reopen the error dialog when new errors happen
marthacryan Mar 25, 2025
a62ddb9
Add error indicator when the devtools are collapsed
marthacryan Mar 25, 2025
b65b07f
Add sliding animation for collapse behavior
marthacryan Mar 25, 2025
b14c954
Update color of red used in error indicator
marthacryan Mar 25, 2025
81617ad
Fix incorrect width when upgrade button isn't present
marthacryan Mar 25, 2025
393e870
Adjusting memoization on the `DashWrapper` to be utilized
BSd3v Mar 26, 2025
552fd9a
Move the dash.layout.setter so that type checkers can find it easier
peter-gerlagh-kyos Mar 26, 2025
3c2898d
adjusting hash for renders
BSd3v Mar 26, 2025
d2d75a5
Merge branch 'dev' into collapse-devtools
marthacryan Mar 26, 2025
05f92b3
build
marthacryan Mar 26, 2025
9276a63
Merge branch 'collapse-devtools' of github.com:plotly/dash into colla…
marthacryan Mar 26, 2025
ecc2e03
Merge pull request #3241 from plotly/collapse-devtools
marthacryan Mar 26, 2025
15516d6
Merge branch 'dev' into fix/help-mypy-with-layout-setter
T4rk1n Mar 27, 2025
28e8162
Merge pull request #3249 from peter-gerlagh-kyos/fix/help-mypy-with-l…
T4rk1n Mar 27, 2025
25c20de
simplifying and using the reducer to trigger adjustments only if the …
BSd3v Mar 27, 2025
dc2e2bd
making json stringify simpler to keep from circular references
BSd3v Mar 27, 2025
adbb030
testing internal `setProps` to make sure the component is still in th…
BSd3v Mar 27, 2025
b77e7b7
fixing issue with `set_progress` not triggering properly when needing…
BSd3v Mar 27, 2025
e627c6f
fix upload style
AnnMarieW Mar 27, 2025
52fe27f
Merge branch 'dev' into fix-upload-style
AnnMarieW Mar 27, 2025
4341cb7
fix upload style - changelog
AnnMarieW Mar 27, 2025
e38cc3a
fix upload style - lint
AnnMarieW Mar 27, 2025
0bd4452
Merge pull request #3251 from AnnMarieW/fix-upload-style
T4rk1n Mar 27, 2025
5eed5fe
refactor for `dashWrapper` made the `reducer` recursive to get the ne…
BSd3v Mar 27, 2025
02bf1c8
reverting to using memo, but only memoizing on the hash
BSd3v Mar 28, 2025
cbc93b9
adjustments for how children are added when the prop was changed
BSd3v Mar 28, 2025
8ae3b22
adding support for sending hashes to components as props
BSd3v Mar 28, 2025
5c505e9
adjusting children for rerendering
BSd3v Mar 28, 2025
3d4ec1d
adding changelog entry
BSd3v Mar 28, 2025
c772126
updated wrapper to pass new props down to the components upon a new r…
BSd3v Mar 29, 2025
62ec2ac
adding ignore for unused var
BSd3v Mar 29, 2025
197901a
swapped hash with actual item and props
BSd3v Mar 29, 2025
e2f89e9
adjustments for lint
BSd3v Mar 29, 2025
8862956
updated patch test to use until instead of assert to allow timing flux
BSd3v Mar 29, 2025
3bc85d3
fixing for lint
BSd3v Mar 29, 2025
5c6dbc3
adjusting to only render children components as 'new' if it is a new …
BSd3v Mar 31, 2025
889b4a5
removed the new prop being passed down: `rendertype`
BSd3v Mar 31, 2025
9c8a62a
adding `renderType` but making it a conditional prop that the compone…
BSd3v Mar 31, 2025
ef41561
adding test component and test for rendertype prop
BSd3v Mar 31, 2025
c409895
removing unused import
BSd3v Mar 31, 2025
bf00422
Merge remote-tracking branch 'remote/dev' into performance-adjust
BSd3v Mar 31, 2025
ce1da9a
adjusting `renderType` to `dashRenderType` if the dev wants to subscr…
BSd3v Mar 31, 2025
f0db8c5
replacing `Date.now()` with new object to force rerender
BSd3v Mar 31, 2025
6588aac
adjusting for lint
BSd3v Mar 31, 2025
5e1bdf3
adjustments from feedback
BSd3v Mar 31, 2025
96166c8
adjusting for `state` no longer needed in dispatch
BSd3v Apr 1, 2025
3ade208
adjustments based on feedback
BSd3v Apr 1, 2025
6f744f0
reverting errant adjustment
BSd3v Apr 1, 2025
04fc346
additional `component` -> `renderComponent` adjustments
BSd3v Apr 1, 2025
0dea738
adjusting for missing variable swaps and removing unused `memoizeProps`
BSd3v Apr 1, 2025
cde9acf
updating change log entry
BSd3v Apr 1, 2025
8f585b5
Merge pull request #3248 from BSd3v/performance-adjust
T4rk1n Apr 1, 2025
dd6028d
Delete dash_prop_typing again
T4rk1n Apr 1, 2025
64f75b6
Version 3.0.2
T4rk1n Apr 1, 2025
ef3cb85
Merge pull request #3255 from plotly/version-3.0.2
T4rk1n Apr 1, 2025
60adeca
Merge branch 'dev' into master-3.0.2
T4rk1n Apr 1, 2025
df154ea
Version 3.0.2 build artifacts
T4rk1n Apr 1, 2025
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

This file was deleted.

23 changes: 23 additions & 0 deletions @plotly/dash-test-components/src/components/RenderType.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import React, { useState, useEffect } from "react";
import PropTypes from "prop-types";

const RenderType = (props) => {
const onClick = () => {
props.setProps({n_clicks: (props.n_clicks || 0) + 1})
}

return <div id={props.id}>
<span>{props.dashRenderType}</span>
<button onClick={onClick}>Test Internal</button>
</div>;
};

RenderType.propTypes = {
id: PropTypes.string,
dashRenderType: PropTypes.string,
n_clicks: PropTypes.number,
setProps: PropTypes.func
};

RenderType.dashRenderType = true;
export default RenderType;
2 changes: 2 additions & 0 deletions @plotly/dash-test-components/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import MyPersistedComponentNested from './components/MyPersistedComponentNested'
import StyledComponent from './components/StyledComponent';
import WidthComponent from './components/WidthComponent';
import ComponentAsProp from './components/ComponentAsProp';
import RenderType from './components/RenderType';

import DrawCounter from './components/DrawCounter';
import AddPropsComponent from "./components/AddPropsComponent";
Expand All @@ -32,4 +33,5 @@ export {
ShapeOrExactKeepOrderComponent,
ArrayOfExactOrShapeWithNodePropAssignNone,
ExternalComponent,
RenderType
};
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,22 @@
All notable changes to `dash` will be documented in this file.
This project adheres to [Semantic Versioning](https://semver.org/).

## [3.0.2] - 2025-04-01

## Changed
- [#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)
- [#3248](https://github.com/plotly/dash/pull/3248) Changes to rendering logic:
- if it is first time rendering, render from the parent props
- listens only to updates for that single component, no children listening to parents
- if parents change a prop with components as props, only the prop changed re-renders, this is then forced on all children regardless of whether or not the props changed

## Fixed
- [#3251](https://github.com/plotly/dash/pull/3251). Prevented default styles from overriding `className_*` props in `dcc.Upload` component.

## Added
- [#3248](https://github.com/plotly/dash/pull/3248) added new `dashRenderType` to determine why the component layout was changed (`internal`, `callback`, `parent`, `clientsideApi`):
- this can be utilized to keep from rendering components by the component having `dashRenderType` defined as a prop, and the `dashRenderType = true` must be set on the component, eg (`Div.dashRenderType = true`)

## [3.0.1] - 2025-03-24

## Fixed
Expand Down
4 changes: 2 additions & 2 deletions components/dash-core-components/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion components/dash-core-components/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "dash-core-components",
"version": "3.0.3",
"version": "3.0.4",
"description": "Core component suite for Dash",
"repository": {
"type": "git",
Expand Down
11 changes: 8 additions & 3 deletions components/dash-core-components/src/fragments/Upload.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,11 @@ export default class Upload extends Component {
style_reject,
style_disabled,
} = this.props;

const activeStyle = className_active ? undefined : style_active;
const disabledStyle = className_disabled ? undefined : style_disabled;
const rejectStyle = className_reject ? undefined : style_reject;

return (
<LoadingElement id={id}>
<Dropzone
Expand All @@ -79,9 +84,9 @@ export default class Upload extends Component {
rejectClassName={className_reject}
disabledClassName={className_disabled}
style={style}
activeStyle={style_active}
rejectStyle={style_reject}
disabledStyle={style_disabled}
activeStyle={activeStyle}
rejectStyle={rejectStyle}
disabledStyle={disabledStyle}
>
{children}
</Dropzone>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,32 @@ def test_upca001_upload_children_gallery(dash_dcc):
"textAlign": "center",
},
),
dcc.Upload(
"upload",
disabled=True,
className_disabled="upload-disabled",
id="upload",
),
dcc.Upload("upload", disabled=True, id="upload-no-className"),
]
)
dash_dcc.start_server(app)
time.sleep(0.5)
dash_dcc.percy_snapshot("upca001 children gallery")

first_child = dash_dcc.find_element("#upload").find_element_by_css_selector(
":first-child"
)
# Check that there is no default style since className is specified
style = first_child.get_attribute("style")
assert "opacity: 0.5" not in style

first_child = dash_dcc.find_element(
"#upload-no-className"
).find_element_by_css_selector(":first-child")

# Check that there is default style since no className is specified
style = first_child.get_attribute("style")
assert "opacity: 0.5" in style

assert dash_dcc.get_logs() == []
4 changes: 2 additions & 2 deletions dash/_dash_renderer.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import os

__version__ = "2.0.5"
__version__ = "2.0.6"

_available_react_versions = {"18.3.1", "18.2.0", "16.14.0"}
_available_reactdom_versions = {"18.3.1", "18.2.0", "16.14.0"}
Expand Down Expand Up @@ -64,7 +64,7 @@ def _set_react_version(v_react, v_reactdom=None):
{
"relative_package_path": "dash-renderer/build/dash_renderer.min.js",
"dev_package_path": "dash-renderer/build/dash_renderer.dev.js",
"external_url": "https://unpkg.com/dash-renderer@2.0.5"
"external_url": "https://unpkg.com/dash-renderer@2.0.6"
"/build/dash_renderer.min.js",
"namespace": "dash",
},
Expand Down
444 changes: 270 additions & 174 deletions dash/dash-renderer/build/dash_renderer.dev.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dash/dash-renderer/build/dash_renderer.min.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dash/dash-renderer/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dash/dash-renderer/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "dash-renderer",
"version": "2.0.5",
"version": "2.0.6",
"description": "render dash components in react",
"main": "build/dash_renderer.min.js",
"scripts": {
Expand Down
24 changes: 17 additions & 7 deletions dash/dash-renderer/src/actions/callbacks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,8 @@ function updateComponent(component_id: any, props: any, cb: ICallbackPayload) {
dispatch(
updateProps({
props,
itempath: componentPath
itempath: componentPath,
renderType: 'callback'
})
);
dispatch(notifyObservers({id: component_id, props}));
Expand Down Expand Up @@ -440,6 +441,7 @@ function handleServerside(
const fetchCallback = () => {
const headers = getCSRFHeader() as any;
let url = `${urlBase(config)}_dash-update-component`;
let newBody = body;

const addArg = (name: string, value: string) => {
let delim = '?';
Expand All @@ -448,11 +450,19 @@ function handleServerside(
}
url = `${url}${delim}${name}=${value}`;
};
if (cacheKey) {
addArg('cacheKey', cacheKey);
}
if (job) {
addArg('job', job);
if (cacheKey || job) {
if (cacheKey) addArg('cacheKey', cacheKey);
if (job) addArg('job', job);

// clear inputs as background callback doesnt need inputs, just verify for context
const tmpBody = JSON.parse(newBody);
for (let i = 0; i < tmpBody.inputs.length; i++) {
tmpBody.inputs[i]['value'] = null;
}
for (let i = 0; i < (tmpBody?.state || []).length; i++) {
tmpBody.state[i]['value'] = null;
}
newBody = JSON.stringify(tmpBody);
}

if (moreArgs) {
Expand All @@ -465,7 +475,7 @@ function handleServerside(
mergeDeepRight(config.fetch, {
method: 'POST',
headers,
body
body: newBody
})
);
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@
background: #ffffff;
display: inline-block;
/* shadow-1 */
box-shadow:
0px 6px 16px rgba(80, 103, 132, 0.165),
box-shadow: 0px 6px 16px rgba(80, 103, 132, 0.165),
0px 2px 6px rgba(80, 103, 132, 0.12),
0px 0px 1px rgba(80, 103, 132, 0.32);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@
}

.dash-be-error__str {
background-color: #F5F6FA;
background-color: #f5f6fa;
min-width: 386px;
width: 100%;
overflow: auto;
Expand Down Expand Up @@ -177,8 +177,7 @@
background-color: white;
overflow: auto;
border-radius: 6px;
box-shadow:
0px 0.7px 1.4px 0px rgba(0, 0, 0, 0.07),
box-shadow: 0px 0.7px 1.4px 0px rgba(0, 0, 0, 0.07),
0px 1.9px 4px 0px rgba(0, 0, 0, 0.05),
0px 4.5px 10px 0px rgba(0, 0, 0, 0.05);
}
Expand Down
1 change: 1 addition & 0 deletions dash/dash-renderer/src/components/error/icons/Expand.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
59 changes: 39 additions & 20 deletions dash/dash-renderer/src/components/error/menu/DebugMenu.css
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,14 @@
font-size: 14px;
border-radius: 0px;
letter-spacing: normal;
white-space: nowrap;
gap: 6px;
cursor: pointer;
border: none;
background: none;
outline: none;
display: flex;
align-items: center;
}

.dash-debug-menu__popup {
Expand All @@ -52,8 +59,7 @@
align-self: flex-end;
position: relative;
/* Shadow/Small */
box-shadow:
0px 0.7px 1.4px 0px rgba(0, 0, 0, 0.07),
box-shadow: 0px 0.7px 1.4px 0px rgba(0, 0, 0, 0.07),
0px 1.9px 4px 0px rgba(0, 0, 0, 0.05),
0px 4.5px 10px 0px rgba(0, 0, 0, 0.05);
}
Expand Down Expand Up @@ -113,30 +119,28 @@
transition: 0.3s;
box-sizing: border-box;
position: fixed;
bottom: 8px;
right: 8px;
bottom: -1px;
right: -1px;
display: flex;
color: black;
flex-direction: column;
flex-direction: row;
font-family: Verdana, sans-serif !important;
font-size: 14px;
justify-content: center;
justify-content: flex-end;
align-items: center;
z-index: 10000;
border-radius: 5px;
padding: 5px;
border-radius: 5px 0 0 0;
padding: 15px 0;
background-color: #f5f6fa;
box-shadow:
0px 0.8px 0.8px 0px rgba(0, 0, 0, 0.04),
box-shadow: 0px 0.8px 0.8px 0px rgba(0, 0, 0, 0.04),
0px 2.3px 2px 0px rgba(0, 0, 0, 0.03);
border: 1px solid rgba(0, 24, 102, 0.1);
}
.dash-debug-menu__outer--closed {
height: 60px;
width: 60px;
bottom: 37px;
right: 37px;
padding: 0;
.dash-debug-menu__outer.dash-debug-menu__outer--collapsed {
max-width: 50px;
}
.dash-debug-menu__outer.dash-debug-menu__outer--expanded {
max-width: 682px;
}

.dash-debug-menu__upgrade-tooltip {
Expand All @@ -153,6 +157,22 @@
z-index: 1200;
}

.dash-debug-menu__toggle {
color: #7f4bc4;
transition: 0.3s;
}
.dash-debug-menu__toggle--expanded {
transform: rotate(180deg);
}
.dash-debug-menu__error-indicator {
width: 8px;
height: 8px;
background-color: #DC3E42;
border-radius: 100%;
position: absolute;
right: 3px;
top: 13px;
}
.dash-debug-menu__status {
display: flex;
align-items: center;
Expand All @@ -162,7 +182,8 @@
.dash-debug-menu__content {
display: flex;
align-items: stretch;
margin: 10px;
margin-left: 15px;
transition: all 0.5s ease;
}

.dash-debug-menu__version {
Expand All @@ -186,7 +207,6 @@
justify-content: center;
align-items: center;
transition: background-color 0.2s;
cursor: pointer;
font-family: Verdana, sans-serif !important;
font-weight: bold;
color: black;
Expand All @@ -213,8 +233,7 @@
right: 29px;
z-index: 10002;
cursor: pointer;
box-shadow:
0px 0px 1px rgba(0, 0, 0, 0.25),
box-shadow: 0px 0px 1px rgba(0, 0, 0, 0.25),
0px 1px 3px rgba(162, 177, 198, 0.32);
border-radius: 32px;
background-color: white;
Expand Down
Loading