fix(@typegpu/cli): Production builds - #2908
Conversation
|
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.86, 1.75, 3.52, 5.27, 6.51, 11.11, 21.55, 20.65]
line [0.85, 1.71, 3.67, 5.86, 7.01, 10.38, 20.92, 23.64]
line [0.86, 1.75, 3.29, 5.33, 6.26, 9.86, 20.62, 22.29]
---
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.33, 0.49, 0.67, 0.79, 1.07, 1.01, 1.24, 1.35]
line [0.34, 0.50, 0.69, 0.80, 1.06, 1.09, 1.31, 1.37]
line [0.33, 0.50, 0.64, 0.76, 0.98, 1.05, 1.19, 1.39]
---
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.86, 1.91, 2.91, 6.27, 10.98, 23.21, 49.75, 98.99]
line [0.81, 1.95, 3.00, 6.23, 10.90, 22.50, 49.54, 101.90]
line [0.87, 1.78, 3.51, 6.39, 10.92, 22.95, 50.23, 99.46]
|
Bundle size comparison (
|
| 🟢 Decreased | ➖ Unchanged | 🔴 Increased | ❔ Unknown |
|---|---|---|---|
| 0 | 325 | 0 | 0 |
import { ... } in PR vs import * as ... in PR (is the library tree-Shakeable?):
| Test | tsdown |
|---|---|
| tgpu_init.ts | 263.10 kB ( |
| tgpu_initFromDevice.ts | 262.56 kB ( |
| tgpu_resolve.ts | 161.75 kB ( |
| tgpu_resolveWithContext.ts | 161.68 kB ( |
| tgpu_bindGroupLayout.ts | 62.32 kB ( |
| tgpu_mutableAccessor.ts | 57.04 kB ( |
| tgpu_accessor.ts | 57.04 kB ( |
| tgpu_privateVar.ts | 55.73 kB ( |
| tgpu_workgroupVar.ts | 55.73 kB ( |
| tgpu_const.ts | 55.15 kB ( |
| tgpu_lazy.ts | 54.95 kB ( |
| tgpu_fragmentFn.ts | 39.68 kB ( |
| tgpu_fn.ts | 39.62 kB ( |
| tgpu_vertexFn.ts | 39.50 kB ( |
| tgpu_computeFn.ts | 39.20 kB ( |
| tgpu_vertexLayout.ts | 28.33 kB ( |
| tgpu_comptime.ts | 15.93 kB ( |
| tgpu_unroll.ts | 1.75 kB ( |
| tgpu_slot.ts | 1.70 kB ( |
If you wish to run a comparison for other, slower bundlers, run the 'Tree-shake test' from the GitHub Actions menu.
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
- Waku template
_package.json—waku startnow binds the production server to--host localhostinstead of the previous0.0.0.0default. This keeps the app on a loopback address, which browsers treat as a secure (potentially-trustworthy) origin, so WebGPU remains enabled in production. - Next.js template
next.config.ts— removesoutput: 'export', which was incompatible with the template'sstart: "next start"production script (static-export mode has no server runtime).distDir: './dist'is retained.
I verified the waku start --host flag against the waku source (packages/waku/src/cli.ts defines -h, --host and forwards it to runStart), so the new script is well-formed. Both changes are minimal, correctly scoped (no other template carries these patterns), and directly address the reported production-build breakage. One note, not an action: binding to localhost means the production server is only reachable on the host — LAN/device access would need a reverse proxy — but that is consistent with WebGPU requiring a loopback origin anyway.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
| "dev": "waku dev", | ||
| "build": "waku build", | ||
| "start": "waku start", | ||
| "start": "waku start --host localhost", |
There was a problem hiding this comment.
I assume that running the production server usually means you're not running it on your own machine. What motivated this change?
There was a problem hiding this comment.
Without --host localhost, Waku prints 0.0.0.0:8080 address to the console which is not considered secure. As a result, WebGPU is disabled.

Fixes:
waku:0.0.0.0isn't considered secure, sowebgpuis disabled. Changed the production host tolocalhostnextjs:output: 'export'is incompatible withnext start