Skip to content

Commit 8f56f66

Browse files
committed
Special-case the new semver range logic to the Jupyter widgets base/controls packages.
This resolves the backwards-incompatibility issues for other libraries with applying this logic to all modules, but still fixes #2006.
1 parent d880e60 commit 8f56f66

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

packages/jupyterlab-manager/src/manager.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -172,9 +172,13 @@ class WidgetManager extends ManagerBase<Widget> implements IDisposable {
172172
*/
173173
protected loadClass(className: string, moduleName: string, moduleVersion: string): Promise<typeof WidgetModel | typeof WidgetView> {
174174

175-
// If we have just a plain version, with no indication of the compatible
176-
// range, prepend a ^ to get all compatible versions.
177-
if (valid(moduleVersion)) {
175+
// Special-case the Jupyter base and controls packages. If we have just a
176+
// plain version, with no indication of the compatible range, prepend a ^ to
177+
// get all compatible versions. We may eventually apply this logic to all
178+
// widget modules. See issues #2006 and #2017 for more discussion.
179+
if ((moduleName === "@jupyter-widgets/base"
180+
|| moduleName === "@jupyter-widgets/controls")
181+
&& valid(moduleVersion)) {
178182
moduleVersion = `^${moduleVersion}`;
179183
}
180184

0 commit comments

Comments
 (0)