Skip to content

chore: Remove .value API#2694

Merged
aleksanderkatan merged 39 commits into
mainfrom
chore/remove-the-deprecated-value-api-on-resources
Jul 13, 2026
Merged

chore: Remove .value API#2694
aleksanderkatan merged 39 commits into
mainfrom
chore/remove-the-deprecated-value-api-on-resources

Conversation

@aleksanderkatan

Copy link
Copy Markdown
Contributor

No description provided.

@github-actions

github-actions Bot commented Jul 7, 2026

Copy link
Copy Markdown

pkg.pr.new

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

https://pkg.pr.new/software-mansion/TypeGPU/tgpu-gen@e491dbb9af33dd37f067859b51a5019ab23ceedd
https://pkg.pr.new/software-mansion/TypeGPU/tinyest-for-wgsl@e491dbb9af33dd37f067859b51a5019ab23ceedd
https://pkg.pr.new/software-mansion/TypeGPU/typegpu@e491dbb9af33dd37f067859b51a5019ab23ceedd
https://pkg.pr.new/software-mansion/TypeGPU/@typegpu/cli@e491dbb9af33dd37f067859b51a5019ab23ceedd
https://pkg.pr.new/software-mansion/TypeGPU/@typegpu/color@e491dbb9af33dd37f067859b51a5019ab23ceedd
https://pkg.pr.new/software-mansion/TypeGPU/@typegpu/gl@e491dbb9af33dd37f067859b51a5019ab23ceedd
https://pkg.pr.new/software-mansion/TypeGPU/@typegpu/noise@e491dbb9af33dd37f067859b51a5019ab23ceedd
https://pkg.pr.new/software-mansion/TypeGPU/@typegpu/radiance-cascades@e491dbb9af33dd37f067859b51a5019ab23ceedd
https://pkg.pr.new/software-mansion/TypeGPU/@typegpu/react@e491dbb9af33dd37f067859b51a5019ab23ceedd
https://pkg.pr.new/software-mansion/TypeGPU/@typegpu/sdf@e491dbb9af33dd37f067859b51a5019ab23ceedd
https://pkg.pr.new/software-mansion/TypeGPU/@typegpu/three@e491dbb9af33dd37f067859b51a5019ab23ceedd
https://pkg.pr.new/software-mansion/TypeGPU/unplugin-typegpu@e491dbb9af33dd37f067859b51a5019ab23ceedd

benchmark
view benchmark

commit
view commit

@github-actions

github-actions Bot commented Jul 7, 2026

Copy link
Copy Markdown

Bundle size comparison (import * as ... in PR vs import * as ... in target):

🟢 Decreased (max -0.12%) ➖ Unchanged 🔴 Increased ❔ Unknown
23 298 0 0

import { ... } in PR vs import * as ... in PR (is the library tree-Shakeable?):

Test tsdown
tgpu_init.ts 255.87 kB ($${\color{green}-3.2\%}$$)
tgpu_initFromDevice.ts 255.36 kB ($${\color{green}-3.4\%}$$)
tgpu_resolve.ts 161.33 kB ($${\color{green}-38.9\%}$$)
tgpu_resolveWithContext.ts 161.27 kB ($${\color{green}-39.0\%}$$)
tgpu_bindGroupLayout.ts 68.92 kB ($${\color{green}-73.9\%}$$)
tgpu_mutableAccessor.ts 65.94 kB ($${\color{green}-75.0\%}$$)
tgpu_accessor.ts 65.93 kB ($${\color{green}-75.1\%}$$)
tgpu_privateVar.ts 65.27 kB ($${\color{green}-75.3\%}$$)
tgpu_workgroupVar.ts 65.27 kB ($${\color{green}-75.3\%}$$)
tgpu_const.ts 64.52 kB ($${\color{green}-75.6\%}$$)
tgpu_fn.ts 37.99 kB ($${\color{green}-85.6\%}$$)
tgpu_fragmentFn.ts 37.89 kB ($${\color{green}-85.7\%}$$)
tgpu_vertexFn.ts 37.71 kB ($${\color{green}-85.7\%}$$)
tgpu_computeFn.ts 37.41 kB ($${\color{green}-85.8\%}$$)
tgpu_vertexLayout.ts 26.63 kB ($${\color{green}-89.9\%}$$)
tgpu_comptime.ts 14.43 kB ($${\color{green}-94.5\%}$$)
tgpu_unroll.ts 2.60 kB ($${\color{green}-99.0\%}$$)
tgpu_slot.ts 1.54 kB ($${\color{green}-99.4\%}$$)
tgpu_lazy.ts 1.19 kB ($${\color{green}-99.5\%}$$)

If you wish to run a comparison for other, slower bundlers, run the 'Tree-shake test' from the GitHub Actions menu.

@github-actions

github-actions Bot commented Jul 7, 2026

Copy link
Copy Markdown

Resolution Time Benchmark

---
config:
  themeVariables:
    xyChart:
      plotColorPalette: "#E63946, #3B82F6, #059669"
---
xychart
  title "Random Branching (🔴 PR | 🔵 main | 🟢 release)"
  x-axis "max depth" [1, 2, 3, 4, 5, 6, 7, 8]
  y-axis "time (ms)"
  line [0.64, 1.34, 2.87, 4.97, 5.46, 8.27, 17.03, 19.24]
  line [0.71, 1.51, 3.10, 5.07, 5.48, 8.77, 15.44, 19.49]
  line [0.73, 1.55, 3.19, 4.47, 5.17, 8.81, 17.15, 18.96]
Loading
---
config:
  themeVariables:
    xyChart:
      plotColorPalette: "#E63946, #3B82F6, #059669"
---
xychart
  title "Linear Recursion (🔴 PR | 🔵 main | 🟢 release)"
  x-axis "max depth" [1, 2, 3, 4, 5, 6, 7, 8]
  y-axis "time (ms)"
  line [0.23, 0.41, 0.52, 0.65, 0.91, 0.92, 1.09, 1.17]
  line [0.20, 0.47, 0.57, 0.63, 0.88, 0.88, 1.14, 1.15]
  line [0.24, 0.42, 0.53, 0.68, 0.97, 0.94, 1.11, 1.22]
Loading
---
config:
  themeVariables:
    xyChart:
      plotColorPalette: "#E63946, #3B82F6, #059669"
---
xychart
  title "Full Tree (🔴 PR | 🔵 main | 🟢 release)"
  x-axis "max depth" [1, 2, 3, 4, 5, 6, 7, 8]
  y-axis "time (ms)"
  line [0.70, 1.85, 3.31, 4.99, 9.39, 20.37, 41.66, 85.64]
  line [0.84, 1.70, 3.57, 5.35, 9.11, 18.77, 39.84, 82.66]
  line [0.68, 1.74, 3.51, 4.89, 9.94, 20.14, 41.63, 86.08]
Loading

@aleksanderkatan

Copy link
Copy Markdown
Contributor Author

@pullfrog review

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Important

The removal is incomplete for TgpuVar — its public interface still declares the deprecated .value property, and the implementation keeps a write-only .value setter after the getter was removed.

Reviewed changes — removal of the deprecated .value accessor from TypeGPU resource types (buffers, constants, raw code snippets, samplers, slots/accessors/lazy, textures, variables, bind group layouts).

  • Removed .value getter and interface declaration from TgpuMutable, TgpuReadonly, TgpuUniform, and the shared TgpuBufferShorthandImpl.
  • Removed .value from TgpuConst, TgpuRawCodeSnippet, sampler implementations, TgpuSlot/TgpuLazy/TgpuAccessor, TgpuMutableAccessor, texture views, external textures, and TgpuBindGroupLayout.
  • Replaced internal bind-group-layout this.value population with direct this.$ population.

⚠️ TgpuVar still exposes .value and has a write-only runtime accessor

packages/typegpu/src/core/variable/tgpuVariable.ts removes the value getter from TgpuVarImpl but leaves both the public TgpuVar.value declaration and a set value(...) implementation. That means const x = myVar.value type-checks (and the interface still marks it as deprecated) but at runtime returns undefined. The setter also continues to accept deprecated .value writes.

To complete the removal, drop value from the TgpuVar interface and remove the set value accessor.

Pullfrog  | Fix all ➔Fix 👍s ➔View workflow run | Using Kimi K2 (free via Pullfrog for OSS) | 𝕏

Comment thread packages/typegpu/src/core/variable/tgpuVariable.ts Outdated
Base automatically changed from impr-unify-shorthand-and-as to main July 13, 2026 09:59
@aleksanderkatan aleksanderkatan linked an issue Jul 13, 2026 that may be closed by this pull request
@aleksanderkatan aleksanderkatan marked this pull request as ready for review July 13, 2026 10:09
Copilot AI review requested due to automatic review settings July 13, 2026 10:09

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

✅ No new issues found.

Reviewed changes — remove the deprecated .value getter/setter from TypeGPU resource interfaces in favor of .$.

  • TgpuMutable / TgpuReadonly / TgpuUniform buffer shorthands lose .value.
  • TgpuConst loses .value.
  • TgpuRawCodeSnippet loses .value.
  • TgpuSampler / TgpuComparisonSampler lose .value.
  • TgpuSlot / TgpuLazy / TgpuAccessor / TgpuMutableAccessor lose .value.
  • TgpuExternalTexture / TgpuTextureView lose .value.
  • TgpuVar loses .value.
  • TgpuBindGroupLayout loses .value; internal layout-entry accessors now attach directly to .$.

I verified the change by running pnpm --filter typegpu test:types (passes) and pnpm vitest run --project=!browser packages/typegpu/tests/ (passes). No remaining .value references were found in docs, tests, or source for these resource types.

Pullfrog  | View workflow run | Using Kimi K2 (free via Pullfrog for OSS) | 𝕏

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

✅ No new issues found.

Reviewed changes — merge of main commit 15f31f05 into the PR branch and re-verification that the .value removal is complete.

  • Merged main fix for struct-cast side-effects (#2687):
    • packages/typegpu/src/tgsl/conversion.ts now rejects struct-to-struct casts when the source has possible side-effects, replacing the previous alias-based check.
    • packages/typegpu/tests/struct.test.ts was updated to exercise the guard with explicit side-effecting expressions.
  • Confirmed TgpuVar no longer exposes .value — previous Pullfrog feedback is fully addressed.
  • No .value property references were reintroduced in the merged content.
  • pnpm --filter typegpu test:types and the struct test suite pass.

Pullfrog  | View workflow run | Using Kimi K2 (free via Pullfrog for OSS) | 𝕏

@aleksanderkatan aleksanderkatan merged commit 5727ca8 into main Jul 13, 2026
8 checks passed
@aleksanderkatan aleksanderkatan deleted the chore/remove-the-deprecated-value-api-on-resources branch July 13, 2026 12:24
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.

chore: Remove the deprecated .value API on resources

3 participants