filly 0.2.0__tar.gz → 0.2.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {filly-0.2.0 → filly-0.2.1}/.github/workflows/wheels.yml +10 -10
- {filly-0.2.0 → filly-0.2.1}/PKG-INFO +1 -1
- {filly-0.2.0 → filly-0.2.1}/docs/explanation/web.md +4 -0
- {filly-0.2.0 → filly-0.2.1}/pyproject.toml +1 -1
- {filly-0.2.0 → filly-0.2.1}/tests/test_web.py +20 -6
- {filly-0.2.0 → filly-0.2.1}/tests/web/run_page.mjs +10 -5
- {filly-0.2.0 → filly-0.2.1}/web/filly.js +31 -2
- {filly-0.2.0 → filly-0.2.1}/.gitignore +0 -0
- {filly-0.2.0 → filly-0.2.1}/CMakeLists.txt +0 -0
- {filly-0.2.0 → filly-0.2.1}/LICENSE +0 -0
- {filly-0.2.0 → filly-0.2.1}/NOTES.md +0 -0
- {filly-0.2.0 → filly-0.2.1}/README.md +0 -0
- {filly-0.2.0 → filly-0.2.1}/docs/explanation/assumptions.md +0 -0
- {filly-0.2.0 → filly-0.2.1}/docs/explanation/design.md +0 -0
- {filly-0.2.0 → filly-0.2.1}/docs/explanation/filament.md +0 -0
- {filly-0.2.0 → filly-0.2.1}/docs/explanation/material-precompilation.md +0 -0
- {filly-0.2.0 → filly-0.2.1}/docs/how-to/build.md +0 -0
- {filly-0.2.0 → filly-0.2.1}/docs/how-to/gl-hosts.md +0 -0
- {filly-0.2.0 → filly-0.2.1}/docs/how-to/profile.md +0 -0
- {filly-0.2.0 → filly-0.2.1}/docs/how-to/psychopy.md +0 -0
- {filly-0.2.0 → filly-0.2.1}/docs/how-to/reference-comparison.md +0 -0
- {filly-0.2.0 → filly-0.2.1}/docs/how-to/stress-test.md +0 -0
- {filly-0.2.0 → filly-0.2.1}/docs/how-to/web.md +0 -0
- {filly-0.2.0 → filly-0.2.1}/docs/images/README.md +0 -0
- {filly-0.2.0 → filly-0.2.1}/docs/images/amber-orthographic.png +0 -0
- {filly-0.2.0 → filly-0.2.1}/docs/images/amber-perspective.png +0 -0
- {filly-0.2.0 → filly-0.2.1}/docs/images/horse.gif +0 -0
- {filly-0.2.0 → filly-0.2.1}/docs/images/horse.png +0 -0
- {filly-0.2.0 → filly-0.2.1}/docs/images/iridescence-environment.png +0 -0
- {filly-0.2.0 → filly-0.2.1}/docs/images/iridescence-studio.png +0 -0
- {filly-0.2.0 → filly-0.2.1}/docs/reference/api.md +0 -0
- {filly-0.2.0 → filly-0.2.1}/docs/reference/performance.md +0 -0
- {filly-0.2.0 → filly-0.2.1}/docs/reference/sample-assets.csv +0 -0
- {filly-0.2.0 → filly-0.2.1}/docs/reference/sample-assets.md +0 -0
- {filly-0.2.0 → filly-0.2.1}/docs/reference/upstream-issues.md +0 -0
- {filly-0.2.0 → filly-0.2.1}/docs/reference/validation.md +0 -0
- {filly-0.2.0 → filly-0.2.1}/docs/tutorials/offscreen.md +0 -0
- {filly-0.2.0 → filly-0.2.1}/examples/assets/ATTRIBUTION.md +0 -0
- {filly-0.2.0 → filly-0.2.1}/examples/assets/wooden_playground_horse.glb +0 -0
- {filly-0.2.0 → filly-0.2.1}/examples/drifting_grating.py +0 -0
- {filly-0.2.0 → filly-0.2.1}/examples/moderngl_shared.py +0 -0
- {filly-0.2.0 → filly-0.2.1}/examples/pick.py +0 -0
- {filly-0.2.0 → filly-0.2.1}/examples/psychopy_shared.py +0 -0
- {filly-0.2.0 → filly-0.2.1}/examples/psychopy_stress.py +0 -0
- {filly-0.2.0 → filly-0.2.1}/examples/pyglet_shared.py +0 -0
- {filly-0.2.0 → filly-0.2.1}/examples/screenshot.py +0 -0
- {filly-0.2.0 → filly-0.2.1}/examples/shapes.py +0 -0
- {filly-0.2.0 → filly-0.2.1}/examples/stereo.py +0 -0
- {filly-0.2.0 → filly-0.2.1}/examples/zengl_shared.py +0 -0
- {filly-0.2.0 → filly-0.2.1}/native/animation.inc +0 -0
- {filly-0.2.0 → filly-0.2.1}/native/archive_materials.cpp +0 -0
- {filly-0.2.0 → filly-0.2.1}/native/bindings.cpp +0 -0
- {filly-0.2.0 → filly-0.2.1}/native/egl_platform.cpp +0 -0
- {filly-0.2.0 → filly-0.2.1}/native/egl_platform.h +0 -0
- {filly-0.2.0 → filly-0.2.1}/native/engine_config.h +0 -0
- {filly-0.2.0 → filly-0.2.1}/native/features.inc +0 -0
- {filly-0.2.0 → filly-0.2.1}/native/gl_interop.cpp +0 -0
- {filly-0.2.0 → filly-0.2.1}/native/gl_interop.h +0 -0
- {filly-0.2.0 → filly-0.2.1}/native/gl_interop_web.cpp +0 -0
- {filly-0.2.0 → filly-0.2.1}/native/gltf_prepare.cpp +0 -0
- {filly-0.2.0 → filly-0.2.1}/native/gltf_prepare.h +0 -0
- {filly-0.2.0 → filly-0.2.1}/native/json.cpp +0 -0
- {filly-0.2.0 → filly-0.2.1}/native/json.h +0 -0
- {filly-0.2.0 → filly-0.2.1}/native/libwebp.cmake +0 -0
- {filly-0.2.0 → filly-0.2.1}/native/materials/check_refraction.cmake +0 -0
- {filly-0.2.0 → filly-0.2.1}/native/materials/diffuse_transmission.mat.in +0 -0
- {filly-0.2.0 → filly-0.2.1}/native/materials/embed.cmake +0 -0
- {filly-0.2.0 → filly-0.2.1}/native/materials/encode.mat.in +0 -0
- {filly-0.2.0 → filly-0.2.1}/native/materials/fxaa.mat +0 -0
- {filly-0.2.0 → filly-0.2.1}/native/materials/materials.cmake +0 -0
- {filly-0.2.0 → filly-0.2.1}/native/materials/output.cmake +0 -0
- {filly-0.2.0 → filly-0.2.1}/native/materials/specular_glossiness.mat.in +0 -0
- {filly-0.2.0 → filly-0.2.1}/native/materials/surface.mat.in +0 -0
- {filly-0.2.0 → filly-0.2.1}/native/materials/unlit.mat.in +0 -0
- {filly-0.2.0 → filly-0.2.1}/native/materials.h +0 -0
- {filly-0.2.0 → filly-0.2.1}/native/memory.inc +0 -0
- {filly-0.2.0 → filly-0.2.1}/native/output_pass.cpp +0 -0
- {filly-0.2.0 → filly-0.2.1}/native/output_pass.h +0 -0
- {filly-0.2.0 → filly-0.2.1}/native/refraction.h +0 -0
- {filly-0.2.0 → filly-0.2.1}/native/renderer.cpp +0 -0
- {filly-0.2.0 → filly-0.2.1}/native/renderer.h +0 -0
- {filly-0.2.0 → filly-0.2.1}/native/resources.inc +0 -0
- {filly-0.2.0 → filly-0.2.1}/native/shapes.cpp +0 -0
- {filly-0.2.0 → filly-0.2.1}/native/slots.inc +0 -0
- {filly-0.2.0 → filly-0.2.1}/native/vendor/cgltf/LICENSE +0 -0
- {filly-0.2.0 → filly-0.2.1}/native/vendor/cgltf/README.md +0 -0
- {filly-0.2.0 → filly-0.2.1}/native/vendor/cgltf/cgltf.h +0 -0
- {filly-0.2.0 → filly-0.2.1}/native/vendor/meshoptimizer/LICENSE.md +0 -0
- {filly-0.2.0 → filly-0.2.1}/native/vendor/meshoptimizer/README.md +0 -0
- {filly-0.2.0 → filly-0.2.1}/native/vendor/meshoptimizer/indexcodec.cpp +0 -0
- {filly-0.2.0 → filly-0.2.1}/native/vendor/meshoptimizer/meshoptimizer.h +0 -0
- {filly-0.2.0 → filly-0.2.1}/native/vendor/meshoptimizer/vertexcodec.cpp +0 -0
- {filly-0.2.0 → filly-0.2.1}/native/vendor/meshoptimizer/vertexfilter.cpp +0 -0
- {filly-0.2.0 → filly-0.2.1}/native/webp_provider.cpp +0 -0
- {filly-0.2.0 → filly-0.2.1}/native/webp_provider.h +0 -0
- {filly-0.2.0 → filly-0.2.1}/spec.md +0 -0
- {filly-0.2.0 → filly-0.2.1}/src/filly/__init__.py +0 -0
- {filly-0.2.0 → filly-0.2.1}/src/filly/_memory.py +0 -0
- {filly-0.2.0 → filly-0.2.1}/src/filly/_stress.py +0 -0
- {filly-0.2.0 → filly-0.2.1}/src/filly/benchmark.py +0 -0
- {filly-0.2.0 → filly-0.2.1}/src/filly/integrations/__init__.py +0 -0
- {filly-0.2.0 → filly-0.2.1}/src/filly/integrations/_host.py +0 -0
- {filly-0.2.0 → filly-0.2.1}/src/filly/integrations/moderngl.py +0 -0
- {filly-0.2.0 → filly-0.2.1}/src/filly/integrations/psychopy.py +0 -0
- {filly-0.2.0 → filly-0.2.1}/src/filly/integrations/pyglet.py +0 -0
- {filly-0.2.0 → filly-0.2.1}/src/filly/integrations/zengl.py +0 -0
- {filly-0.2.0 → filly-0.2.1}/src/filly/samples/ATTRIBUTION.md +0 -0
- {filly-0.2.0 → filly-0.2.1}/src/filly/samples/__init__.py +0 -0
- {filly-0.2.0 → filly-0.2.1}/src/filly/samples/suzanne.glb +0 -0
- {filly-0.2.0 → filly-0.2.1}/tests/conftest.py +0 -0
- {filly-0.2.0 → filly-0.2.1}/tests/data/README.md +0 -0
- {filly-0.2.0 → filly-0.2.1}/tests/data/box/Box.gltf +0 -0
- {filly-0.2.0 → filly-0.2.1}/tests/data/box/Box0.bin +0 -0
- {filly-0.2.0 → filly-0.2.1}/tests/data/draco-box/Box.bin +0 -0
- {filly-0.2.0 → filly-0.2.1}/tests/data/draco-box/Box.gltf +0 -0
- {filly-0.2.0 → filly-0.2.1}/tests/data/green.ktx2 +0 -0
- {filly-0.2.0 → filly-0.2.1}/tests/data/green.webp +0 -0
- {filly-0.2.0 → filly-0.2.1}/tests/data/quadrants.webp +0 -0
- {filly-0.2.0 → filly-0.2.1}/tests/test_animation_pointer.py +0 -0
- {filly-0.2.0 → filly-0.2.1}/tests/test_asset.py +0 -0
- {filly-0.2.0 → filly-0.2.1}/tests/test_camera_aspect.py +0 -0
- {filly-0.2.0 → filly-0.2.1}/tests/test_controls.py +0 -0
- {filly-0.2.0 → filly-0.2.1}/tests/test_draco.py +0 -0
- {filly-0.2.0 → filly-0.2.1}/tests/test_effects.py +0 -0
- {filly-0.2.0 → filly-0.2.1}/tests/test_encoding.py +0 -0
- {filly-0.2.0 → filly-0.2.1}/tests/test_features.py +0 -0
- {filly-0.2.0 → filly-0.2.1}/tests/test_framing.py +0 -0
- {filly-0.2.0 → filly-0.2.1}/tests/test_gl_hosts.py +0 -0
- {filly-0.2.0 → filly-0.2.1}/tests/test_gltf_surface_camera.py +0 -0
- {filly-0.2.0 → filly-0.2.1}/tests/test_headless.py +0 -0
- {filly-0.2.0 → filly-0.2.1}/tests/test_imported_texture.py +0 -0
- {filly-0.2.0 → filly-0.2.1}/tests/test_interop.py +0 -0
- {filly-0.2.0 → filly-0.2.1}/tests/test_iridescence_dielectric.py +0 -0
- {filly-0.2.0 → filly-0.2.1}/tests/test_large_scene.py +0 -0
- {filly-0.2.0 → filly-0.2.1}/tests/test_lifecycle.py +0 -0
- {filly-0.2.0 → filly-0.2.1}/tests/test_light_pointer.py +0 -0
- {filly-0.2.0 → filly-0.2.1}/tests/test_lighting.py +0 -0
- {filly-0.2.0 → filly-0.2.1}/tests/test_logging.py +0 -0
- {filly-0.2.0 → filly-0.2.1}/tests/test_material_limits.py +0 -0
- {filly-0.2.0 → filly-0.2.1}/tests/test_material_paths.py +0 -0
- {filly-0.2.0 → filly-0.2.1}/tests/test_mesh.py +0 -0
- {filly-0.2.0 → filly-0.2.1}/tests/test_native_imports.py +0 -0
- {filly-0.2.0 → filly-0.2.1}/tests/test_native_preparation.py +0 -0
- {filly-0.2.0 → filly-0.2.1}/tests/test_node_tree.py +0 -0
- {filly-0.2.0 → filly-0.2.1}/tests/test_pick.py +0 -0
- {filly-0.2.0 → filly-0.2.1}/tests/test_psychopy.py +0 -0
- {filly-0.2.0 → filly-0.2.1}/tests/test_refraction.py +0 -0
- {filly-0.2.0 → filly-0.2.1}/tests/test_render_calls.py +0 -0
- {filly-0.2.0 → filly-0.2.1}/tests/test_renderer.py +0 -0
- {filly-0.2.0 → filly-0.2.1}/tests/test_rendering_options.py +0 -0
- {filly-0.2.0 → filly-0.2.1}/tests/test_samples.py +0 -0
- {filly-0.2.0 → filly-0.2.1}/tests/test_scene_extensions.py +0 -0
- {filly-0.2.0 → filly-0.2.1}/tests/test_stress.py +0 -0
- {filly-0.2.0 → filly-0.2.1}/tests/test_textures.py +0 -0
- {filly-0.2.0 → filly-0.2.1}/tests/test_volume.py +0 -0
- {filly-0.2.0 → filly-0.2.1}/tests/web/api.html +0 -0
- {filly-0.2.0 → filly-0.2.1}/tests/web/handover.html +0 -0
- {filly-0.2.0 → filly-0.2.1}/tests/web/package-lock.json +0 -0
- {filly-0.2.0 → filly-0.2.1}/tests/web/package.json +0 -0
- {filly-0.2.0 → filly-0.2.1}/tools/benchmark_refraction.py +0 -0
- {filly-0.2.0 → filly-0.2.1}/tools/benchmark_uploads.py +0 -0
- {filly-0.2.0 → filly-0.2.1}/tools/build_filament_linux.py +0 -0
- {filly-0.2.0 → filly-0.2.1}/tools/build_filament_web.sh +0 -0
- {filly-0.2.0 → filly-0.2.1}/tools/build_filly_web.sh +0 -0
- {filly-0.2.0 → filly-0.2.1}/tools/build_web_container.ps1 +0 -0
- {filly-0.2.0 → filly-0.2.1}/tools/check_native_imports.py +0 -0
- {filly-0.2.0 → filly-0.2.1}/tools/check_sample_assets.py +0 -0
- {filly-0.2.0 → filly-0.2.1}/tools/ci_linux.sh +0 -0
- {filly-0.2.0 → filly-0.2.1}/tools/compare_reference.py +0 -0
- {filly-0.2.0 → filly-0.2.1}/tools/fetch_filament.py +0 -0
- {filly-0.2.0 → filly-0.2.1}/tools/make_suzanne.py +0 -0
- {filly-0.2.0 → filly-0.2.1}/tools/profile_frame.py +0 -0
- {filly-0.2.0 → filly-0.2.1}/tools/profile_matrix.py +0 -0
- {filly-0.2.0 → filly-0.2.1}/tools/profile_rdc_replay.py +0 -0
- {filly-0.2.0 → filly-0.2.1}/tools/profile_tracy.py +0 -0
- {filly-0.2.0 → filly-0.2.1}/tools/web/Dockerfile +0 -0
- {filly-0.2.0 → filly-0.2.1}/uv.lock +0 -0
- {filly-0.2.0 → filly-0.2.1}/web/CMakeLists.txt +0 -0
- {filly-0.2.0 → filly-0.2.1}/web/bindings.cpp +0 -0
- {filly-0.2.0 → filly-0.2.1}/web/gl_tracking.js +0 -0
|
@@ -32,19 +32,19 @@ jobs:
|
|
|
32
32
|
matrix:
|
|
33
33
|
os: [ubuntu-24.04, windows-2022]
|
|
34
34
|
steps:
|
|
35
|
-
- uses: actions/checkout@
|
|
36
|
-
- uses: actions/setup-python@
|
|
35
|
+
- uses: actions/checkout@v7
|
|
36
|
+
- uses: actions/setup-python@v7
|
|
37
37
|
with:
|
|
38
38
|
python-version: '3.12'
|
|
39
39
|
- name: Cache Linux SDK
|
|
40
40
|
if: runner.os == 'Linux'
|
|
41
|
-
uses: actions/cache@
|
|
41
|
+
uses: actions/cache@v6
|
|
42
42
|
with:
|
|
43
43
|
path: .deps/filament-linux
|
|
44
44
|
key: filament-linux-x86_64-manylinux228-${{ hashFiles('tools/build_filament_linux.py', 'tools/ci_linux.sh') }}
|
|
45
45
|
- name: Cache Windows SDK
|
|
46
46
|
if: runner.os == 'Windows'
|
|
47
|
-
uses: actions/cache@
|
|
47
|
+
uses: actions/cache@v6
|
|
48
48
|
with:
|
|
49
49
|
path: .deps
|
|
50
50
|
key: filament-windows-x86_64-${{ hashFiles('tools/fetch_filament.py') }}
|
|
@@ -66,7 +66,7 @@ jobs:
|
|
|
66
66
|
- name: Check extension imports
|
|
67
67
|
shell: bash
|
|
68
68
|
run: python tools/check_native_imports.py wheelhouse/*.whl
|
|
69
|
-
- uses: actions/upload-artifact@
|
|
69
|
+
- uses: actions/upload-artifact@v7
|
|
70
70
|
with:
|
|
71
71
|
name: wheels-${{ matrix.os }}
|
|
72
72
|
path: wheelhouse/*.whl
|
|
@@ -76,8 +76,8 @@ jobs:
|
|
|
76
76
|
name: sdist
|
|
77
77
|
runs-on: ubuntu-24.04
|
|
78
78
|
steps:
|
|
79
|
-
- uses: actions/checkout@
|
|
80
|
-
- uses: actions/setup-python@
|
|
79
|
+
- uses: actions/checkout@v7
|
|
80
|
+
- uses: actions/setup-python@v7
|
|
81
81
|
with:
|
|
82
82
|
python-version: '3.12'
|
|
83
83
|
- name: Check that the tag matches the version
|
|
@@ -92,7 +92,7 @@ jobs:
|
|
|
92
92
|
raise SystemExit(f"Tag {tag} does not match version {version} in pyproject.toml")
|
|
93
93
|
- name: Build the sdist
|
|
94
94
|
run: pipx run build --sdist
|
|
95
|
-
- uses: actions/upload-artifact@
|
|
95
|
+
- uses: actions/upload-artifact@v7
|
|
96
96
|
with:
|
|
97
97
|
name: sdist
|
|
98
98
|
path: dist/*.tar.gz
|
|
@@ -109,7 +109,7 @@ jobs:
|
|
|
109
109
|
permissions:
|
|
110
110
|
id-token: write
|
|
111
111
|
steps:
|
|
112
|
-
- uses: actions/download-artifact@
|
|
112
|
+
- uses: actions/download-artifact@v8
|
|
113
113
|
with:
|
|
114
114
|
path: dist
|
|
115
115
|
merge-multiple: true
|
|
@@ -126,7 +126,7 @@ jobs:
|
|
|
126
126
|
permissions:
|
|
127
127
|
id-token: write
|
|
128
128
|
steps:
|
|
129
|
-
- uses: actions/download-artifact@
|
|
129
|
+
- uses: actions/download-artifact@v8
|
|
130
130
|
with:
|
|
131
131
|
path: dist
|
|
132
132
|
merge-multiple: true
|
|
@@ -155,6 +155,10 @@ Firefox has no `KHR_parallel_shader_compile`. Filament then compiles at the firs
|
|
|
155
155
|
`write(fn)`) keep only the bookkeeping.
|
|
156
156
|
- Files load from memory: `loadUrl()` fetches a `.glb`, or a `.gltf` and the buffers and images
|
|
157
157
|
it names, and writes them to Emscripten's in-memory file system for the load.
|
|
158
|
+
- `filly.js` compiles `filly-core.wasm` while it downloads only if the server sends it as
|
|
159
|
+
`application/wasm`. Some static hosts, Pavlovia among them, send another type. Then
|
|
160
|
+
`filly.js` compiles the downloaded bytes. Emscripten's own loader would log an error and
|
|
161
|
+
download the file again.
|
|
158
162
|
|
|
159
163
|
## Output compared with the desktop
|
|
160
164
|
|
|
@@ -108,8 +108,9 @@ def _web_build():
|
|
|
108
108
|
return build
|
|
109
109
|
|
|
110
110
|
|
|
111
|
-
def _run_page(browser, page, folder):
|
|
112
|
-
"""Serve the web build, the pages, and tree.glb from folder; return the page's testResult
|
|
111
|
+
def _run_page(browser, page, folder, wasm_type=None, report=False):
|
|
112
|
+
"""Serve the web build, the pages, and tree.glb from folder; return the page's testResult,
|
|
113
|
+
or with `report`, also the console messages. `wasm_type`: the Content-Type of .wasm files."""
|
|
113
114
|
executable = os.environ.get(f"FILLY_TEST_{browser.upper()}", EXECUTABLES.get(browser, ""))
|
|
114
115
|
node = shutil.which("node")
|
|
115
116
|
if not node:
|
|
@@ -128,12 +129,13 @@ def _run_page(browser, page, folder):
|
|
|
128
129
|
(folder / "tree.glb").write_bytes(tree_glb())
|
|
129
130
|
(folder / "instances.glb").write_bytes(instances_glb())
|
|
130
131
|
shutil.copytree(ROOT / "tests" / "data" / "draco-box", folder / "draco-box")
|
|
131
|
-
|
|
132
|
+
command = [node, str(WEB / "run_page.mjs"), str(folder), page, browser, executable]
|
|
133
|
+
result = subprocess.run(command + ([wasm_type] if wasm_type else []),
|
|
132
134
|
capture_output=True, text=True, timeout=300, cwd=WEB)
|
|
133
135
|
assert result.returncode == 0, result.stderr[-3000:]
|
|
134
|
-
|
|
135
|
-
assert
|
|
136
|
-
return report["result"]
|
|
136
|
+
output = json.loads(result.stdout.strip().splitlines()[-1])
|
|
137
|
+
assert output["pageErrors"] == [], output["pageErrors"]
|
|
138
|
+
return output if report else output["result"]
|
|
137
139
|
|
|
138
140
|
|
|
139
141
|
@pytest.fixture(scope="module", params=BROWSERS)
|
|
@@ -390,6 +392,18 @@ def test_gpu_frame_time(page_results):
|
|
|
390
392
|
assert large > 2 * small, value
|
|
391
393
|
|
|
392
394
|
|
|
395
|
+
def test_wasm_without_wasm_type(browser_folder):
|
|
396
|
+
"""A host that sends the .wasm file as application/octet-stream, as Pavlovia does: the module
|
|
397
|
+
loads without the console error and second download of Emscripten's fallback."""
|
|
398
|
+
browser, folder = browser_folder
|
|
399
|
+
output = _run_page(browser, "handover.html", folder, wasm_type="application/octet-stream",
|
|
400
|
+
report=True)
|
|
401
|
+
assert output["consoleErrors"] == [], output["consoleErrors"]
|
|
402
|
+
warnings = [text for text in output["consoleWarnings"] if "wasm" in text.lower()]
|
|
403
|
+
assert warnings == [], warnings
|
|
404
|
+
assert output["result"]["readValues"]["width"] == 512
|
|
405
|
+
|
|
406
|
+
|
|
393
407
|
def test_handover(handover_results):
|
|
394
408
|
calls = handover_results["calls"]
|
|
395
409
|
# Property reads after the hand-back leave the context with the page.
|
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
// Serve a folder, open one page in a browser, and print the page's window.testResult as JSON.
|
|
2
2
|
//
|
|
3
|
-
// Usage: node run_page.mjs FOLDER PAGE BROWSER EXECUTABLE
|
|
3
|
+
// Usage: node run_page.mjs FOLDER PAGE BROWSER EXECUTABLE [WASM_TYPE]
|
|
4
4
|
//
|
|
5
5
|
// The page sets window.testResult when it is done. Page errors and console errors are reported
|
|
6
|
-
// with the result. The server sends no special headers
|
|
6
|
+
// with the result, and console warnings too. The server sends no special headers; WASM_TYPE
|
|
7
|
+
// replaces the Content-Type of .wasm files (default application/wasm).
|
|
7
8
|
import fs from "node:fs";
|
|
8
9
|
import http from "node:http";
|
|
9
10
|
import path from "node:path";
|
|
10
11
|
import puppeteer from "puppeteer-core";
|
|
11
12
|
|
|
12
|
-
const [folder, pageName, browserName, executable] = process.argv.slice(2);
|
|
13
|
+
const [folder, pageName, browserName, executable, wasmType] = process.argv.slice(2);
|
|
13
14
|
const types = { ".html": "text/html", ".mjs": "text/javascript", ".js": "text/javascript",
|
|
14
|
-
".wasm": "application/wasm", ".json": "application/json" };
|
|
15
|
+
".wasm": wasmType ?? "application/wasm", ".json": "application/json" };
|
|
15
16
|
const server = http.createServer((request, response) =>
|
|
16
17
|
{
|
|
17
18
|
const file = path.join(folder, decodeURIComponent(new URL(request.url, "http://host").pathname));
|
|
@@ -28,7 +29,7 @@ const server = http.createServer((request, response) =>
|
|
|
28
29
|
});
|
|
29
30
|
}).listen(0);
|
|
30
31
|
|
|
31
|
-
const report = { pageErrors: [], consoleErrors: [] };
|
|
32
|
+
const report = { pageErrors: [], consoleErrors: [], consoleWarnings: [] };
|
|
32
33
|
const browser = await puppeteer.launch({
|
|
33
34
|
executablePath: executable,
|
|
34
35
|
browser: browserName === "firefox" ? "firefox" : "chrome",
|
|
@@ -45,6 +46,10 @@ try
|
|
|
45
46
|
{
|
|
46
47
|
report.consoleErrors.push(message.text());
|
|
47
48
|
}
|
|
49
|
+
else if (message.type() === "warn")
|
|
50
|
+
{
|
|
51
|
+
report.consoleWarnings.push(message.text());
|
|
52
|
+
}
|
|
48
53
|
});
|
|
49
54
|
await page.goto(`http://localhost:${server.address().port}/${pageName}`);
|
|
50
55
|
await page.waitForFunction(() => window.testResult !== undefined, { timeout: 120000 });
|
|
@@ -48,11 +48,40 @@ let loadedModule = null;
|
|
|
48
48
|
/** Load the WebAssembly module once per page. filly-core.wasm is resolved next to this file. */
|
|
49
49
|
export function loadModule()
|
|
50
50
|
{
|
|
51
|
-
|
|
52
|
-
|
|
51
|
+
if (!modulePromise)
|
|
52
|
+
{
|
|
53
|
+
// Emscripten's instantiateWasm hook has no way to report a failure.
|
|
54
|
+
let fail;
|
|
55
|
+
const failed = new Promise((resolve, reject) => (fail = reject));
|
|
56
|
+
const created = createFillyModule({
|
|
57
|
+
locateFile: (file) => new URL(file, import.meta.url).href,
|
|
58
|
+
instantiateWasm: (imports, receive) =>
|
|
59
|
+
{
|
|
60
|
+
instantiateWasm(new URL("filly-core.wasm", import.meta.url).href, imports)
|
|
61
|
+
.then(({ instance, module }) => receive(instance, module), fail);
|
|
62
|
+
return {};
|
|
63
|
+
},
|
|
64
|
+
});
|
|
65
|
+
modulePromise = Promise.race([created, failed]).then((module) => (loadedModule = module));
|
|
66
|
+
}
|
|
53
67
|
return modulePromise;
|
|
54
68
|
}
|
|
55
69
|
|
|
70
|
+
// Static hosts, Pavlovia among them, can send .wasm files without the application/wasm type that
|
|
71
|
+
// streaming compilation needs. Emscripten's loader then logs an error and fetches the file again.
|
|
72
|
+
async function instantiateWasm(url, imports)
|
|
73
|
+
{
|
|
74
|
+
const response = await fetch(url);
|
|
75
|
+
if (!response.ok)
|
|
76
|
+
{
|
|
77
|
+
throw new FillyError(`Could not fetch ${url}: ${response.status} ${response.statusText}`);
|
|
78
|
+
}
|
|
79
|
+
const type = response.headers.get("Content-Type")?.split(";")[0].trim();
|
|
80
|
+
return type === "application/wasm"
|
|
81
|
+
? WebAssembly.instantiateStreaming(response, imports)
|
|
82
|
+
: WebAssembly.instantiate(await response.arrayBuffer(), imports);
|
|
83
|
+
}
|
|
84
|
+
|
|
56
85
|
function moduleNow()
|
|
57
86
|
{
|
|
58
87
|
if (!loadedModule)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|