Skip to content

Commit 32d74e4

Browse files
committed
Merge branch 'dev' into master-3.0.0
2 parents a1049de + 86c25f1 commit 32d74e4

File tree

240 files changed

+10991
-10117
lines changed

Some content is hidden

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

240 files changed

+10991
-10117
lines changed

.circleci/config.yml

+37-73
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ version: 2.1
33
orbs:
44
win: circleci/[email protected]
55
percy: percy/[email protected]
6-
browser-tools: circleci/browser-tools@1.4.8
6+
browser-tools: circleci/browser-tools@1.5.1
77

88

99
jobs:
@@ -99,7 +99,11 @@ jobs:
9999

100100
steps:
101101
- checkout
102-
- run: sudo apt-get update
102+
- run:
103+
name: Add chrome keys & update.
104+
command: |
105+
wget -q -O - https://dl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
106+
sudo apt-get update
103107
- run: echo $PYVERSION > ver.txt
104108
- run: cat requirements/*.txt > requirements-all.txt
105109
- restore_cache:
@@ -189,7 +193,11 @@ jobs:
189193
steps:
190194
- checkout:
191195
path: ~/dash
192-
- run: sudo apt-get update
196+
- run:
197+
name: Add chrome keys & update.
198+
command: |
199+
wget -q -O - https://dl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
200+
sudo apt-get update
193201
- run: echo $PYVERSION > ver.txt
194202
- run: cat requirements/*.txt > requirements-all.txt
195203
- restore_cache:
@@ -219,24 +227,6 @@ jobs:
219227
- store_artifacts:
220228
path: /tmp/dash_artifacts
221229

222-
test-312-react-18:
223-
<<: *test
224-
docker:
225-
- image: cimg/python:3.12.1-browsers
226-
auth:
227-
username: dashautomation
228-
password: $DASH_PAT_DOCKERHUB
229-
environment:
230-
PERCY_ENABLE: 0
231-
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: True
232-
PYVERSION: python312
233-
REDIS_URL: redis://localhost:6379
234-
REACT_VERSION: "18.2.0"
235-
- image: cimg/redis:6.2.6
236-
auth:
237-
username: dashautomation
238-
password: $DASH_PAT_DOCKERHUB
239-
240230
test-38:
241231
<<: *test
242232
docker:
@@ -306,7 +296,11 @@ jobs:
306296
steps:
307297
- checkout:
308298
path: ~/dash
309-
- run: sudo apt-get update
299+
- run:
300+
name: Add chrome keys & update.
301+
command: |
302+
wget -q -O - https://dl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
303+
sudo apt-get update
310304
- run: echo $PYVERSION > ver.txt
311305
- run: cat requirements/*.txt > requirements-all.txt
312306
- restore_cache:
@@ -337,18 +331,6 @@ jobs:
337331
- store_artifacts:
338332
path: /tmp/dash_artifacts
339333

340-
dcc-312-react-18:
341-
<<: *dcc-test
342-
docker:
343-
- image: cimg/python:3.12.1-browsers
344-
auth:
345-
username: dashautomation
346-
password: $DASH_PAT_DOCKERHUB
347-
environment:
348-
PYVERSION: python312
349-
PERCY_ENABLE: 0
350-
REACT_VERSION: "18.2.0"
351-
352334
dcc-38:
353335
<<: *dcc-test
354336
docker:
@@ -375,7 +357,11 @@ jobs:
375357
steps:
376358
- checkout:
377359
path: ~/dash
378-
- run: sudo apt-get update
360+
- run:
361+
name: Add chrome keys & update.
362+
command: |
363+
wget -q -O - https://dl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
364+
sudo apt-get update
379365
- run: echo $PYVERSION > ver.txt
380366
- run: cat requirements/*.txt > requirements-all.txt
381367
- restore_cache:
@@ -414,18 +400,6 @@ jobs:
414400
- store_artifacts:
415401
path: /tmp/dash_artifacts
416402

417-
html-312-react-18:
418-
<<: *html-test
419-
docker:
420-
- image: cimg/python:3.12.1-browsers
421-
auth:
422-
username: dashautomation
423-
password: $DASH_PAT_DOCKERHUB
424-
environment:
425-
PYVERSION: python312
426-
PERCY_ENABLE: 0
427-
REACT_VERSION: "18.2.0"
428-
429403
html-38:
430404
<<: *html-test
431405
docker:
@@ -451,7 +425,11 @@ jobs:
451425
steps:
452426
- checkout:
453427
path: ~/dash
454-
- run: sudo apt-get update
428+
- run:
429+
name: Add chrome keys & update.
430+
command: |
431+
wget -q -O - https://dl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
432+
sudo apt-get update
455433
- run: echo $PYVERSION > ver.txt
456434
- run: cat requirements/*.txt > requirements-all.txt
457435
- restore_cache:
@@ -486,15 +464,6 @@ jobs:
486464
- store_artifacts:
487465
path: /tmp/dash_artifacts
488466

489-
table-server-react-18:
490-
<<: *table-server
491-
docker:
492-
- image: cimg/python:3.12.1-browsers
493-
environment:
494-
PYVERSION: python312
495-
PERCY_ENABLE: 0
496-
REACT_VERSION: "18.2.0"
497-
498467
table-unit-test:
499468
working_directory: ~/dash
500469
docker:
@@ -505,7 +474,11 @@ jobs:
505474
steps:
506475
- checkout:
507476
path: ~/dash
508-
- run: sudo apt-get update
477+
- run:
478+
name: Add chrome keys & update.
479+
command: |
480+
wget -q -O - https://dl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
481+
sudo apt-get update
509482
- run: echo $PYVERSION > ver.txt
510483
- run: cat requirements/*.txt > requirements-all.txt
511484
- restore_cache:
@@ -540,18 +513,21 @@ jobs:
540513
table-visual-test:
541514
working_directory: ~/dash/components/dash-table
542515
docker:
543-
- image: cimg/node:16.13-browsers
516+
- image: cimg/node:lts-browsers
544517
environment:
545518
PERCY_TOKEN: $PERCY_TOKEN_TABLE
546519

547520
steps:
548521
- checkout:
549522
path: ~/dash
550-
- run: sudo apt-get update
523+
- run:
524+
name: Add chrome keys & update.
525+
command: |
526+
wget -q -O - https://dl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
527+
sudo apt-get update
551528
- restore_cache:
552529
key: dep-{{ .Branch }}-{{ checksum "package-lock.json" }}-{{ checksum "package.json" }}
553530
- browser-tools/install-browser-tools:
554-
chrome-version: 120.0.6099.71
555531
install-firefox: false
556532
install-geckodriver: false
557533
- run:
@@ -628,9 +604,6 @@ workflows:
628604
- test-312:
629605
requires:
630606
- install-dependencies-312
631-
- test-312-react-18:
632-
requires:
633-
- install-dependencies-312
634607
- test-38:
635608
requires:
636609
- install-dependencies-38
@@ -645,19 +618,13 @@ workflows:
645618
- dcc-312:
646619
requires:
647620
- install-dependencies-312
648-
- dcc-312-react-18:
649-
requires:
650-
- install-dependencies-312
651621
- dcc-38:
652622
requires:
653623
- install-dependencies-38
654624

655625
- html-312:
656626
requires:
657627
- install-dependencies-312
658-
- html-312-react-18:
659-
requires:
660-
- install-dependencies-312
661628
- html-38:
662629
requires:
663630
- install-dependencies-38
@@ -672,9 +639,6 @@ workflows:
672639
- table-server:
673640
requires:
674641
- install-dependencies-312
675-
- table-server-react-18:
676-
requires:
677-
- install-dependencies-312
678642

679643
- percy/finalize_all:
680644
requires:

.editorconfig

+2-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ charset = utf-8
1212
indent_style = space
1313
indent_size = 4
1414

15-
# Matches the exact files either package.json or .travis.yml
15+
# Matches the exact files either package.json or .circleci/config.yml
1616
[{package.json,.circleci/config.yml}]
1717
indent_style = space
1818
indent_size = 2
19+

.pylintrc

+1
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ disable=fixme,
7575
unnecessary-lambda-assignment,
7676
broad-exception-raised,
7777
consider-using-generator,
78+
too-many-ancestors
7879

7980

8081
# Enable the message, report, category or checker with the given id(s). You can

@plotly/dash-generator-test-component-nested/src/components/MyNestedComponent.js

+1-5
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import React from 'react';
44
/**
55
* MyNestedComponent description
66
*/
7-
const MyNestedComponent = ({ id, value }) => (<div id={id}>{value}</div>);
7+
const MyNestedComponent = ({ id, value = '' }) => (<div id={id}>{value}</div>);
88

99
MyNestedComponent.propTypes = {
1010
/**
@@ -18,8 +18,4 @@ MyNestedComponent.propTypes = {
1818
value: PropTypes.string
1919
};
2020

21-
MyNestedComponent.defaultProps = {
22-
value: ''
23-
};
24-
2521
export default MyNestedComponent;

@plotly/dash-generator-test-component-standard/src/components/MyStandardComponent.js

+2-6
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import React from 'react';
44
/**
55
* MyComponent description
66
*/
7-
const MyStandardComponent = ({ id, style, value }) => (<div id={id} style={style}>{value}</div>);
7+
const MyStandardComponent = ({ id, style, value = '' }) => (<div id={id} style={style}>{value}</div>);
88

99
MyStandardComponent.propTypes = {
1010
/**
@@ -23,8 +23,4 @@ MyStandardComponent.propTypes = {
2323
value: PropTypes.string
2424
};
2525

26-
MyStandardComponent.defaultProps = {
27-
value: ''
28-
};
29-
30-
export default MyStandardComponent;
26+
export default MyStandardComponent;

@plotly/dash-generator-test-component-typescript/base/__init__.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,12 @@
1616
dict(
1717
relative_package_path='dash_generator_test_component_typescript.js',
1818
namespace='dash_generator_test_component_typescript'
19-
)
19+
),
20+
{
21+
"dev_package_path": "proptypes.js",
22+
"dev_only": True,
23+
"namespace": 'dash_generator_test_component_typescript'
24+
}
2025
]
2126

2227
for _component in __all__:
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
ignore_props = ['ignored_prop']

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

+17
Original file line numberDiff line numberDiff line change
@@ -271,6 +271,23 @@ describe('Test Typescript component metadata generation', () => {
271271
);
272272
expect(objectOfComponents).toBe("node");
273273
}
274+
);
275+
276+
test(
277+
'union and literal values', () => {
278+
const propType = R.path(
279+
propPath('TypeScriptComponent', 'union_enum').concat(
280+
'type'
281+
),
282+
metadata
283+
);
284+
expect(propType.name).toBe('union');
285+
expect(propType.value.length).toBe(3);
286+
expect(propType.value[0].name).toBe('number');
287+
expect(propType.value[1].name).toBe('literal');
288+
expect(propType.value[2].name).toBe('literal');
289+
expect(propType.value[1].value).toBe('small');
290+
}
274291
)
275292
});
276293

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

+3
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ export type TypescriptComponentProps = {
2525
array_obj?: {a: string}[];
2626
array_any?: any[];
2727
enum_string?: 'one' | 'two';
28+
enum_number?: 2 | 3 | 4 | 5 | 6;
2829
union?: number | string;
2930
union_shape?: {a: string} | string;
3031
array_union_shape?: ({a: string} | string)[];
@@ -46,6 +47,8 @@ export type TypescriptComponentProps = {
4647

4748
object_of_string?: {[k: string]: string};
4849
object_of_components?: {[k: string]: JSX.Element};
50+
ignored_prop?: {ignore: {me: string}};
51+
union_enum?: number | 'small' | 'large'
4952
};
5053

5154
export type WrappedHTMLProps = {

@plotly/dash-test-components/src/components/AddPropsComponent.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,8 @@ const AddPropsComponent = (props) => {
77

88
return (
99
<div id={id}>
10-
{React.cloneElement(children, {
10+
{React.cloneElement(children, {
1111
receive: `Element #${id} pass`,
12-
id: id,
1312
})}
1413
</div>
1514
);

@plotly/dash-test-components/src/components/AsyncComponent.js

-2
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,4 @@ AsyncComponent.propTypes = {
1414
value: PropTypes.string
1515
};
1616

17-
AsyncComponent.defaultProps = {};
18-
1917
export default AsyncComponent;

@plotly/dash-test-components/src/components/CollapseComponent.js

-4
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,4 @@ CollapseComponent.propTypes = {
1111
id: PropTypes.string
1212
};
1313

14-
CollapseComponent.defaultProps = {
15-
display: false
16-
};
17-
1814
export default CollapseComponent;
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import PropTypes from 'prop-types';
22
import React from 'react';
33

4-
const DelayedEventComponent = ({ id, n_clicks, setProps }) => (<button
4+
const DelayedEventComponent = ({ id, n_clicks = 0, setProps }) => (<button
55
id={id}
66
onClick={() => setTimeout(() => setProps({ n_clicks: n_clicks + 1 }), 20)}
77
/>);
@@ -11,8 +11,4 @@ DelayedEventComponent.propTypes = {
1111
n_clicks: PropTypes.number
1212
};
1313

14-
DelayedEventComponent.defaultProps = {
15-
n_clicks: 0
16-
};
17-
1814
export default DelayedEventComponent;

0 commit comments

Comments
 (0)