Repository navigation
Conversation
…ing on it PR #335 served a regex-patched copy of anywidget's nbextension index.js with the hard-coded 2s model-init budget (AbortSignal.timeout(2e3)) raised to 60s, working around manzt/anywidget#1030 (slow-loading widgets permanently desyncing). Upstream is removing the timeout and the `ready` gate entirely, so serve anywidget's files unmodified and drop the patch, its cache, and its tests.
Without the init-timeout patch (removed in the previous commit) and before the upstream fix ships (manzt/anywidget#1032), keplergl's ~13MB inline _esm can trip anywidget's 2s model-init budget under CI-grade CPU contention, permanently desyncing the widget. Non-strict xfail keeps the suite green without hiding passes, and the mark lifts itself once CI installs anywidget 0.11.1.
lonboard also inlines a multi-MB _esm (its own copy of luma.gl/deck.gl) and failed in CI with the same permanent-desync console errors as keplergl. Rename the mark to ANYWIDGET_INIT_XFAIL since it's no longer keplergl-specific. The perspective failures in the same runs are a different issue: their shards logged no 'Failed to initialize model' errors, so the 2s timeout never fired and the patch removal couldn't have affected them. Their functional assertions passed; only the strict console-error check tripped on perspective's benign page-global 'viewer wasm is already initialized' message.
cpsievert
force-pushed
the
chore/drop-anywidget-timeout-patch
branch
from
November 6, 2026 18:08
8ff6bae to
ebe548b
Compare
perspective-python 5.7.0 (released 2026-11-05, includes a 'Better WASM init' change) logs 'viewer wasm is already initialized' and functionally breaks second-viewer initialization and re-rendering: viewers never display data. Reproduced locally: tests/playwright/render_perspective passes 6/6 in ~9s on 5.6.1; on 5.7.0 two tests time out waiting for data and the rest log the wasm error. Unrelated to the anywidget change in this PR -- CI resolves fresh (uv.lock is gitignored), so main would hit this on its next run too.
plotly's FigureWidget is anywidget-based with a multi-MB inline _esm (plotly.js), and plotly_accessors failed in CI with the same permanent-desync console errors as keplergl and lonboard. Mark all plotly test modules with ANYWIDGET_INIT_XFAIL.
cpsievert
force-pushed
the
chore/drop-anywidget-timeout-patch
branch
from
November 6, 2026 18:29
5337e50 to
abf0e60
Compare
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.
Why
PR #335 added
relax_anywidget_init_timeout(), which served a regex-patchedcopy of anywidget's front-end with its hard-coded 2s model-init budget raised
to 60s. That workaround never shipped in a release (last release v0.8.2
predates #335), and the upstream fix — manzt/anywidget#1032, removing the
timeout and the comm-message gate entirely — makes it permanently unnecessary.
So: remove it now and count on the upstream fix, rather than ship a workaround
we'd immediately want to delete. Relative to v0.8.2 this changes nothing a
user could observe, so there's no changelog entry.
What changed
relax_anywidget_init_timeout, its call site inrequire_dependencies(), the cache dict, andANYWIDGET_INIT_TIMEOUT_MSfrom
shinywidgets/_dependencies.py(-69 lines).ANYWIDGET_INDEX_JSfixture fromtests/unit/test_dependencies.py(-41 lines).inline
_esm), lonboard, and plotly —xfail(strict=False)while theinstalled anywidget is <0.11.1 (
ANYWIDGET_INIT_XFAILintests/playwright/conftest.py). Without the patch, these bundles can tripanywidget's 2s model-init budget under CI-grade CPU contention and
permanently desync (all three failed exactly that way on the first CI run
of this branch). The mark lifts itself automatically once CI installs an
anywidget release containing fix: remove ready gate on comm messages to prevent permanent desync manzt/anywidget#1032 — no follow-up needed to
re-enable full-strength testing.
pyproject.tomlanywidget floor. Fresh installs (including CI) get thefixed anywidget automatically once it's released; environments pinned to
older anywidget return to the pre-fix: keplergl Playwright CI failures from anywidget init races #335 status quo they always had.
Not touched: the
js/src/keplergl.tsheight re-assertion from #335 — that'san independent keplergl race (missed
change:heightsync), still needed.Also in this PR: exclude perspective-python 5.7.0
Unrelated to the anywidget change, but it broke CI on this branch and will
break main on its next run (CI resolves fresh;
uv.lockis gitignored):perspective-python 5.7.0 (released 2026-11-05, with a "Better WASM init"
change) logs
viewer wasm is already initializedand functionally breakssecond-viewer initialization and re-rendering — viewers never display data.
Reproduced locally:
tests/playwright/render_perspectivepasses 6/6 in ~9son 5.6.1, while on 5.7.0 two tests time out waiting for data. The
!=5.7.0exclusion covers theperspectiveextra and the test/devdependency sets. Should be reported upstream (perspective-dev/perspective).
Testing
Unit suite green (968 passed). Full CI green: py-test 3.11–3.15 and all 4
Playwright shards. The
ANYWIDGET_INIT_XFAILmark verified to apply to allkeplergl, lonboard, and plotly Playwright tests under anywidget 0.11.0, and
to lift on >=0.11.1.