mirror of
https://github.com/pyscript/pyscript.git
synced 2025-12-20 18:55:29 -05:00
Avoid PyWeb as part of stdlib on MicroPython (#2030)
* Avoid PyWeb as part of stdlib on MicroPython * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
c653296821
commit
cf92996071
@@ -26,8 +26,8 @@ import { ErrorCode } from "./exceptions.js";
|
||||
import { robustFetch as fetch, getText } from "./fetch.js";
|
||||
import { hooks, main, worker, codeFor, createFunction } from "./hooks.js";
|
||||
|
||||
import stdlib from "./stdlib.js";
|
||||
export { stdlib };
|
||||
import { stdlib, optional } from "./stdlib.js";
|
||||
export { stdlib, optional };
|
||||
|
||||
// generic helper to disambiguate between custom element and script
|
||||
const isScript = ({ tagName }) => tagName === "SCRIPT";
|
||||
@@ -168,7 +168,7 @@ for (const [TYPE, interpreter] of TYPES) {
|
||||
// specific main and worker hooks
|
||||
const hooks = {
|
||||
main: {
|
||||
...codeFor(main),
|
||||
...codeFor(main, TYPE),
|
||||
async onReady(wrap, element) {
|
||||
registerModule(wrap);
|
||||
|
||||
@@ -265,7 +265,7 @@ for (const [TYPE, interpreter] of TYPES) {
|
||||
},
|
||||
},
|
||||
worker: {
|
||||
...codeFor(worker),
|
||||
...codeFor(worker, TYPE),
|
||||
// these are lazy getters that returns a composition
|
||||
// of the current hooks or undefined, if no hook is present
|
||||
get onReady() {
|
||||
|
||||
Reference in New Issue
Block a user