posit-dev / posit-dev/shinylive
Type stubs for `shinywidgets` are missing from `typeshed.en.json`
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.whlis still bundled into pyodide and apps usingshinywidgetscontinue to work. - Editor: the in-browser pyright integration has no hover/intellisense/type-checking for
import shinywidgetssymbols.
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
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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