Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vector: Replace MathUtils.clamp() with clamp() #29929

Merged
merged 2 commits into from
Nov 20, 2024
Merged

Vector: Replace MathUtils.clamp() with clamp() #29929

merged 2 commits into from
Nov 20, 2024

Conversation

mrdoob
Copy link
Owner

@mrdoob mrdoob commented Nov 20, 2024

Related issue: #29812

@mrdoob mrdoob added this to the r171 milestone Nov 20, 2024
Copy link

github-actions bot commented Nov 20, 2024

📦 Bundle size

Full ESM build, minified and gzipped.

Before After Diff
WebGL 339.13
79
339.13
79
+0 B
+0 B
WebGPU 478.72
132.72
478.72
132.72
+0 B
+0 B
WebGPU Nodes 478.18
132.6
478.18
132.6
+0 B
+0 B

🌳 Bundle size after tree-shaking

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

Before After Diff
WebGL 464.59
111.96
464.59
111.96
+0 B
+0 B
WebGPU 546.88
148.18
546.88
148.18
+0 B
+0 B
WebGPU Nodes 502.76
137.89
502.76
137.89
+0 B
+0 B

@mrdoob mrdoob merged commit 84873b3 into dev Nov 20, 2024
12 checks passed
@linbingquan
Copy link
Contributor

I have previously tested that using the MathUtils.* namespace in the three.js project has no effect on the tree shake.

Consistent with the robot report. Kind of counter-intuitive.

But referencing three.js in other projects, the MathUtils.* namespace has an effect on tree shaking.

@mrdoob mrdoob deleted the cleanup branch November 20, 2024 06:59
@mrdoob
Copy link
Owner Author

mrdoob commented Nov 20, 2024

Minifiers seem to be smart these days.

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