Patch Changes
-
#2125
762f6abThanks @whitphx! - Let Streamlit commands run from a Python callback that JS invokes outside any asyncio task, such as apyodide.ffi.create_proxycallback fired bysetTimeoutor a JS library's progress callback.Stlite keys the
ScriptRunContextoff the running asyncio task, and such a callback has none, so everyst.*call from it failed withAttributeError: 'NoneType' object has no attribute 'get_name'. The context now falls back to the thread object when no task is running, so the recipe Streamlit documents for worker threads,add_script_run_ctx(threading.current_thread(), ctx), works from such a callback too, whether the callback attaches the context itself or the script attached it beforehand. Anasync defcallback runs as its own task and has to calladd_script_run_ctx(ctx=ctx)inside itself.
What's Changed
🏕 Updates
- ci: pin uv to
0.12.13until the fork's dev lock resolves on newer uv by @whitphx in #2127 - docs(cloudflare): link to the live demo of the
hellosample by @whitphx in #2126 - fix(deps): let Streamlit commands run from JS-invoked Python callbacks by @whitphx in #2125
- Version Packages by @whitphx-changesets-bot[bot] in #2128
Full Changelog: https://github.com/whitphx/stlite/compare/@stlite/browser@1.9.1...@stlite/react@1.8.2