mirror of
https://github.com/pyscript/pyscript.git
synced 2025-12-19 18:27:29 -05:00
* updated MicroPython to latest in order to have `globals` API available * reduced code around helpers for both MicroPython and Pyodide as now these are more aligned * updated all dependencies and brought in latest [coincident/window](https://github.com/WebReflection/coincident#coincidentwindow) goodness to any `xworker`, preserving the `sync` previous behavior * using [@ungap/structured-clone/json](https://github.com/ungap/structured-clone#tojson) as *coincident* default `parse` and `stringify` utility to allow recursive and more complex data to travel back from the *Worker* (forward data is still fully [structured clone algorithm compatible](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Structured_clone_algorithm)) * renamed all *plugin/s* references to *custom/s* as plugin as a word was too misleading * changed *custom types* helpers logic to allow any single node to have its own version of the interpreter wrapper, and all the extra fields it carries with it, including a way to augment every interpreter execution, among as every worker code execution * created a `custom` folder where I've landed the very first `pyscript.js` custom type * created an exhaustive test page to demonstrate the current abilities of *PyScript Next* among its ability to expose utilities that can be used to create *PyScript* plugins
29 lines
954 B
HTML
29 lines
954 B
HTML
<!doctype html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8" />
|
|
<meta name="viewport" content="width=device-width,initial-scale=1.0" />
|
|
<title>python</title>
|
|
<link rel="stylesheet" href="style.css" />
|
|
<script defer src="./counter.js"></script>
|
|
<script type="module" src="../core.js"></script>
|
|
</head>
|
|
<body>
|
|
<script type="micropython">
|
|
w = XWorker('./matplot.py', **{'type': 'pyodide', 'config': './config.toml'})
|
|
|
|
# xworker.window made the following completely unnecessary
|
|
|
|
# def show_image(event):
|
|
# from js import document
|
|
# img = document.createElement("img")
|
|
# img.style.transform = "scale(.5)"
|
|
# img.src = event.data
|
|
# document.querySelector("#image").append(img)
|
|
|
|
# w.onmessage = show_image
|
|
</script>
|
|
<div id="image"></div>
|
|
</body>
|
|
</html>
|