Skip to content

[9.4-release] feat(jupyter-widget): ES module libraries import deck.gl by package name (experimental) (#10794) - #10884

Merged
chrisgervang merged 1 commit into
9.4-releasefrom
chr/backport-10794-9.4
Oct 22, 2026
Merged

chrisgervang merged 1 commit into
9.4-releasefrom
chr/backport-10794-9.4

Conversation

@chrisgervang

@chrisgervang chrisgervang commented Oct 22, 2026 •

Copy link
Copy Markdown
Collaborator

Follow up of #10794, for #10812

Background

Backports #10794 to 9.4-release for 9.4.1 and pydeck 0.9.4 (#10763). The cherry-pick conflicts in modules/jupyter-widget/package.json, because master has the luma.gl 10, math.gl 5 and loaders.gl 5 prereleases.

Change List

  • jupyter-widget dependencies: keep the 9.4 ranges, add @luma.gl/engine ^9.4.2, @luma.gl/shadertools ^9.4.2 and @math.gl/core ^4.1.0
  • Everything else is the original commit, cherry-picked with -x

After this merges, #10797, #10761, #10799 and #10773 cherry-pick cleanly on top.

Verified yarn install --frozen-lockfile, the jupyter-widget build 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=True registration.

Overview
Adds an experimental path for ES module custom libraries (register_library(..., module=True)) to import deck.gl, luma.gl, loaders.gl, and math.gl by bare package name instead of shimming globalThis.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.js invokes this hook when loading module=True libraries. Widget dependencies gain @luma.gl/engine, @luma.gl/shadertools, and @math.gl/core for 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 shared CompositeLayer / Model identities.

Reviewed by Cursor Bugbot for commit 5a02624. Bugbot is set up for automated code reviews on this repo. Configure here.

…ame (experimental) (#10794)

* feat(jupyter-widget): ES module libraries import deck.gl by package name (experimental)

* docs(pydeck): cite #10794 in the 0.9.4 changelog

* fix(jupyter-widget): install the shared module import map once per page

(cherry picked from commit 868b699)
@chrisgervang chrisgervang added this to the v9.4 patch releases milestone Oct 22, 2026
@chrisgervang chrisgervang mentioned this pull request Oct 22, 2026
53 of 66 tasks
@greptile-apps

greptile-apps Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 4/5

[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

  1. P2 Fresh-page failures go unnoticed ▶

Summary

Adds experimental package-name imports for custom ES module libraries in pydeck.

  • ES module libraries can use the same packages as pydeck by name.

Diagram

sequenceDiagram
  participant C as Custom library registration
  participant W as Widget
  participant M as Import map
  participant L as Custom ES module
  C->>W: Register module URL
  W->>M: Map package names to shared exports
  W->>L: Import module URL
  L->>M: Import package by name
  M-->>L: Return widget's bundled exports
Loading

Reviews (1) · Last reviewed commit: "feat(jupyter-widget): ES module librarie..." · Reviewed by Greptile

Comment on lines +52 to +54
await new Promise<void>(resolve =>
addCustomLibraries([{libraryName: LIBRARY_NAME, resourceUri: url, module: true}], resolve)
);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 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.

@coveralls

Copy link
Copy Markdown

Coverage Status

Coverage is 82.867% — chr/backport-10794-9.4 into 9.4-release. No base build found for 9.4-release.

@chrisgervang
chrisgervang merged commit a362bd2 into 9.4-release Oct 22, 2026
8 checks passed
@chrisgervang
chrisgervang deleted the chr/backport-10794-9.4 branch October 22, 2026 04:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants