Breaking: new Polyscript Hooks mechanism (#1811)

* Breaking: new Polyscript Hooks mechanism

* Added proper smoke test
This commit is contained in:
Andrea Giammarchi
2023-10-26 17:13:36 +02:00
committed by GitHub
parent 28d37cdead
commit e67eb06d8b
11 changed files with 394 additions and 195 deletions

View File

@@ -8,8 +8,10 @@
<!-- the PyWorker approach -->
<script type="module">
import { PyWorker } from '../dist/core.js';
PyWorker('./worker.py', {config: {fetch: [{files: ['./a.py']}]}});
import { PyWorker, whenDefined } from '../dist/core.js';
whenDefined('py').then(() => {
PyWorker('./worker.py', {config: {fetch: [{files: ['./a.py']}]}});
});
// the type is overwritten as "pyodide" in PyScript as the module
// lives in that env too
</script>