fix(jupyterlab): update @jupyter-widgets/base constraint for ipywidgets 8.x #3111
+2
−2
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
So I was trying to get Perspective running in JupyterLab 4 and kept hitting this wall where the widget just... wouldn't load. Dug into the browser console and found the culprit - there's a version constraint on
@jupyter-widgets/basethat's rejecting version 6.x.The thing is, ipywidgets 8.x has been the stable release since October 2022. It ships
@jupyter-widgets/base6.0.11, but the current constraint in the jupyterlab package is">2 <5"- which obviously doesn't include 6.x.Two-line fix: bump the upper bound from
<5to<7.Changes
packages/jupyterlab/package.json:@jupyter-widgets/basefrom">2 <5"to">2 <7"pnpm-workspace.yaml: same change in the catalog entryDid it work?
Ran through the semver math to make sure I wasn't breaking existing setups:
6.0.11(ipywidgets 8.x) satisfies">2 <7"- yep4.1.7(ipywidgets 7.x) still satisfies">2 <7"- still worksThen spun up a fresh Docker container (node:20 devcontainer) to validate the dependency resolution in isolation:
pnpm installresolved all 1805 packages with no version conflictsSo both ipywidgets 7.x and 8.x environments should be happy now.
Related issues
This is adjacent to #2060 (Support ipywidgets 8) and #2307 (Support JupyterLab 4) - those got closed but this specific version constraint issue slipped through.
Test plan
pnpm installsucceeds (1805 packages)