File tree Expand file tree Collapse file tree 2 files changed +58
-1
lines changed Expand file tree Collapse file tree 2 files changed +58
-1
lines changed Original file line number Diff line number Diff line change
1
+ <!DOCTYPE html>
2
+ < html lang ="en ">
3
+ < head >
4
+ < meta charset ="UTF-8 ">
5
+ < meta name ="viewport " content ="width=device-width, initial-scale=1.0 ">
6
+ < title > Document</ title >
7
+ < script type ="module ">
8
+ import { define } from '../core.js' ;
9
+ define ( 'mpy' , {
10
+ interpreter : 'micropython' ,
11
+ hooks : {
12
+ main : {
13
+ onReady ( wrap , element ) {
14
+ wrap . run ( element . textContent ) ;
15
+ }
16
+ }
17
+ }
18
+ } ) ;
19
+ define ( 'py' , {
20
+ interpreter : 'pyodide' ,
21
+ hooks : {
22
+ main : {
23
+ onReady ( wrap , element ) {
24
+ wrap . run ( element . textContent ) ;
25
+ }
26
+ }
27
+ }
28
+ } ) ;
29
+ </ script >
30
+ </ head >
31
+ < body >
32
+ < script type ="micropython ">
33
+ print ( "micropython" )
34
+ </ script >
35
+ < script type ="pyodide ">
36
+ print ( "pyodide" )
37
+ </ script >
38
+ < script type ="micropython " worker >
39
+ print ( "micropython worker" )
40
+ </ script >
41
+ < script type ="pyodide " worker >
42
+ print ( "pyodide worker" )
43
+ </ script >
44
+ < script type ="mpy ">
45
+ print ( "mpy" )
46
+ </ script >
47
+ < script type ="py ">
48
+ print ( "py" )
49
+ </ script >
50
+ < script type ="mpy " worker >
51
+ print ( "mpy worker" )
52
+ </ script >
53
+ < script type ="py " worker >
54
+ print ( "py worker" )
55
+ </ script >
56
+ </ body >
57
+ </ html >
Original file line number Diff line number Diff line change 8
8
<!-- this is the setup module script to expose long running Worker -->
9
9
< script type ="module ">
10
10
// grab utilities to bootstrap a Worker out of the blue
11
- import { Hook , XWorker } from 'https://cdn.jsdelivr.net/npm/polyscript ' ;
11
+ import { Hook , XWorker } from '../core.js ' ;
12
12
13
13
const runtimeURL = URL . createObjectURL ( new Blob ( [ '' ] ) ) ;
14
14
You can’t perform that action at this time.
0 commit comments