github whitphx/stlite @stlite/cloudflare@0.5.0

Minor Changes

  • #2129 d8e866a Thanks @whitphx! - Run Streamlit commands from a JS-invoked Python callback without any setup: a callback wrapped with pyodide.ffi.create_proxy or create_once_callable, sync or async def, now draws into the session of the script that created it, and so does any asyncio task the script starts.

    Until now such a callback worked only after an add_script_run_ctx call, spelled differently inside an async def callback, because stlite keyed the ScriptRunContext off the running task or thread. The Streamlit fork now keeps the ScriptRunContext in a contextvars variable, so tasks inherit it, and stlite wraps create_proxy and create_once_callable to run each callback inside the context captured when the proxy was created. An add_script_run_ctx call 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 with create_proxy instead. Passing a thread other than the current one now raises TypeError, 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-dependencies skill project-agnostic by @whitphx in #2130
  • feat(deps): propagate the ScriptRunContext into JS-invoked Python callbacks by @whitphx in #2129
  • refactor(kernel): install the anyio inline-offload patch from runtime_init by @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/cloudflare@0.5.0

Don't miss a new stlite release

NewReleases is sending notifications on new releases.