Skip to content

Commit 8fd168b

Browse files
committed
Merge remote-tracking branch 'origin/dev' into merge-4102
# Conflicts: # CHANGELOG.md
2 parents aed3021 + 4aedb65 commit 8fd168b

22 files changed

Lines changed: 2194 additions & 101 deletions

‎.ai/ARCHITECTURE.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -669,7 +669,7 @@ Handles messages:
669669
- `base_url_request` → responds with JupyterLab server config
670670
- `show` → creates dedicated tab with IFrame widget
671671

672-
Compatible with JupyterLab 2.x, 3.x, and 4.x.
672+
Shipped as a prebuilt extension (built with `@jupyterlab/builder` 3, installed to `share/jupyter/labextensions/@plotly/dash-jupyterlab`). Compatible with JupyterLab 3.x and 4.x: the `jupyterlab.sharedPackages` ranges in its `package.json` cover both majors.
673673

674674
### Proxy Configuration
675675

‎.ai/PERFORMANCE.md‎

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,3 +213,21 @@ the run when the per-click cost grows faster than the list (linear is ~3x).
213213
limit) for a component tree nested deeper than ~254. The `deep_nesting`
214214
scenario is capped at 120 to stay clear. Worth remembering before recommending
215215
deeply-recursive layouts.
216+
217+
### 6. Components with `dashChildrenUpdate` scan every changed path [reduced]
218+
219+
`selectDashProps` runs for every mounted component on every store update. For a
220+
component type that sets `dashChildrenUpdate` (`dcc.Tabs`, several DMC types),
221+
`determineChangedProps` walks all of `layoutHashes`, which gains one entry per
222+
path whose props ever changed and never shrinks: O(flagged components x changed
223+
paths) per store update. `callback_fanout_children_update` covers it.
224+
225+
`isFirstLevelPropsChild` used to split both paths for each entry, and was the
226+
top frame of that scenario (with `determineChangedProps`, 51% of CPU with 50
227+
tabs). It now rejects unrelated paths with `isPathOrDescendant` before any
228+
allocation, which brings that down to 9%. It is still a scan, just a cheap one.
229+
The scenario mounts 200 tabs so that going back to the old scan (about 4x
230+
slower there) fails the baseline gate. A prefix index would make
231+
it O(1) per component, but rebuilding it whenever `layoutHashes` changes costs
232+
about twice one scan, so it would slow down the common case of a single
233+
`dcc.Tabs`. An index maintained incrementally in the reducer would avoid that.

‎.github/dependabot.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ updates:
222222
# eslint 8 / prettier 2 toolchain. Take minors and patches only.
223223
- dependency-name: "*"
224224
update-types: ["version-update:semver-major"]
225-
# dash-jupyterlab supports JupyterLab 2, 3 and 4 via a wide range;
225+
# dash-jupyterlab supports JupyterLab 3 and 4 via a wide range;
226226
# Dependabot narrows it to the latest 4.x and the lockfile bump breaks tsc.
227227
- dependency-name: "@jupyterlab/*"
228228
# react-docgen is pinned for legacy metadata extraction (extract-meta.js uses

‎.gitignore‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ dash/dcc/*
4949
!dash/dcc/.gitkeep
5050
dash/dash_table/*
5151
!dash/dash_table/.gitkeep
52+
dash/labextension/*
5253
develop-eggs/
5354
dist/
5455
downloads/
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"packageName": "dash",
3+
"packageManager": "python"
4+
}

‎@plotly/dash-jupyterlab/package.json‎

Lines changed: 43 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,26 +25,62 @@
2525
},
2626
"scripts": {
2727
"build": "tsc",
28-
"build:pack": "jlpm run prepare && jlpm pack --filename ../../dash/labextension/dist/dash-jupyterlab.tgz && jlpm run build:copy",
29-
"build:copy": "cp package.json ../../dash/labextension/dist/package.json",
28+
"build:pack": "jlpm run prepare && jupyter labextension build . && jlpm run build:copy",
29+
"build:copy": "cp install.json ../../dash/labextension",
3030
"clean": "rimraf lib",
31-
"prepare": "mkdirp ../../dash/labextension/dist && jlpm run clean && jlpm run build",
31+
"prepare": "mkdirp ../../dash/labextension && jlpm run clean && jlpm run build",
3232
"prettier": "prettier --write '{!(package),src/**,!(lib)/**}{.js,.jsx,.ts,.tsx,.css,.json,.md}'",
3333
"watch": "tsc -w"
3434
},
3535
"dependencies": {
36-
"@jupyterlab/application": "^2.0.0 || ^3.0.0 || ^4.0.0",
37-
"@jupyterlab/console": "^2.0.0 || ^3.0.0 || ^4.0.0",
38-
"@jupyterlab/notebook": "^2.0.0 || ^3.0.0 || ^4.0.0"
36+
"@jupyterlab/application": "^3.0.0 || ^4.0.0",
37+
"@jupyterlab/console": "^3.0.0 || ^4.0.0",
38+
"@jupyterlab/coreutils": "^5.0.0 || ^6.0.0",
39+
"@jupyterlab/notebook": "^3.0.0 || ^4.0.0",
40+
"@jupyterlab/services": "^6.0.0 || ^7.0.0",
41+
"@lumino/messaging": "^1.0.0 || ^2.0.0",
42+
"@lumino/widgets": "^1.0.0 || ^2.0.0"
3943
},
4044
"devDependencies": {
45+
"@jupyterlab/builder": "^3.6.8",
4146
"@types/json-schema": "^7.0.15",
4247
"mkdirp": "^0.5.1",
4348
"prettier": "2.8.8",
4449
"rimraf": "3.0.2",
4550
"typescript": "5.9.3"
4651
},
4752
"jupyterlab": {
48-
"extension": true
53+
"extension": true,
54+
"outputDir": "../../dash/labextension",
55+
"sharedPackages": {
56+
"@jupyterlab/application": {
57+
"bundled": false,
58+
"singleton": true,
59+
"requiredVersion": "^3.0.0 || ^4.0.0"
60+
},
61+
"@jupyterlab/console": {
62+
"bundled": false,
63+
"singleton": true,
64+
"requiredVersion": "^3.0.0 || ^4.0.0"
65+
},
66+
"@jupyterlab/coreutils": {
67+
"bundled": false,
68+
"singleton": true,
69+
"requiredVersion": "^5.0.0 || ^6.0.0"
70+
},
71+
"@jupyterlab/notebook": {
72+
"bundled": false,
73+
"singleton": true,
74+
"requiredVersion": "^3.0.0 || ^4.0.0"
75+
},
76+
"@lumino/widgets": {
77+
"bundled": false,
78+
"singleton": true,
79+
"requiredVersion": "^1.0.0 || ^2.0.0"
80+
}
81+
}
82+
},
83+
"resolutions": {
84+
"webpack": "5.106.2"
4985
}
5086
}

0 commit comments

Comments
 (0)