Skip to content

Commit ca5515e

Browse files
authored
Merge branch 'v4' into feat/add-folder-upload-support
2 parents c39a718 + 670cd51 commit ca5515e

File tree

187 files changed

+26751
-20875
lines changed

Some content is hidden

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

187 files changed

+26751
-20875
lines changed

.circleci/config.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ orbs:
55
percy: percy/agent@0.1.3
66
browser-tools: circleci/browser-tools@1.5.1
77

8-
98
jobs:
109
artifacts:
1110
docker:
@@ -158,8 +157,8 @@ jobs:
158157
python -m venv venv && . venv/Scripts/activate
159158
pip install --no-cache-dir --upgrade -e .[ci,dev] --progress-bar off
160159
- run:
161-
command: |
162-
nvm install 18 && nvm use 18
160+
command: |
161+
nvm install 18 && nvm use 18
163162
- run:
164163
name: npm prereqs
165164
command: |
@@ -318,6 +317,8 @@ jobs:
318317
command: |
319318
. venv/bin/activate && rm -rf components/dash-core-components/dash_core_components
320319
cd components/dash-core-components
320+
npm ci
321+
npm run test:jest
321322
TESTFILES=$(circleci tests glob "tests/integration/**/test_*.py" | circleci tests split --split-by=timings)
322323
pytest --headless --nopercyfinalize --junitxml=test-reports/junit_intg.xml --junitprefix="components.dash-core-components" ${TESTFILES}
323324
- store_artifacts:

.envrc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Check for common virtual environment directories from .gitignore patterns
2+
# and automatically activate one with direnv, if available.
3+
for venv_dir in .venv .env venv env .venv* env* ENV; do
4+
if [ -d "$venv_dir" ] && [ -f "$venv_dir/bin/activate" ]; then
5+
source "$venv_dir/bin/activate"
6+
break
7+
fi
8+
done
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: PR Issue Check
2+
3+
on:
4+
pull_request:
5+
types: [opened, edited, labeled, unlabeled]
6+
7+
permissions:
8+
pull-requests: write
9+
issues: read
10+
11+
jobs:
12+
check-linked-issue:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: plotly/pr-issue-checker@v1
16+
with:
17+
github-token: ${{ secrets.GITHUB_TOKEN }}
18+
exempt-labels: "no-issue-needed"
19+
request-issue-message: "Could you please link an issue to this PR? This helps us track the context and purpose of changes. If an issue doesn't exist yet, create one before linking it."
20+
thank-you-message: "Thank you for your contribution to Dash! 🎉"
21+
issue-added-message: ""

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

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,10 @@ describe('Test Typescript component metadata generation', () => {
9595
`${componentName} element JSX.Element`,
9696
testTypeFactory('element', 'node')
9797
);
98+
test(
99+
`${componentName} dash_component DashComponent`,
100+
testTypeFactory("dash_component", "node"),
101+
);
98102
test(
99103
`${componentName} boolean type`,
100104
testTypeFactory('a_bool', 'bool')
@@ -197,6 +201,28 @@ describe('Test Typescript component metadata generation', () => {
197201
expect(propType.value.value[0].name).toBe('string');
198202
expect(propType.value.value[1].name).toBe('shape');
199203
});
204+
test('Union of primitives and arrays of primitives', () => {
205+
const propType = R.path(
206+
propPath('TypeScriptComponent', 'array_primitive_mix').concat(
207+
'type'
208+
),
209+
metadata
210+
);
211+
expect(propType.name).toBe('union');
212+
expect(propType.value.length).toBe(4);
213+
expect(propType.value[0].name).toBe('string');
214+
expect(propType.value[1].name).toBe('number');
215+
expect(propType.value[2].name).toBe('bool');
216+
expect(propType.value[3].name).toBe('arrayOf');
217+
218+
// Verify that the array element type is a union of string, number, and boolean
219+
const arrayElementType = propType.value[3].value;
220+
expect(arrayElementType.name).toBe('union');
221+
expect(arrayElementType.value.length).toBe(3);
222+
expect(arrayElementType.value[0].name).toBe('string');
223+
expect(arrayElementType.value[1].name).toBe('number');
224+
expect(arrayElementType.value[2].name).toBe('bool');
225+
});
200226
test('Obj properties', () => {
201227
const propType = R.path(
202228
propPath('TypeScriptComponent', 'obj').concat('type', 'value'),
@@ -289,6 +315,40 @@ describe('Test Typescript component metadata generation', () => {
289315
expect(propType.value[1].value).toBe('small');
290316
}
291317
)
318+
319+
test(
320+
'union of boolean and literal values', () => {
321+
const propType = R.path(
322+
propPath('TypeScriptComponent', 'boolean_enum').concat(
323+
'type'
324+
),
325+
metadata
326+
);
327+
expect(propType.name).toBe('union');
328+
expect(propType.value.length).toBe(3);
329+
expect(propType.value[0].name).toBe('bool');
330+
expect(propType.value[1].name).toBe('literal');
331+
expect(propType.value[2].name).toBe('literal');
332+
expect(propType.value[0].value).toBe(undefined);
333+
expect(propType.value[1].value).toBe('small');
334+
expect(propType.value[2].value).toBe('large');
335+
}
336+
)
337+
338+
test(
339+
'union of duplicated types', () => {
340+
const propType = R.path(
341+
propPath('TypeScriptComponent', 'duplicated_enum').concat(
342+
'type'
343+
),
344+
metadata
345+
);
346+
expect(propType.name).toBe('union');
347+
expect(propType.value.length).toBe(2);
348+
expect(propType.value[0].name).toBe('number');
349+
expect(propType.value[1].name).toBe('bool');
350+
}
351+
)
292352
});
293353

294354
describe('Test component comments', () => {

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

Lines changed: 6 additions & 6 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/src/components/TypeScriptComponent.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ const TypeScriptComponent = ({
1212
bool_default = true,
1313
null_default = null,
1414
obj_default = { a: 'a', b: 3 },
15+
array_primitive_mix = 1,
1516
...props
1617
}: TypescriptComponentProps) => {
1718
return <div id={id}>{required_string}</div>;

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

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
// Needs to export types if not in a d.ts file or if any import is present in the d.ts
22
import React from 'react';
33

4+
type DashComponent = {
5+
props: string;
6+
namespace: string;
7+
children?: [];
8+
}
9+
410

511
type Nested = {
612
nested: Nested;
@@ -29,8 +35,14 @@ export type TypescriptComponentProps = {
2935
union?: number | string;
3036
union_shape?: {a: string} | string;
3137
array_union_shape?: ({a: string} | string)[];
38+
array_primitive_mix?:
39+
| string
40+
| number
41+
| (string | number | boolean)[]
42+
| boolean;
3243
element?: JSX.Element;
3344
array_elements?: JSX.Element[];
45+
dash_component?: DashComponent;
3446

3547
string_default?: string;
3648
number_default?: number;
@@ -48,7 +60,9 @@ export type TypescriptComponentProps = {
4860
object_of_string?: {[k: string]: string};
4961
object_of_components?: {[k: string]: JSX.Element};
5062
ignored_prop?: {ignore: {me: string}};
51-
union_enum?: number | 'small' | 'large'
63+
union_enum?: number | 'small' | 'large';
64+
boolean_enum?: boolean | 'small' | 'large';
65+
duplicated_enum?: boolean | number | number;
5266
};
5367

5468
export type WrappedHTMLProps = {

CHANGELOG.md

Lines changed: 49 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,49 @@
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]
5+
## [4.0.0rc4] - 2025-12-04
6+
7+
## Added
8+
- New `dcc.Button` component that mirrors `html.Button` but with default styles applied
9+
10+
## [4.0.0rc3] - 2025-11-27
11+
- Modernized `dcc.Tabs`
12+
- Modernized `dcc.DatePickerSingle` and `dcc.DatePickerRange`
13+
- DatePicker calendars can now accept translations as an external script, either with Dash's `external_scripts` or from the assets folder. See [documentation](https://date-fns.org/v4.1.0/docs/CDN) for the underlying library that supports this.
14+
15+
## Changed
16+
- `dcc.Tab` now accepts a `width` prop which can be a pixel or percentage width for an individual tab.
17+
- `dcc.Tab` can accept other Dash Components for its label, in addition to a simple string.
18+
19+
## [4.0.0rc2] - 2025-10-10
20+
21+
## Added
22+
- [3468](https://github.com/plotly/dash/pull/3468) Modernize dcc.TextArea & dcc.Tooltip
23+
- [3467](https://github.com/plotly/dash/pull/3467) Modernize dcc.Loading
24+
- [3453](https://github.com/plotly/dash/pull/3453) Modernize dcc.Checklist & dcc.RadioItems
25+
26+
## Changed
27+
28+
- Various tweaks and bugfixes to issues reported in `4.0.0rc1`
29+
30+
- Dropdown API changes
31+
* default value of optionHeight is now 'auto' which supports text wrapping of lengthy text on small screens; you can still specify a numeric pixel height if desired
32+
* new `labels` prop to customize strings used within the component
33+
* default value for closeOnSelect is now `True` for single-select dropdowns and `False` for multi-select
34+
35+
- Slider API changes
36+
* default value of `step` is now only set to `1` if the `min` and `max` props are both integers. Otherwise, it will be dynamically computed according to the available space for the slider
37+
38+
## [4.0.0rc1] - 2025-09-22
39+
40+
## Added
41+
- [#3440](https://github.com/plotly/dash/pull/3440) Modernize dcc.Dropdown
42+
43+
## [4.0.0rc0] - 2025-09-11
44+
- [#3398](https://github.com/plotly/dash/pull/3398) Modernize dcc.Input
45+
- [#3414](https://github.com/plotly/dash/pull/3414) Modernize dcc.Slider
46+
47+
## [3.3.0] - 2025-11-12
648

749
## Added
850
- [#3464](https://github.com/plotly/dash/issues/3464) Add folder upload functionality to `dcc.Upload` component. When `multiple=True`, users can now select and upload entire folders in addition to individual files. The folder hierarchy is preserved in filenames (e.g., `folder/subfolder/file.txt`). Files within folders are filtered according to the `accept` prop. Folder support is available in Chrome, Edge, and Opera; other browsers gracefully fall back to file-only mode. The uploaded files use the same output API as multiple file uploads.
@@ -14,13 +56,18 @@ This project adheres to [Semantic Versioning](https://semver.org/).
1456
- [#3347](https://github.com/plotly/dash/pull/3347) Added 'api_endpoint' to `callback` to expose api endpoints at the provided path for use to be executed directly without dash.
1557
- [#3445](https://github.com/plotly/dash/pull/3445) Added API to reverse direction of slider component.
1658
- [#3460](https://github.com/plotly/dash/pull/3460) Add `/health` endpoint for server monitoring and health checks.
17-
- [#3465](https://github.com/plotly/dash/pull/3465) Plotly cloud integrations, add devtool API, placeholder plotly cloud CLI & publish button, `dash[cloud]` extra dependencies.
59+
- [#3465](https://github.com/plotly/dash/pull/3465) Plotly cloud integrations, add devtool API, placeholder plotly cloud CLI & publish button, `dash[cloud]` extra dependencies.
1860

1961
## Fixed
62+
- [#3490](https://github.com/plotly/dash/pull/3490) Fix stack overflow when circular callbacks are displayed on the devtool callback
2063
- [#3395](https://github.com/plotly/dash/pull/3395) Fix Components added through set_props() cannot trigger related callback functions. Fix [#3316](https://github.com/plotly/dash/issues/3316)
2164
- [#3415](https://github.com/plotly/dash/pull/3415) Fix the error triggered when only a single no_update is returned for client-side callback functions with multiple Outputs. Fix [#3366](https://github.com/plotly/dash/issues/3366)
2265
- [#3416](https://github.com/plotly/dash/issues/3416) Fix DeprecationWarning in dash/_jupyter.py by migrating from deprecated ipykernel.comm.Comm to comm module
2366
- [#3488](https://github.com/plotly/dash/pull/3488) Fix pkgutil.find_loader removal in Python 3.14
67+
- [#3496](https://github.com/plotly/dash/pull/3496) Fix dcc.Graph infinite resize loop
68+
69+
## Deprecated
70+
- [#3482](https://github.com/plotly/dash/pull/3482) Deprecate dash_table.DataTable with replacement from `dash[ag-grid]` extra requirement.
2471

2572
## [3.2.0] - 2025-07-31
2673

CONTRIBUTING.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,13 +80,13 @@ Open a Bash terminal in the `dash` repository, Git Bash terminal for example on
8080

8181
On some Linux/Mac environments, use `.` instead of `source`
8282
```bash
83-
$ python3 -m venv .venv/dev
84-
$ source .venv/dev/bin/activate
83+
$ python3 -m venv venv
84+
$ source venv/bin/activate
8585
```
8686
- Windows:
8787
```bash
88-
$ python -m venv .venv/dev
89-
$ source .venv/dev/scripts/activate
88+
$ python -m venv venv
89+
$ source venv/scripts/activate
9090
```
9191

9292
Install dash and dependencies:

components/dash-core-components/.eslintrc

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,19 @@
2525
"jasmine": true,
2626
"node": true
2727
},
28+
"overrides": [
29+
{
30+
"files": ["*.ts", "*.tsx"],
31+
"parser": "@typescript-eslint/parser",
32+
"plugins": ["@typescript-eslint"],
33+
"extends": [
34+
"plugin:@typescript-eslint/recommended"
35+
],
36+
"rules": {
37+
// You can add TypeScript-specific rules here
38+
}
39+
}
40+
],
2841
"plugins": [
2942
"react",
3043
"import"

0 commit comments

Comments
 (0)