posit-dev / posit-dev/shinylive

Type stubs for `shinywidgets` are missing from `typeshed.en.json`

Open
#225 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
251
Forks
25
Avg merge
19m
Merged PRs (30d)
2

Description

Summary

During make all, scripts/create_typeshed.py reports:

Import 'shinywidgets' not found
Import 'shinywidgets' could not be resolved
Error occurred when creating type stub: Import 'shinywidgets' could not be resolved

…and the resulting build/shinylive/pyright/typeshed.en.json contains zero entries for shinywidgets, while it has full coverage for shiny, htmltools, and shinyswatch.

Confirmed pre-existing

This is not a regression introduced by any specific submodule bump. Comparing local v0.10.10 build vs. the live v0.10.9 typeshed:

build shiny entries htmltools entries shinywidgets entries
PROD v0.10.9 (live typeshed) 188 7 0
LOCAL v0.10.10 188 7 0

Impact

  • Runtime: unaffected — shinywidgets-X.Y.Z-py3-none-any.whl is still bundled into pyodide and apps using shinywidgets continue to work.
  • Editor: the in-browser pyright integration has no hover/intellisense/type-checking for import shinywidgets symbols.

Likely cause

pyright --createstub shinywidgets requires the package's transitive imports to resolve (e.g. anywidget, ipywidgets, …). The create_typeshed.py venv probably doesn't install these, so pyright bails before emitting stubs. The other three packages in PACKAGES = ("htmltools", "shiny", "shinywidgets", "shinyswatch") succeed because their dep graphs are satisfied by what's currently installed.

See scripts/create_typeshed.py:15,28-29.

Suggested fix

Ensure anywidget (and any other shinywidgets runtime deps that satisfy module resolution) are installed in the venv used by create_typeshed.py before the pyright.run("--createstub", "shinywidgets", ...) call.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with scripts/create_typeshed.py, especially PACKAGES and the pyright.run("--createstub", "shinywidgets", ...) call, then run make all to reproduce the unresolved-import errors. Check which shinywidgets runtime dependencies are missing from the venv. Done means typeshed.en.json contains shinywidgets entries and the typeshed generation completes successfully.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
build-system, developer-experience
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
58/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.