Repository navigation
Add default for UniformNode's TValue type parameter - #2528
Merged
Merged
Conversation
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]>
2 of 9 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
UniformNode's second type parameter (TValue) now defaults to the value type that matchesTNodeType, using the existingUniformValuemap (for example"float"→number,"vec3"→Vector3,"color"→Color). Node types that aren't in the map fall back tounknown. The same default is on the constructor signature, soextends UniformNode<"float">works.All usages that matched the default now omit the second type argument (
UniformNode<"float", number>→UniformNode<"float">). This coverstypes/three,tsl-testingandexamples-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-checkandpnpm run format-checkpasstsl-testingtype-check passesexamples-testing: generated the examples, applied the updated patch and ran the type-check; it passespnpm 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