From ada335347ab1ca0348fa1e444931e8d38df6980e Mon Sep 17 00:00:00 2001 From: Steve Purves Date: Tue, 7 Jan 2025 08:50:12 +0000 Subject: [PATCH] Fix widgets disconnect (#786) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 🔝 bump `@jupyterlite/pyodide-` deps * 🔌 apply default lite plugin settings --- .changeset/lovely-roses-dance.md | 7 ++ .changeset/selfish-feet-travel.md | 5 + apps/simple/static/index.html | 12 -- apps/simple/static/ipywidgets-lite.html | 12 -- apps/simple/static/lite.html | 12 -- package-lock.json | 130 ++++++++++----------- packages/lite/package.json | 8 +- packages/lite/src/jlite.ts | 26 ++++- packages/lite/src/types.ts | 4 +- packages/react/src/ThebeServerProvider.tsx | 11 +- 10 files changed, 108 insertions(+), 119 deletions(-) create mode 100644 .changeset/lovely-roses-dance.md create mode 100644 .changeset/selfish-feet-travel.md diff --git a/.changeset/lovely-roses-dance.md b/.changeset/lovely-roses-dance.md new file mode 100644 index 00000000..b9ca100c --- /dev/null +++ b/.changeset/lovely-roses-dance.md @@ -0,0 +1,7 @@ +--- +'thebe-react': minor +'thebe-lite': minor +'demo-simple': minor +--- + +Clients no longer have to explicitly supply `litePluginSettings` unless they explicitly want to override them. This simplifies upgrades as clients should just bump packages, and the correct plugin settings for the bundled pyodide kernel will be applied by default. diff --git a/.changeset/selfish-feet-travel.md b/.changeset/selfish-feet-travel.md new file mode 100644 index 00000000..5211bf2e --- /dev/null +++ b/.changeset/selfish-feet-travel.md @@ -0,0 +1,5 @@ +--- +'thebe-lite': minor +--- + +Upgrading `@jupyterlite/pyodide-kernel-extension` to fix ipywidget disconnect issues. diff --git a/apps/simple/static/index.html b/apps/simple/static/index.html index 322d122e..cf7460bc 100644 --- a/apps/simple/static/index.html +++ b/apps/simple/static/index.html @@ -19,18 +19,6 @@ } } - diff --git a/apps/simple/static/ipywidgets-lite.html b/apps/simple/static/ipywidgets-lite.html index ae631c04..576ab90f 100644 --- a/apps/simple/static/ipywidgets-lite.html +++ b/apps/simple/static/ipywidgets-lite.html @@ -11,18 +11,6 @@ useBinder: false } - - ; + litePluginSettings?: Record; + enableMemoryStorage?: boolean; + settingsStorageDrivers?: string[]; }; export interface ThebeLiteGlobal { diff --git a/packages/react/src/ThebeServerProvider.tsx b/packages/react/src/ThebeServerProvider.tsx index 10576114..b0a40f0b 100644 --- a/packages/react/src/ThebeServerProvider.tsx +++ b/packages/react/src/ThebeServerProvider.tsx @@ -92,16 +92,7 @@ export function ThebeServerProvider({ setConnecting(true); if (customConnectFn) customConnectFn(server); else if (useBinder) server.connectToServerViaBinder(customRepoProviders); - else if (useJupyterLite) - server.connectToJupyterLiteServer({ - litePluginSettings: { - '@jupyterlite/pyodide-kernel-extension:kernel': { - pipliteUrls: ['https://unpkg.com/@jupyterlite/pyodide-kernel@0.4.2/pypi/all.json'], - pipliteWheelUrl: - 'https://unpkg.com/@jupyterlite/pyodide-kernel@0.4.2/pypi/piplite-0.4.2-py3-none-any.whl', - }, - }, - }); + else if (useJupyterLite) server.connectToJupyterLiteServer(); else server.connectToJupyterServer(); server.ready.then(