mirror of
https://github.com/pyscript/pyscript.git
synced 2025-12-19 18:27:29 -05:00
Update Polyscript with latest Micropython (#2357)
This commit is contained in:
committed by
GitHub
parent
e433275938
commit
71ad1a40cb
12
core/package-lock.json
generated
12
core/package-lock.json
generated
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "@pyscript/core",
|
||||
"version": "0.6.62",
|
||||
"version": "0.6.63",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "@pyscript/core",
|
||||
"version": "0.6.62",
|
||||
"version": "0.6.63",
|
||||
"license": "APACHE-2.0",
|
||||
"dependencies": {
|
||||
"@ungap/with-resolvers": "^0.1.0",
|
||||
@@ -14,7 +14,7 @@
|
||||
"@webreflection/utils": "^0.1.1",
|
||||
"add-promise-listener": "^0.1.3",
|
||||
"basic-devtools": "^0.1.6",
|
||||
"polyscript": "^0.17.33",
|
||||
"polyscript": "^0.17.34",
|
||||
"sticky-module": "^0.1.1",
|
||||
"to-json-callback": "^0.1.1",
|
||||
"type-checked-collections": "^0.1.7"
|
||||
@@ -2751,9 +2751,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/polyscript": {
|
||||
"version": "0.17.33",
|
||||
"resolved": "https://registry.npmjs.org/polyscript/-/polyscript-0.17.33.tgz",
|
||||
"integrity": "sha512-fQ8WEGoaMNfSGuVA9BIWhg/5NCDKPtpjtHLXUunj9QhAtKtJpx69yd29bEuwgpRzS/qb4LZQ/HhelTZLlbCsog==",
|
||||
"version": "0.17.34",
|
||||
"resolved": "https://registry.npmjs.org/polyscript/-/polyscript-0.17.34.tgz",
|
||||
"integrity": "sha512-aqw0b0KQi739bA70xuxQx6+jwnPHdZ+hqP2asekZclgjywXDbHjG9TU4M9qQ5yf5kSoodBrL80u+2RKNVfCjgw==",
|
||||
"license": "APACHE-2.0",
|
||||
"dependencies": {
|
||||
"@webreflection/fetch": "^0.1.5",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@pyscript/core",
|
||||
"version": "0.6.62",
|
||||
"version": "0.6.63",
|
||||
"type": "module",
|
||||
"description": "PyScript",
|
||||
"module": "./index.js",
|
||||
@@ -70,7 +70,7 @@
|
||||
"@webreflection/utils": "^0.1.1",
|
||||
"add-promise-listener": "^0.1.3",
|
||||
"basic-devtools": "^0.1.6",
|
||||
"polyscript": "^0.17.33",
|
||||
"polyscript": "^0.17.34",
|
||||
"sticky-module": "^0.1.1",
|
||||
"to-json-callback": "^0.1.1",
|
||||
"type-checked-collections": "^0.1.7"
|
||||
|
||||
File diff suppressed because one or more lines are too long
36
core/tests/javascript/worker-symbols.html
Normal file
36
core/tests/javascript/worker-symbols.html
Normal file
@@ -0,0 +1,36 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>PyScript VS Symbols</title>
|
||||
<script>
|
||||
globalThis.hasSymbol = (symbol, ref) => symbol in ref;
|
||||
globalThis.getSymbol = (symbol, ref) => ref[symbol];
|
||||
|
||||
// some 3rd party JS library might use symbols to brand-check
|
||||
// so it's not about symbols traveling from MicroPython
|
||||
// it's about MicroPython proxies traps not understanding symbols
|
||||
globalThis.hasIterator = ref => Symbol.iterator in ref;
|
||||
</script>
|
||||
<link rel="stylesheet" href="../../dist/core.css">
|
||||
<script type="module" src="../../dist/core.js"></script>
|
||||
<script type="mpy">
|
||||
import js
|
||||
|
||||
symbol = js.Symbol.iterator
|
||||
|
||||
if js.getSymbol(symbol, []) and js.hasSymbol(symbol, []) and js.hasIterator([]):
|
||||
js.document.documentElement.classList.add("main")
|
||||
</script>
|
||||
<script type="mpy" worker>
|
||||
from pyscript import window
|
||||
import js
|
||||
|
||||
symbol = js.Symbol.iterator
|
||||
|
||||
if window.getSymbol(symbol, []) and window.hasSymbol(symbol, []) and window.hasIterator([]):
|
||||
window.document.documentElement.classList.add("worker")
|
||||
</script>
|
||||
</head>
|
||||
</html>
|
||||
@@ -59,6 +59,11 @@ test('MicroPython + configURL', async ({ page }) => {
|
||||
await page.waitForSelector('html.main.worker');
|
||||
});
|
||||
|
||||
test('MicroPython + Symbols', async ({ page }) => {
|
||||
await page.goto('http://localhost:8080/tests/javascript/worker-symbols.html');
|
||||
await page.waitForSelector('html.main.worker');
|
||||
});
|
||||
|
||||
test('Pyodide + terminal on Main', async ({ page }) => {
|
||||
await page.goto('http://localhost:8080/tests/javascript/py-terminal-main.html');
|
||||
await page.waitForSelector('html.ok');
|
||||
|
||||
Reference in New Issue
Block a user