Skip to content

Conversation

WebReflection
Copy link
Contributor

This MR allows MicroPython to use polyscript.js_modules same way Pyodide supports it already by doing the following:

  • removed the Proxy from the Worker as it's causing weird bugs/behaviors in MicroPython only
  • resolved as either static field or lazy accessor (getter) both modules pre-fetched for the worker and those to resolve at their first access from main
  • added smoke tests for both Pyodide and MicroPython and tested everything is fine
  • registered both polyscript and polyscript.js_modules to resolve the magic behavior in Pyodide impossible to replicate in MicroPython

The latter point means that a similar solution can be used to fix pyscript/pyscript#1899 too so that we don't need anymore to pollute the global with another entry as js_modules is and both py and mpy can work seamlessly when it comes to import modules.

@WebReflection WebReflection force-pushed the better-js-modules-support branch from 7d0beb2 to 5d7baba Compare December 19, 2023 11:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

js_modules not behaving like in Polyscript
1 participant