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

deps: Bump Three.js to r171 #1548

Draft
wants to merge 2 commits into
base: dev
Choose a base branch
from
Draft

deps: Bump Three.js to r171 #1548

wants to merge 2 commits into from

Conversation

0b5vr
Copy link
Contributor

@0b5vr 0b5vr commented Dec 4, 2024

This PR bumps Three.js to r171.

I'm yet to neither check the behavior nor see the changelog
The entrypoint change mrdoob/three.js#29404 might be relevant to us

https://github.com/mrdoob/three.js/releases/tag/r171

@0b5vr 0b5vr self-assigned this Dec 4, 2024
I'm yet to neither check the behavior nor see the changelog
The entrypoint change mrdoob/three.js#29404 might be relevant to us

https://github.com/mrdoob/three.js/releases/tag/r171
@0b5vr
Copy link
Contributor Author

0b5vr commented Dec 5, 2024

mrdoob/three.js#29644 moves the entrypoint of TSL related functions from three.webgpu.js to three.tsl.js.

r171

In r171, the user have to add a line to importmap that resolves three/tsl.

  <script type="importmap">
  	{
  		"imports": {
  			"three": "https://cdn.jsdelivr.net/npm/[email protected]/build/three.webgpu.js",
  			"three/webgpu": "https://cdn.jsdelivr.net/npm/[email protected]/build/three.webgpu.js",
+ 			"three/tsl": "https://cdn.jsdelivr.net/npm/[email protected]/build/three.tsl.js",
  			"three/addons/": "https://cdn.jsdelivr.net/npm/[email protected]/examples/jsm/",
  			...
  		}
  	}
  </script>

With a bundler, I believe the user don't have to make any changes to the app code base.

pre-r171

Same as r171, the user have to resolve the three/tsl but it would be directed into three.webgpu.js.

  <script type="importmap">
  	{
  		"imports": {
  			"three": "https://cdn.jsdelivr.net/npm/[email protected]/build/three.webgpu.js",
  			"three/webgpu": "https://cdn.jsdelivr.net/npm/[email protected]/build/three.webgpu.js",
+ 			"three/tsl": "https://cdn.jsdelivr.net/npm/[email protected]/build/three.webgpu.js",
  			"three/addons/": "https://cdn.jsdelivr.net/npm/[email protected]/examples/jsm/",
  			...
  		}
  	}
  </script>

With a bundler, the user must resolve three/tsl in an according way.

If the user is using Vite, it can be achieved by using resolve.alias:

export default defineConfig({
  resolve: {
    alias: {
      'three/tsl': 'three/webgpu',
    },
  },
  // ...
})

mrdoob/three.js#29644 moves TSL functions into `three/tsl`

The users have to modify the import map or bundler config because of this change
See: #1548 (comment)
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