Conversation
|
pkg.pr.new packages benchmark commit |
There was a problem hiding this comment.
Pull Request Overview
This PR introduces a new, more ergonomic API for tgpu.resolve() that accepts an array of resolvable objects directly, alongside a deprecation warning for the existing template-based API when called without a template. The goal is to simplify the most common use case of resolving TypeGPU resources.
Key changes:
- Added
tgpu.resolve([items], options?)overload for simpler resolution without templates - Deprecated calling
tgpu.resolve({ externals, template: '' })with an empty template - Updated all tests, examples, and documentation to use the new API
Reviewed Changes
Copilot reviewed 26 out of 26 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
packages/typegpu/src/core/resolve/tgpuResolve.ts |
Implements new array-based resolution API with function overloads and backwards-compatible support |
packages/typegpu/src/types.ts |
Adds function type to ResolvableObject union |
packages/typegpu/tests/utils/parseResolved.ts |
Updates asWgsl helper to use new array-based API |
packages/typegpu/tests/*.test.ts |
Migrates test files to use new array-based resolution API |
apps/typegpu-docs/src/content/docs/fundamentals/resolve.mdx |
Restructures documentation to showcase array-based API first, with template-based API as secondary option |
README.md and other examples |
Updates code examples to demonstrate new API |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull Request Overview
Copilot reviewed 26 out of 26 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Iwo Plaza <[email protected]>
Co-authored-by: Iwo Plaza <[email protected]>
Changes:
tgpu.resolve([item_1, ..., item_n], options)),tgpu.resolvewith an empty template,tgpu.resolvecalls to the new api orasWgsl,We decided that in future we want to not call
ctx.resolvefor unused externals, and to move from 'strict' to 'random' naming scheme.