Repository navigation
[9.4-release] feat(jupyter-widget): ES module libraries import deck.gl by package name (experimental) (#10794) - #10884
Conversation
[Medium impact] The change affects custom ES module loading in pydeck notebooks. The PR appears safe to merge, with a non-blocking gap in the fresh-page integration test. Findings
SummaryAdds experimental package-name imports for custom ES module libraries in pydeck.
|
| await new Promise<void>(resolve => | ||
| addCustomLibraries([{libraryName: LIBRARY_NAME, resourceUri: url, module: true}], resolve) | ||
| ); |
There was a problem hiding this comment.
Fresh-page failures go unnoticed
The first test installs the page-wide import map before this test calls addCustomLibraries. Removing the new installSharedModuleImportMap() call from addCustomLibraries would therefore leave both tests passing, even though custom libraries would fail on a fresh page. Run this integration check in a fresh iframe or page without calling the installer first.
Follow up of #10794, for #10812
Background
Backports #10794 to
9.4-releasefor 9.4.1 and pydeck 0.9.4 (#10763). The cherry-pick conflicts inmodules/jupyter-widget/package.json, becausemasterhas the luma.gl 10, math.gl 5 and loaders.gl 5 prereleases.Change List
jupyter-widgetdependencies: keep the 9.4 ranges, add@luma.gl/engine ^9.4.2,@luma.gl/shadertools ^9.4.2and@math.gl/core ^4.1.0-xAfter this merges, #10797, #10761, #10799 and #10773 cherry-pick cleanly on top.
Verified
yarn install --frozen-lockfile, thejupyter-widgetbuild and its headless tests (61 passed).Note
Medium Risk
Touches custom-library loading and injects a page-level import map with ordering/browser constraints; incorrect sharing could break custom layers or duplicate GL runtimes, but scope is limited to experimental
module=Trueregistration.Overview
Adds an experimental path for ES module custom libraries (
register_library(..., module=True)) toimportdeck.gl, luma.gl, loaders.gl, and math.gl by bare package name instead of shimmingglobalThis.deck.Before the first such library loads, the Jupyter widget installs a one-time import map (
shared-modules.js) that points each supported specifier at blob modules re-exporting the widget’s bundled copies, avoiding a second luma.gl/deck.gl instance.create-deck.jsinvokes this hook when loadingmodule=Truelibraries. Widget dependencies gain@luma.gl/engine,@luma.gl/shadertools, and@math.gl/corefor the shared registry.pydeck docs and changelog describe the feature, CDN
?external=usage, version alignment (9.4), and browser/import-map limitations. Vitest coverage asserts import-map idempotency and that custom ES modules resolve sharedCompositeLayer/Modelidentities.Reviewed by Cursor Bugbot for commit 5a02624. Bugbot is set up for automated code reviews on this repo. Configure here.