Repository navigation
chore: Remove dead code - #3087
Conversation
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
No unresolved review issues were identified.
Review effort: Lite
Findings: None
What changed in this PR
Removes dead code and unused types, helpers, modules, and parameters across TypeGPU packages.
Changes:
- Deletes unused utilities, type aliases, guards, and interfaces.
- Removes the obsolete React hook and task queue.
- Simplifies radiance-cascade and Three.js-related data.
| File | Description |
|---|---|
packages/unplugin-typegpu/src/core/filter.ts |
Removes unused filter type |
packages/typegpu/src/types.ts |
Removes unused buffer usage type |
packages/typegpu/src/tgsl/generationHelpers.ts |
Removes unused helper |
packages/typegpu/src/taskQueue.ts |
Deletes unused task queue |
packages/typegpu/src/shared/utilityTypes.ts |
Removes unused utility type |
packages/typegpu/src/extension.ts |
Removes unused extension types |
packages/typegpu/src/data/wgslTypes.ts |
Removes unused vector types and guards |
packages/typegpu/src/data/dataTypes.ts |
Removes deprecated unused alias |
packages/typegpu/src/core/vertexLayout/vertexAttribute.ts |
Removes unused attribute type |
packages/typegpu/src/core/texture/texture.ts |
Removes unused texel type |
packages/typegpu/src/core/texture/externalTexture.ts |
Removes unused guard |
packages/typegpu/src/core/pipeline/typeGuards.ts |
Removes unused render-pass guard |
packages/typegpu/src/core/function/tgpuComputeFn.ts |
Removes unused options interface |
packages/typegpu/src/core/function/comptime.ts |
Removes unused comptime guard |
packages/typegpu-three/src/typegpu-node.ts |
Removes unused setup-stage data |
packages/typegpu-react/src/core/use-render.ts |
Deletes obsolete hook |
packages/typegpu-radiance-cascades/src/runner.ts |
Stops initializing unused cascade dimensions |
packages/typegpu-radiance-cascades/src/cascades.ts |
Removes unused struct field |
packages/typegpu-geometry/src/utils.ts |
Removes unused midpoint function |
packages/typegpu-cli/src/utils/types.ts |
Removes unused inferred types |
packages/typegpu-cli/src/utils/pm.ts |
Removes unused package-manager runner |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes — the full diff of commit 40a413861 (21 files, +4 / −240), a purely dead-code removal matching the checklist in #3069.
- Whole-file deletions —
packages/typegpu/src/taskQueue.ts(TaskQueue) andpackages/typegpu-react/src/core/use-render.ts(useRender/UseRenderOptions); neither is referenced by a barrel or export map. - Unused exports removed — among others
pmRun,AppJson/TsConfig,midPoint,SetupStageData/getSetupStageData,isComptimeFn,ComputeFnOptions,isTgpuRenderPass,isExternalTexture,TexelData,AnyUnstruct,isVecBoolInstance,isConcrete,NotAllowed/ExtensionGuard,OmitPropsExact,concretizeSnippets,BufferUsage,TransformHookFilter. CascadeStaticParams.cascadeDimdropped — removed from the schema and itsrunner.tsinitializer; onlybaseProbesandcascadeCountare read by shaders.
I verified every removed identifier has zero remaining references across the repo (including sibling consumers typegpu-gl, tgpu-gen, and apps/typegpu-docs), and that none were surfaced on the public API (data/index.ts lists the d namespace types explicitly, with no export * of wgslTypes.ts/dataTypes.ts). test:types passes for typegpu, typegpu-three, typegpu-react, typegpu-radiance-cascades, typegpu-geometry, typegpu-cli, and unplugin-typegpu. No release-note artifact is expected here since the repo has no changeset tooling.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
|
pkg.pr.new packages benchmark commit |
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.53, 1.05, 2.41, 4.16, 4.63, 6.64, 14.02, 15.80]
line [0.56, 1.12, 2.48, 4.05, 5.10, 6.87, 13.05, 16.03]
line [0.74, 1.47, 3.22, 4.84, 5.57, 9.16, 19.09, 18.52]
---
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.16, 0.31, 0.41, 0.50, 0.61, 0.63, 0.82, 0.87]
line [0.14, 0.27, 0.39, 0.49, 0.64, 0.66, 0.79, 0.88]
line [0.25, 0.38, 0.54, 0.62, 0.84, 0.89, 1.07, 1.23]
---
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.60, 1.46, 2.31, 4.97, 8.22, 15.70, 33.72, 69.84]
line [0.60, 1.40, 2.55, 3.91, 7.53, 15.15, 32.41, 67.30]
line [0.74, 1.67, 2.81, 5.34, 9.34, 20.23, 42.98, 86.37]
|
Bundle size comparison (
|
| 🟢 Decreased | ➖ Unchanged | 🔴 Increased | ❔ Unknown |
|---|---|---|---|
| 0 | 356 | 0 | 0 |
No notable changes.
If you wish to run a comparison for other, slower bundlers, run the 'Tree-shake test' from the GitHub Actions menu.
aleksanderkatan
left a comment
There was a problem hiding this comment.
We already export some of our type guards, like isTgpuFn, isComputePipeline, isQuerySet, isVariable, isVertexLayout, isImmediateVar..., I think that type guards removed in this PR could be exported instead
There was a problem hiding this comment.
ℹ️ No critical issues — one follow-up worth confirming.
Reviewed changes — the incremental delta since the prior pullfrog review (c728ba8ac..1ebf4e597, +14 / −1 across 3 files): commit 1ebf4e597 restored the three type guards deleted by the initial commit, after review feedback asked for them to be exported rather than removed.
- Restored
isComptimeFninpackages/typegpu/src/core/function/comptime.ts. - Restored
isTgpuRenderPassand itsTgpuRenderPassimport inpackages/typegpu/src/core/pipeline/typeGuards.ts. - Restored
isExternalTextureinpackages/typegpu/src/core/texture/externalTexture.ts.
ℹ️ Restored guards still aren't reachable from the package entry point
The three restored guards are declared with export inside their own modules, but none of them was added to packages/typegpu/src/indexNamedExports.ts, and a whole-repo grep finds no other references to any of them. From the public typegpu API they remain unreachable and unused — i.e. still dead code, which is what the review feedback asked to avoid by exporting them instead of deleting them. This may be an intentional deferral to a follow-up; flagging so it isn't lost.
Technical details
# Restored type guards are not wired into the public barrel
## Affected sites
- `packages/typegpu/src/core/function/comptime.ts:15` — `isComptimeFn` defined, zero references.
- `packages/typegpu/src/core/pipeline/typeGuards.ts:27` — `isTgpuRenderPass` defined, zero references.
- `packages/typegpu/src/core/texture/externalTexture.ts:19` — `isExternalTexture` defined, zero references.
- `packages/typegpu/src/indexNamedExports.ts:34-42` — the only named type-guard exports on the public barrel (`isTgpuFn`, `isComputePipeline`, `isPipeline`, …); the three restored guards are absent. `index.d.ts` re-exports this barrel via `export *`.
## Required outcome
- Add the three guards to `indexNamedExports.ts` to match the review request, or confirm the public export is deliberately deferred so that restoring the functions isn't reintroducing dead code under this PR.
## Open questions for the human
- Is exposing these guards part of this PR, or tracked as a separate follow-up?DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
|
@vende11s Is there (going to be) another PR that exposes the unremoved type guards through the public API? |
There was a problem hiding this comment.
I wouldn't delete this file. It is linked to the issue.
There was a problem hiding this comment.
#3087 (comment)
we disscussed it earlier with @aleksanderkatan, but let me know what do you think

closes #3069