-
-
Notifications
You must be signed in to change notification settings - Fork 35.3k
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
Codesplit WebGL/WebGPU entrypoints #29404
base: dev
Are you sure you want to change the base?
Codesplit WebGL/WebGPU entrypoints #29404
Conversation
📦 Bundle sizeFull ESM build, minified and gzipped.
🌳 Bundle size after tree-shakingMinimal build including a renderer, camera, empty scene, and dependencies.
|
test/rollup.treeshake.config.js
Outdated
input: 'test/treeshake/index.webgpu.nodes.js', | ||
input: 'test/treeshake/index.webgpu.js', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Undid this change, but three.webgpu.nodes.js
is unused, and duplicate with WebGPU (missing only the recent BundleGroup
export). CI still measures WebGL, WebGPU, WebGPU + Nodes. Maybe it can measure the common core instead?
This reverts commit 418db9b.
Minor thing, but I'm seeing some duplication of build artifacts when running
That aside, I think this looks like a good approach! Shared 'core' that the WebGL and WebGPU entrypoints can use, and that doesn't need to be exposed as a separate public entrypoint to users. |
This reverts commit 880e8bb.
Related issue: #29156
Description
Emits a build where
three/webgpu
re-exports from core to avoid user configuration or duplication. Each entrypoint will no longer bundle a unique copy of three.js but share a single copy.To prevent future issues with tree-shaking (#28670), I've code split the common core and code specific to a backend.