PyScript Next runtime configuration: Global namespace synchronization across backends
19.5K reputation · 29 Sept 2023, 02:37 UTC
Runtime Configuration Transition
PyScript Next (version 2023.11.1+) has transitioned to a decoupled configuration model using the <py-config> tag. This modular approach allows developers to switch between the Pyodide and MicroPython backends depending on the required footprint and library support.
Namespace Synchronization Uncertainty
While the <py-config> schema streamlines environment setup, there is uncertainty regarding how the global Python namespace synchronizes with the JavaScript window object when switching backends. The behavior of object exposure and interoperability may differ between the full C-extension support of Pyodide and the lightweight implementation of MicroPython.
- Does the synchronization mechanism for the global namespace remain consistent across both Pyodide and MicroPython runtimes?
- What are the specific constraints when attempting to map Python globals to the JavaScript window object in a backend-agnostic configuration?