Skip to content

Nodes: Use named MathUtils imports. - #34625

Merged
mrdoob merged 1 commit into
devfrom
fix-node-mathutils-imports
Sep 21, 2026
Merged

mrdoob merged 1 commit into
devfrom
fix-node-mathutils-imports

Conversation

@mrdoob

@mrdoob mrdoob commented Sep 21, 2026

Copy link
Copy Markdown
Owner

Calls through the MathUtils object keep unrelated utilities in Rollup bundles. Import generateUUID and lerp directly in Node and RangeNode, matching other core modules.

Saves 1,672 bytes minified (586 bytes gzipped) in a built-package WebGPURenderer consumer.

These calls no longer follow overrides on the MathUtils object.

@github-actions

Copy link
Copy Markdown

πŸ“¦ Bundle size

Full ESM build, minified and gzipped.

Before After Diff
Core 389.51
102.21
389.59
102.22
+79 B
+2 B
WebGL 372.82
87.28
372.82
87.28
+0 B
+0 B
WebGPU 424.46
114.27
424.46
114.27
+0 B
+0 B
WebGPU Nodes 710.24
195.09
710.24
195.1
-8 B
+14 B

🌳 Bundle size after tree-shaking

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

Before After Diff
WebGL 517.59
124.49
517.64
124.47
+49 B
-24 B
WebGPU 765.26
205
763.64
204.36
-1.62 kB
-644 B
WebGPU Nodes 711.26
191.55
709.64
190.93
-1.62 kB
-619 B

@mrdoob mrdoob added this to the r187 milestone Sep 21, 2026
@mrdoob
mrdoob merged commit 6897197 into dev Sep 21, 2026
10 checks passed
@mrdoob
mrdoob deleted the fix-node-mathutils-imports branch September 21, 2026 04:16
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.

1 participant