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

Nodes: Introduce static type #29282

Merged
merged 4 commits into from
Sep 1, 2024
Merged

Nodes: Introduce static type #29282

merged 4 commits into from
Sep 1, 2024

Conversation

sunag
Copy link
Collaborator

@sunag sunag commented Sep 1, 2024

Related issue: #29187, #29250

Description

Introduce static type for Nodes.

  • Added static type in Node and NodeMaterial
  • Removed registerNode() from Node
  • Removed registerNodeMaterial() from NodeMaterial
  • NodeLoader, NodeObjectLoader and NodeMaterialLoader -- added .setNodes(), setNodeMaterials()
  • Added instance method createMaterialFromType() in MaterialLoader

Making progress in tree shaking 🌳

image

@sunag sunag added this to the r169 milestone Sep 1, 2024
Copy link

github-actions bot commented Sep 1, 2024

📦 Bundle size

Full ESM build, minified and gzipped.

Before After Diff
WebGL 685.4 kB
169.7 kB
685.4 kB
169.7 kB
+64 B
+8 B
WebGPU 819.3 kB
221.5 kB
821.4 kB
220.7 kB
+2.11 kB
-800 B
WebGPU Nodes 818.8 kB
221.4 kB
821 kB
220.6 kB
+2.53 kB
-698 B

🌳 Bundle size after tree-shaking

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

Before After Diff
WebGL 462 kB
111.4 kB
462 kB
111.4 kB
+0 B
+0 B
WebGPU 565.4 kB
153.5 kB
522.1 kB
140.7 kB
-43.29 kB
-12.87 kB
WebGPU Nodes 524.7 kB
143.9 kB
478.8 kB
130.5 kB
-86.64 kB
-13.41 kB

@sunag sunag marked this pull request as ready for review September 1, 2024 15:40
@sunag sunag merged commit 184a7d6 into mrdoob:dev Sep 1, 2024
12 checks passed
@sunag sunag deleted the dev-tree-shaking-1 branch September 1, 2024 15:51
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