Repository navigation
fix(jupyter-widget): render layers with extensions from unloaded custom libraries - #10764
Merged
Merged
Conversation
This was referenced Sep 29, 2026
chrisgervang
marked this pull request as ready for review
September 29, 2026 04:58
chrisgervang
marked this pull request as draft
September 29, 2026 04:58
chrisgervang
marked this pull request as ready for review
September 29, 2026 04:59
chrisgervang
force-pushed
the
chr/jupyter-widget-custom-extensions
branch
from
September 29, 2026 05:01
44c1261 to
7af0914
Compare
chrisgervang
changed the base branch from
master
to
chr/pydeck-register-library-fix
September 29, 2026 05:02
|
chrisgervang
force-pushed
the
chr/jupyter-widget-custom-extensions
branch
from
September 29, 2026 05:26
7af0914 to
166a772
Compare
ibgreen
approved these changes
Oct 1, 2026
…om libraries A layer whose extensions come from a custom library converts with a null extension until the library's script has loaded. Constructing that layer throws, so createDeck failed and nothing rendered. Convert the first render without layers and widgets when that happens, and add them once the custom libraries load. Report conversion errors after loading through onError.
Convert layers and widgets one at a time when the first conversion fails, so that layers that do not depend on an unloaded custom library still render. After the libraries load (or fail to), layers that still cannot be converted are reported through onError instead of hiding the others. Retry based on counts rather than ids, so layers without an id are also added once their library loads.
…est device The headless project runs every spec in one page, so a deck with its own WebGL context broke unrelated specs.
chrisgervang
force-pushed
the
chr/jupyter-widget-custom-extensions
branch
from
October 1, 2026 22:11
7bffece to
98c0092
Compare
This was referenced Oct 2, 2026
53 of 66 tasks
chrisgervang
added a commit
that referenced
this pull request
Oct 22, 2026
…om libraries (#10764) * fix(jupyter-widget): render layers with extensions from unloaded custom libraries A layer whose extensions come from a custom library converts with a null extension until the library's script has loaded. Constructing that layer throws, so createDeck failed and nothing rendered. Convert the first render without layers and widgets when that happens, and add them once the custom libraries load. Report conversion errors after loading through onError. * fix(jupyter-widget): defer only the layers that cannot be converted Convert layers and widgets one at a time when the first conversion fails, so that layers that do not depend on an unloaded custom library still render. After the libraries load (or fail to), layers that still cannot be converted are reported through onError instead of hiding the others. Retry based on counts rather than ids, so layers without an id are also added once their library loads. * test(jupyter-widget): render the createDeck test through the shared test device The headless project runs every spec in one page, so a deck with its own WebGL context broke unrelated specs. (cherry picked from commit 3d7eea1)
Collaborator
Author
|
Released in deck.gl 9.4.1 as |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Background
Custom libraries load after the widget converts the deck JSON. A layer whose own
@@typecomes from a custom library converts tonulland is added once the library loads. A built-in layer that uses a custom-library extension, such asextensions: [{'@@type': 'ZoomOpacityExtension'}], instead converts withextensions: [null]. Constructing that layer throws,createDeckfails, and the map stays blank. With the published 9.4.0 widget, pydeckto_htmloutput using a deck.gl-community extension renders nothing.Change List
create-deck.js: when conversion throws and custom libraries are pending,convertInitialJsonconverts each layer and widget separately. Only the ones that cannot be converted yet are left out of the first render.onErrorinstead of hiding the others or throwing from the script loader callback.idare added tooconvertInitialJsonand forcreateDeckadding a deferred layer once its library loadsSplit out of #10761, which needs this fix for its
ZoomOpacityExtensionexample. Tracked in #10763.Note
Medium Risk
Changes first-render and post-load JSON conversion in the jupyter-widget deck bootstrap path, but behavior is limited to decks with pending custom libraries and is covered by new tests.
Overview
Fixes the jupyter-widget case where a built-in layer references a custom-library extension (e.g.
extensions: [{'@@type': 'ZoomOpacityExtension'}]) before that library loads. A failed full JSON conversion—or a layer built withextensions: [null]—used to abortcreateDeckand leave the map blank.convertInitialJsonstill tries a full convert first; if that throws while custom libraries are pending, it converts the rest of the deck with emptylayers/widgets, then converts each layer and widget in isolation so only the broken entries becomenullon the first paint.convertLayersAndWidgetsis reused after libraries finish loading; failures are reported viaonErrorinstead of failing the whole update.Deferred work is detected by comparing layer/widget counts to the input (replacing id-based
missingProps), so layers without anidare still picked up on retry. Tests cover deferred conversion and an asynccreateDeckpath that adds the layer once the script loads.Reviewed by Cursor Bugbot for commit 98c0092. Bugbot is set up for automated code reviews on this repo. Configure here.