Published wheels JS dependencies ... what could we do about it? #2301
Replies: 3 comments 5 replies
-
Summarizing the previous discussion:
|
Beta Was this translation helpful? Give feedback.
-
Use-caseA cross-platform library implements functionality in a cross-platform way, across Windows, Mac, Linux, and browsers. It delegating to the appropriate platform-specific APIs and dependencies. Consumers of Strawman proposalSuppose a wheel can contain 2x files:
Browser runtime environments can bootstrap themselves like this:
for dep in all_deps:
if VFS.exists(dep.path + "/browser_environment.json"):
browser_env_manifest = parse_json(VFS.read(dep.path + "/browser_environment.json"))
for js_path in browser_env_manifest.main_modules:
load_js_into_main_thread(VFS.read(dep.path + js_path)
So when the user does |
Beta Was this translation helpful? Give feedback.
-
Examples in the wild: pygletpyglet does not current support browser runtimes, but they're interested in supporting them eventually. So they might use this proposal. AudioFor example, pyglet supports multiple audio backends for different platforms. Roughly, it has a list of each backend. It iterates, attempts to load each in a I understand that pyodide/pygbag already supports some audio APIs, so maybe pyglet's existing OpenAL backend will "just work." Or perhaps pyglet will implement an additional Here are links to the relevant code: Font renderingAnother example: font loading, font rendering. Here, pyglet uses I can imagine pyglet adding another "web" platform, conditionally using the browser's |
Beta Was this translation helpful? Give feedback.
-
After a long discussion on our Discord channel I feel like we need to provide broader context and an easier way to discuss this forward, so here the discussion around that topic.
Beta Was this translation helpful? Give feedback.
All reactions