Skip to content

Conversation

pavel-mazhuga
Copy link
Contributor

Description

Three.js fails to run on some devices that don't have OffscreenCanvas support. This PR ensures that 'OffscreenCanvas' is always safely accessed.

Copy link

📦 Bundle size

Full ESM build, minified and gzipped.

Before After Diff
WebGL 337.26
78.64
337.26
78.64
+0 B
+0 B
WebGPU 553.44
153.41
553.48
153.41
+37 B
+2 B
WebGPU Nodes 552.79
153.26
552.83
153.26
+37 B
+2 B

🌳 Bundle size after tree-shaking

Minimal build including a renderer, camera, empty scene, and dependencies.

Before After Diff
WebGL 468.44
113.28
468.44
113.28
+0 B
+0 B
WebGPU 628.39
170.1
628.43
170.1
+37 B
+2 B
WebGPU Nodes 583.24
159.44
583.28
159.44
+37 B
+2 B

@Mugen87 Mugen87 added this to the r177 milestone May 29, 2025
@Mugen87 Mugen87 changed the title fix: check if OffscreenCanvas in window before accessing WebGPURenderer: Check if OffscreenCanvas is in window before accessing. May 29, 2025
@Mugen87 Mugen87 merged commit 8146d0a into mrdoob:dev May 29, 2025
12 checks passed
@Mugen87 Mugen87 changed the title WebGPURenderer: Check if OffscreenCanvas is in window before accessing. WebGPURenderer: Check if OffscreenCanvas is in window before accessing. May 29, 2025
RuthySheffi pushed a commit to RuthySheffi/three.js that referenced this pull request Jun 5, 2025
RuthySheffi pushed a commit to RuthySheffi/three.js that referenced this pull request Jun 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants