Skip to content

Commit 91f2804

Browse files
authored
Merge pull request #2550 from plotly/master-2.10.1
Master 2.10.1
2 parents 2f5bed2 + 9980be3 commit 91f2804

File tree

13 files changed

+126
-32
lines changed

13 files changed

+126
-32
lines changed

@plotly/dash-generator-test-component-typescript/generator.test.ts

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,15 @@ describe('Test Typescript component metadata generation', () => {
106106
test(
107107
`${componentName} tuple tuple`,
108108
testTypeFactory('a_tuple', 'tuple')
109-
)
109+
);
110+
test(
111+
`${componentName} object of string`,
112+
testTypeFactory('object_of_string', 'objectOf')
113+
);
114+
test(
115+
`${componentName} object of components`,
116+
testTypeFactory('object_of_components', 'objectOf')
117+
);
110118
});
111119

112120
describe('Test prop attributes', () => {
@@ -252,6 +260,17 @@ describe('Test Typescript component metadata generation', () => {
252260
R.path(tuplePath.concat(1, 'name'), metadata)
253261
).toBe('string');
254262
}
263+
);
264+
265+
test(
266+
'objectOf node', () => {
267+
const objectOfComponents = R.path(
268+
propPath("TypeScriptComponent", "object_of_components")
269+
.concat(["type", "value", "name"]),
270+
metadata
271+
);
272+
expect(objectOfComponents).toBe("node");
273+
}
255274
)
256275
});
257276

@plotly/dash-generator-test-component-typescript/src/props.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@ export type TypescriptComponentProps = {
4343
nested?: Nested;
4444

4545
a_tuple?: [number, string];
46+
47+
object_of_string?: {[k: string]: string};
48+
object_of_components?: {[k: string]: JSX.Element};
4649
};
4750

4851
export type WrappedHTMLProps = {

CHANGELOG.md

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

5+
## [2.10.1] - 2023-05-30
6+
7+
## Fixed
8+
9+
- [#2545](https://github.com/plotly/dash/pull/2545) Fix typescript objectOf generation.
10+
- [#2548](https://github.com/plotly/dash/pull/2548) Fix component as props callback triggering other callbacks not in response, fix [#2487](https://github.com/plotly/dash/issues/2487).
11+
512
## [2.10.0] - 2023-05-25
613

714
## Changed
@@ -71,6 +78,7 @@ This project adheres to [Semantic Versioning](https://semver.org/).
7178
- [#2260](https://github.com/plotly/dash/pull/2260) Experimental support for React 18. The default is still React v16.14.0, but to use React 18 you can either set the environment variable `REACT_VERSION=18.2.0` before running your app, or inside the app call `dash._dash_renderer._set_react_version("18.2.0")`. THIS FEATURE IS EXPERIMENTAL. It has not been tested with component suites outside the Dash core, and we may add or remove available React versions in any future release.
7279
- [#2414](https://github.com/plotly/dash/pull/2414) Add `dash.Patch`for partial update Output props without transferring the previous value in a State.
7380
- [#2414](https://github.com/plotly/dash/pull/2414) Add `allow_duplicate` to `Output` arguments allowing duplicate callbacks to target the same prop.
81+
- [#2349](https://github.com/plotly/dash/pull/2349) Added new `dcc.Geolocation` component
7482

7583
## Fixed
7684

@@ -143,7 +151,6 @@ This project adheres to [Semantic Versioning](https://semver.org/).
143151

144152
### Added
145153

146-
- [#2349](https://github.com/plotly/dash/pull/2349) Added new `dcc.Geolocation` component
147154
- [#2261](https://github.com/plotly/dash/pull/2261) Added new `placeholder_text` property to `filterOptions` for DataTable which allows overriding the default filter field placeholder.
148155

149156
### Updated

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__ = "1.15.2"
3+
__version__ = "1.15.3"
44

55
_available_react_versions = {"16.14.0", "18.2.0"}
66
_available_reactdom_versions = {"16.14.0", "18.2.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].2"
67+
"external_url": "https://unpkg.com/[email protected].3"
6868
"/build/dash_renderer.min.js",
6969
"namespace": "dash",
7070
},

dash/dash-renderer/build/dash_renderer.dev.js

Lines changed: 4 additions & 4 deletions
Large diffs are not rendered by default.

dash/dash-renderer/build/dash_renderer.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

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": "1.15.2",
3+
"version": "1.15.3",
44
"description": "render dash components in react",
55
"main": "build/dash_renderer.min.js",
66
"scripts": {

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

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
import {
22
all,
3-
any,
43
assoc,
54
concat,
65
difference,
76
filter,
87
flatten,
9-
includes,
108
isEmpty,
119
keys,
1210
map,
@@ -312,13 +310,12 @@ export const getLayoutCallbacks = (
312310
rootId = stringifyId(rootId);
313311
// Filter inputs that are not present in the response
314312
callbacks = callbacks.filter(cb =>
315-
any(
316-
(inp: any) =>
317-
!(
318-
stringifyId(inp.id) === rootId &&
319-
!includes(inp.property, options.filterRoot)
320-
),
321-
cb.callback.inputs
313+
cb.callback.inputs.reduce(
314+
(previous: any, input: any) =>
315+
previous ||
316+
(stringifyId(input.id) == rootId &&
317+
options.filterRoot.includes(input.property)),
318+
false
322319
)
323320
);
324321
}

dash/extract-meta.js

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -361,16 +361,20 @@ function gatherComponents(sources, components = {}) {
361361
...getUnion(propType, propObj, newParentType),
362362
raw
363363
};
364+
} else if (propType.indexInfos && propType.indexInfos.length) {
365+
const {type} = propType.indexInfos[0];
366+
name = 'objectOf';
367+
value = getPropType(type, propObj, newParentType);
368+
} else {
369+
value = getProps(
370+
checker.getPropertiesOfType(propType),
371+
propObj,
372+
[],
373+
{},
374+
true,
375+
newParentType,
376+
);
364377
}
365-
366-
value = getProps(
367-
checker.getPropertiesOfType(propType),
368-
propObj,
369-
[],
370-
{},
371-
true,
372-
newParentType,
373-
);
374378
}
375379
}
376380

0 commit comments

Comments
 (0)