Skip to content

Commit 87256a6

Browse files
Updated Polyscript to its latest (#2355)
* Updated Polyscript to its latest * added tests for `experimental_ffi_timeout`
1 parent 7336ae5 commit 87256a6

File tree

10 files changed

+369
-329
lines changed

10 files changed

+369
-329
lines changed

core/package-lock.json

Lines changed: 301 additions & 315 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

core/package.json

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@pyscript/core",
3-
"version": "0.6.53",
3+
"version": "0.6.62",
44
"type": "module",
55
"description": "PyScript",
66
"module": "./index.js",
@@ -67,35 +67,35 @@
6767
"dependencies": {
6868
"@ungap/with-resolvers": "^0.1.0",
6969
"@webreflection/idb-map": "^0.3.2",
70-
"@webreflection/utils": "^0.1.0",
70+
"@webreflection/utils": "^0.1.1",
7171
"add-promise-listener": "^0.1.3",
7272
"basic-devtools": "^0.1.6",
73-
"polyscript": "^0.17.20",
73+
"polyscript": "^0.17.33",
7474
"sticky-module": "^0.1.1",
7575
"to-json-callback": "^0.1.1",
7676
"type-checked-collections": "^0.1.7"
7777
},
7878
"devDependencies": {
7979
"@codemirror/commands": "^6.8.1",
8080
"@codemirror/lang-python": "^6.2.1",
81-
"@codemirror/language": "^6.11.0",
81+
"@codemirror/language": "^6.11.2",
8282
"@codemirror/state": "^6.5.2",
83-
"@codemirror/view": "^6.36.8",
84-
"@playwright/test": "^1.52.0",
85-
"@rollup/plugin-commonjs": "^28.0.3",
83+
"@codemirror/view": "^6.38.0",
84+
"@playwright/test": "^1.53.2",
85+
"@rollup/plugin-commonjs": "^28.0.6",
8686
"@rollup/plugin-node-resolve": "^16.0.1",
8787
"@rollup/plugin-terser": "^0.4.4",
8888
"@webreflection/toml-j0.4": "^1.1.4",
8989
"@xterm/addon-fit": "^0.10.0",
9090
"@xterm/addon-web-links": "^0.11.0",
9191
"@xterm/xterm": "^5.5.0",
92-
"bun": "^1.2.13",
92+
"bun": "^1.2.17",
9393
"chokidar": "^4.0.3",
9494
"codedent": "^0.1.2",
95-
"codemirror": "^6.0.1",
96-
"eslint": "^9.27.0",
95+
"codemirror": "^6.0.2",
96+
"eslint": "^9.30.0",
9797
"flatted": "^3.3.3",
98-
"rollup": "^4.41.0",
98+
"rollup": "^4.44.1",
9999
"rollup-plugin-postcss": "^4.0.2",
100100
"rollup-plugin-string": "^3.0.0",
101101
"static-handler": "^0.5.3",

core/src/config.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,9 @@ for (const [TYPE] of TYPES) {
154154
return await Promise.all(toBeAwaited);
155155
};
156156

157+
if (Number.isSafeInteger(parsed?.experimental_ffi_timeout))
158+
globalThis.reflected_ffi_timeout = parsed?.experimental_ffi_timeout;
159+
157160
configs.set(TYPE, { config: parsed, configURL, plugins, error });
158161
}
159162

core/src/stdlib/pyscript.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

core/src/stdlib/pyscript/ffi.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,27 @@ def _tjs(value, **kw):
1616

1717
create_proxy = _cp
1818
to_js = _tjs
19+
20+
try:
21+
from polyscript import ffi as _ffi
22+
23+
direct = _ffi.direct
24+
gather = _ffi.gather
25+
query = _ffi.query
26+
27+
def assign(source, *args):
28+
for arg in args:
29+
_ffi.assign(source, to_js(arg))
30+
return source
31+
32+
except:
33+
import js
34+
35+
_assign = js.Object.assign
36+
37+
direct = lambda source: source
38+
39+
def assign(source, *args):
40+
for arg in args:
41+
_assign(source, to_js(arg))
42+
return source

0 commit comments

Comments
 (0)