Skip to content

feat: New resolve api#1897

Merged
aleksanderkatan merged 21 commits intomainfrom
feat/new-resolve-api
Nov 14, 2025
Merged

feat: New resolve api#1897
aleksanderkatan merged 21 commits intomainfrom
feat/new-resolve-api

Conversation

@aleksanderkatan
Copy link
Contributor

@aleksanderkatan aleksanderkatan commented Nov 6, 2025

Changes:

  • added new resolve api (tgpu.resolve([item_1, ..., item_n], options)),
  • added a warn when using old tgpu.resolve with an empty template,
  • updated many old tgpu.resolve calls to the new api or asWgsl,
  • updated docs and jsdocs.

We decided that in future we want to not call ctx.resolve for unused externals, and to move from 'strict' to 'random' naming scheme.

@aleksanderkatan aleksanderkatan linked an issue Nov 6, 2025 that may be closed by this pull request
@github-actions
Copy link

github-actions bot commented Nov 6, 2025

pkg.pr.new

packages
Ready to be installed by your favorite package manager ⬇️

https://pkg.pr.new/software-mansion/TypeGPU/typegpu@4c668e4fbbf887703dff81970bc7e56be8931eba
https://pkg.pr.new/software-mansion/TypeGPU/@typegpu/noise@4c668e4fbbf887703dff81970bc7e56be8931eba
https://pkg.pr.new/software-mansion/TypeGPU/unplugin-typegpu@4c668e4fbbf887703dff81970bc7e56be8931eba

benchmark
view benchmark

commit
view commit

Copy link

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 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.

Copy link

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

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.

@aleksanderkatan aleksanderkatan marked this pull request as ready for review November 13, 2025 12:58
@aleksanderkatan aleksanderkatan merged commit c29d569 into main Nov 14, 2025
3 checks passed
@aleksanderkatan aleksanderkatan deleted the feat/new-resolve-api branch November 20, 2025 15:06
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.

feat: New resolve api

3 participants