Updated Polyscript and added Panel worker test (#2130)

* Updated Polyscript and added Panel worker test

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
Andrea Giammarchi
2024-07-31 14:31:35 +02:00
committed by GitHub
parent 8c46fcabf7
commit f316341e73
5 changed files with 45 additions and 12 deletions

View File

@@ -1,17 +1,17 @@
{
"name": "@pyscript/core",
"version": "0.5.0",
"version": "0.5.1",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "@pyscript/core",
"version": "0.5.0",
"version": "0.5.1",
"license": "APACHE-2.0",
"dependencies": {
"@ungap/with-resolvers": "^0.1.0",
"basic-devtools": "^0.1.6",
"polyscript": "^0.14.2",
"polyscript": "^0.14.3",
"sticky-module": "^0.1.1",
"to-json-callback": "^0.1.1",
"type-checked-collections": "^0.1.7"
@@ -1344,9 +1344,9 @@
}
},
"node_modules/coincident": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/coincident/-/coincident-2.0.0.tgz",
"integrity": "sha512-dBaBEgcXQiSMVosZ76YqEeNQAW+xsOQG9cc/MzDH/aHTz/l+Q2xPwI8cW0AtDd+D56CLrgRVdR+L6Pf7j8OAgw==",
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/coincident/-/coincident-2.0.1.tgz",
"integrity": "sha512-IuCPvXxKY/CcIOqB8P6sdkIFcmPwfoK8kYULNVBog9tx1fYPOzXRFgphnQL7sqyCxsokzo0OUx1JfuwyG+dhlA==",
"license": "MIT",
"dependencies": {
"gc-hook": "^0.3.1",
@@ -2935,9 +2935,9 @@
}
},
"node_modules/polyscript": {
"version": "0.14.2",
"resolved": "https://registry.npmjs.org/polyscript/-/polyscript-0.14.2.tgz",
"integrity": "sha512-jYZXUFJ+SPhpKKrGQJVcsXmTKE0EnFAr3ApvVP1IGzmpvgEBbmrzfQld6MIVOljQxoec7pXlKgqPQoM28KXnvg==",
"version": "0.14.3",
"resolved": "https://registry.npmjs.org/polyscript/-/polyscript-0.14.3.tgz",
"integrity": "sha512-8+BAF9QNO6VQtq4srNQP4KoPI0fX0TqOfXReSFrIqg6zL7WgxQana3UKFqqqSPgxmhaFPdltPqwRLnBD6hIxAQ==",
"license": "APACHE-2.0",
"dependencies": {
"@ungap/structured-clone": "^1.2.0",
@@ -2946,7 +2946,7 @@
"@webreflection/idb-map": "^0.3.1",
"basic-devtools": "^0.1.6",
"codedent": "^0.1.2",
"coincident": "^2.0.0",
"coincident": "^2.0.1",
"gc-hook": "^0.3.1",
"html-escaper": "^3.0.3",
"proxy-target": "^3.0.2",

View File

@@ -1,6 +1,6 @@
{
"name": "@pyscript/core",
"version": "0.5.0",
"version": "0.5.1",
"type": "module",
"description": "PyScript",
"module": "./index.js",
@@ -44,7 +44,7 @@
"dependencies": {
"@ungap/with-resolvers": "^0.1.0",
"basic-devtools": "^0.1.6",
"polyscript": "^0.14.2",
"polyscript": "^0.14.3",
"sticky-module": "^0.1.1",
"to-json-callback": "^0.1.1",
"type-checked-collections": "^0.1.7"

View File

@@ -0,0 +1,4 @@
packages = [
"https://cdn.holoviz.org/panel/wheels/bokeh-3.5.0-py3-none-any.whl",
"https://cdn.holoviz.org/panel/1.5.0-b.2/dist/wheels/panel-1.5.0b2-py3-none-any.whl"
]

View File

@@ -0,0 +1,17 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="stylesheet" href="../../dist/core.css">
<script src="https://cdn.bokeh.org/bokeh/release/bokeh-3.5.0.js"></script>
<script src="https://cdn.bokeh.org/bokeh/release/bokeh-widgets-3.5.0.min.js"></script>
<script src="https://cdn.bokeh.org/bokeh/release/bokeh-tables-3.5.0.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@holoviz/panel@1.5.0-b.2/dist/panel.min.js"></script>
<script type="module" src="../../dist/core.js"></script>
</head>
<body>
<script type="py" src="main.py" config="config.toml" worker></script>
<div id="simple_app"></div>
</body>
</html>

View File

@@ -0,0 +1,12 @@
import panel as pn
pn.extension(sizing_mode="stretch_width")
slider = pn.widgets.FloatSlider(start=0, end=10, name="amplitude")
def callback(new):
return f"Amplitude is: {new}"
pn.Row(slider, pn.bind(callback, slider)).servable(target="simple_app")