Skip to content

Add default for UniformNode's TValue type parameter - #2528

Merged
Methuselah96 merged 2 commits into
masterfrom
uniform-node-default-value
Oct 20, 2026
Merged

Methuselah96 merged 2 commits into
masterfrom
uniform-node-default-value

Conversation

@Methuselah96

Copy link
Copy Markdown
Contributor

UniformNode's second type parameter (TValue) now defaults to the value type that matches TNodeType, using the existing UniformValue map (for example "float" → number, "vec3" → Vector3, "color" → Color). Node types that aren't in the map fall back to unknown. The same default is on the constructor signature, so extends UniformNode<"float"> works.

All usages that matched the default now omit the second type argument (UniformNode<"float", number> → UniformNode<"float">). This covers types/three, tsl-testing and examples-testing/changes.patch. Imports that were only used for those arguments are removed.

Usages whose value type differs from the default are unchanged. These include SkyMesh.showSunDisc (number | boolean), TextureNode (Texture) and the generic passthroughs.

Testing

  • pnpm run type-check and pnpm run format-check pass
  • tsl-testing type-check passes
  • examples-testing: generated the examples, applied the updated patch and ran the type-check; it passes
  • pnpm run lint (dtslint) crashed locally before checking anything, apparently because it doesn't work with TypeScript 7, so it was not run

🤖 Generated with Claude Code

Methuselah96 and others added 2 commits October 20, 2026 18:19
Default TValue to the value type matching TNodeType (e.g. "float" -> number,
"vec3" -> Vector3) and drop the now-redundant second type argument from
usages, including in tsl-testing and examples-testing.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Apply the UniformNode changes to the jsdoc-testing patch so the generated
declarations match, and reformat the examples that now fit on one line.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@Methuselah96
Methuselah96 merged commit 87185c3 into master Oct 20, 2026
6 checks passed
@Methuselah96
Methuselah96 deleted the uniform-node-default-value branch October 20, 2026 22:26
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