Skip to content

Conversation

@querielo
Copy link
Contributor

No description provided.

Copilot AI review requested due to automatic review settings December 12, 2025 17:10
@github-actions
Copy link

github-actions bot commented Dec 12, 2025

📦 Bundle size

Full ESM build, minified and gzipped.

Before After Diff
WebGL 355.12
84.44
355.12
84.44
+0 B
+0 B
WebGPU 616.54
171.12
616.54
171.12
+0 B
-1 B
WebGPU Nodes 615.14
170.85
615.14
170.85
+0 B
-2 B

🌳 Bundle size after tree-shaking

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

Before After Diff
WebGL 487.45
119.37
487.45
119.37
+0 B
+0 B
WebGPU 687.45
186.71
687.45
186.71
+0 B
-2 B
WebGPU Nodes 637.29
173.93
637.29
173.93
+0 B
+1 B

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the node type checking mechanism in TSLCore from using instanceof Node to checking the .isNode property. This change aligns with the pattern used throughout the codebase where .isNode is the preferred method for identifying node objects.

Key Changes:

  • Replaced instanceof Node check with .isNode property check in the getProxyParameters function

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

}

} else if ( params[ 0 ] instanceof Node ) {
} else if ( params[ 0 ].isNode ) {
Copy link

Copilot AI Dec 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The change from instanceof Node to .isNode could cause a runtime error if params[0] is null or undefined. While the code checks params.length > 0 on line 735, this doesn't guarantee that params[0] is not null or undefined. Consider adding a null check similar to line 685 in this file: params[ 0 ] && params[ 0 ].isNode to ensure safe property access.

Suggested change
} else if ( params[ 0 ].isNode ) {
} else if ( params[ 0 ] && params[ 0 ].isNode ) {

Copilot uses AI. Check for mistakes.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think it's safe to make this change without checking for null or undefined. Considering the additional check, it's maybe better to leave the code as it is.

@sunag
Copy link
Collaborator

sunag commented Dec 14, 2025

Closing #32540 (comment)

@sunag sunag closed this Dec 14, 2025
@Mugen87 Mugen87 added this to the r183 milestone Dec 14, 2025
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.

3 participants