Skip to content

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

Merged
chrisgervang merged 3 commits into
masterfrom
chr/jupyter-widget-esm-shared-modules
Oct 4, 2026
Merged

chrisgervang merged 3 commits into
masterfrom
chr/jupyter-widget-esm-shared-modules

Conversation

@chrisgervang

@chrisgervang chrisgervang commented Oct 4, 2026 •

Copy link
Copy Markdown
Collaborator

For #10800

Background

ES module custom libraries (module=True, #10665) cannot import deck.gl by package name. The luma global is a subset of luma.gl, and a library that brings its own copy fails with "luma.gl - multiple versions detected", so published packages such as @deck.gl-community/layers do not load.

Tracked in #10763.

Change List

  • shared-modules.js: import map from package names to the widget's bundled copies, experimental
  • addCustomLibraries: installs the map before the first ES module library
  • Shared: @deck.gl/*, @luma.gl/core, engine, shadertools, webgl, @loaders.gl/core, @math.gl/core
  • package.json: declare @luma.gl/engine, @luma.gl/shadertools, @math.gl/core
  • dist/index.js grows from 4.91 MB to 5.13 MB (full namespaces)
  • Unit tests
  • Documentation: experimental section in custom_layers.rst, CHANGELOG

Verified with yarn build, the jupyter-widget headless tests, and the built bundle in a srcdoc iframe in Chromium, Firefox and WebKit: all nine @deck.gl-community/*@9.4.1 packages load from esm.sh with ?external=, and PathOutlineLayer and PathMarkerLayer render on the widget's Layer.

@greptile-apps

greptile-apps Bot commented Oct 4, 2026 •

Copy link
Copy Markdown

RetriggerConfidence Score: 5/5

[Medium risk] Adds shared module import map for ES module libraries.

The PR appears safe to merge based on this re-review.

Summary

The PR lets ES module custom libraries import selected deck.gl ecosystem packages by name using an import map backed by the widget’s bundled namespaces.

  • Adds the shared-module map and installs it before loading module libraries.
  • Adds dependencies, headless tests, and experimental pydeck documentation.
Diagram
%%{init: {'theme': 'neutral'}}%%
flowchart LR
  A["Register ES module library"] --> B["Install page import map once"]
  B --> C["Import library"]
  C --> D["Resolve shared package name"]
  D --> E["Widget-bundled namespace"]
Loading

Reviews (4) · Last reviewed commit: "fix(jupyter-widget): install the shared ..."

Comment thread bindings/pydeck/docs/custom_layers.rst Resolved
@chrisgervang
chrisgervang force-pushed the chr/jupyter-widget-esm-shared-modules branch from 086a70e to 45ee01d Compare October 4, 2026 04:50
@coveralls

coveralls commented Oct 4, 2026 •

Copy link
Copy Markdown

Coverage Status

coverage: 82.6%. remained the same — chr/jupyter-widget-esm-shared-modules into master

@chrisgervang

Copy link
Copy Markdown
Collaborator Author

@greptileai re-review

@chrisgervang
chrisgervang merged commit 868b699 into master Oct 4, 2026
7 checks passed
@chrisgervang
chrisgervang deleted the chr/jupyter-widget-esm-shared-modules branch October 4, 2026 18:45
@chrisgervang chrisgervang mentioned this pull request Oct 7, 2026
53 of 66 tasks
chrisgervang added a commit that referenced this pull request Oct 22, 2026
@chrisgervang

Copy link
Copy Markdown
Collaborator Author

Released in deck.gl 9.4.1 as @deck.gl/[email protected].

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.

3 participants