mirror of
https://github.com/pyscript/pyscript.git
synced 2026-03-27 02:00:24 -04:00
[next] Improved worker attribute DX (#1625)
This commit is contained in:
committed by
GitHub
parent
a484aff457
commit
77d8fe3562
@@ -5,9 +5,15 @@
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>PyScript Next</title>
|
||||
<link rel="stylesheet" href="../core.css" />
|
||||
|
||||
<!-- the worker attribute -->
|
||||
<script type="module" src="../core.js"></script>
|
||||
<script type="py" worker="./worker.py" config="./config.json"></script>
|
||||
|
||||
<!-- the PyWorker approach -->
|
||||
<script type="module">
|
||||
import { PyWorker } from '../core.js';
|
||||
PyWorker('./worker.py'/*, options allowed except `type` */);
|
||||
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>
|
||||
|
||||
Reference in New Issue
Block a user