Repository navigation
@stlite/react@1.9.0
Minor Changes
-
#2129
d8e866aThanks @whitphx! - Run Streamlit commands from a JS-invoked Python callback without any setup: a callback wrapped withpyodide.ffi.create_proxyorcreate_once_callable, sync orasync def, now draws into the session of the script that created it, and so does anyasynciotask the script starts.Until now such a callback worked only after an
add_script_run_ctxcall, spelled differently inside anasync defcallback, because stlite keyed theScriptRunContextoff the running task or thread. The Streamlit fork now keeps theScriptRunContextin acontextvarsvariable, so tasks inherit it, and stlite wrapscreate_proxyandcreate_once_callableto run each callback inside the context captured when the proxy was created. Anadd_script_run_ctxcall made inside the callback keeps working, but one made at script level no longer reaches a callable that Pyodide converts to a JS function on its own, so wrap such a callable withcreate_proxyinstead. Passing a thread other than the current one now raisesTypeError, since stlite runs Python on a single thread.
What's Changed
🏕 Updates
- chore(security): add dependency safety guardrails by @whitphx in #2111
- chore(skills): make the
scan-dependenciesskill project-agnostic by @whitphx in #2130 - feat(deps): propagate the
ScriptRunContextinto JS-invoked Python callbacks by @whitphx in #2129 - refactor(kernel): install the anyio inline-offload patch from
runtime_initby @whitphx in #2132 - test(kernel): serialize files sharing the Pyodide package cache by @whitphx in #2134
- Version Packages by @whitphx-changesets-bot[bot] in #2133
Full Changelog: https://github.com/whitphx/stlite/compare/@stlite/browser@1.9.2...@stlite/react@1.9.0