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

ShaderNode: Remove .isArrayInput #29205

Merged
merged 3 commits into from
Aug 22, 2024
Merged

ShaderNode: Remove .isArrayInput #29205

merged 3 commits into from
Aug 22, 2024

Conversation

wcandillon
Copy link
Contributor

@wcandillon wcandillon commented Aug 22, 2024

Related issue: #27426

Description

We are running three.js on a JS engine (Hermes) wherefn.toString() does not return the source code of the function.
You can see a demo here: https://x.com/wcandillon/status/1825862686300672124
This is an alternative implementation of inputs that would fit.

I do have some question:

  • I suspect that somewhere else in the code, inputs is checked with Array.isArray which will always return false (but it will not break the code). So there is probably more cleaning up that could be done here (I'm just not sure where).
  • Running the build step adds formatting changes that seem unrelated to this change.
  • The build files seem to contain unrelated changes as well.

Let me know what you think ☺️

Copy link

github-actions bot commented Aug 22, 2024

📦 Bundle size

Full ESM build, minified and gzipped.

Filesize dev Filesize PR Diff
685.4 kB (169.7 kB) 685.4 kB (169.7 kB) +0 B

🌳 Bundle size after tree-shaking

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

Filesize dev Filesize PR Diff
462 kB (111.4 kB) 462 kB (111.4 kB) +0 B

This reverts commit 49106b5.
@sunag sunag added this to the r168 milestone Aug 22, 2024
@sunag sunag changed the title Remove isArrayInput ShaderNode: Remove .isArrayInput Aug 22, 2024
@wcandillon
Copy link
Contributor Author

@sunag thank you for looking into it ☺️ This is my first PR in three.js

@sunag sunag merged commit 91c5b8d into mrdoob:dev Aug 22, 2024
12 checks passed
@sunag
Copy link
Collaborator

sunag commented Aug 22, 2024

Thanks @wcandillon, this approach is much better. I hope this PR is the first of many PRs :)

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