Skip to content

fix(@typegpu/cli): Production builds - #2908

Open
cieplypolar wants to merge 1 commit into
mainfrom
fix/templates-build
Open

fix(@typegpu/cli): Production builds#2908
cieplypolar wants to merge 1 commit into
mainfrom
fix/templates-build

Conversation

@cieplypolar

Copy link
Copy Markdown
Collaborator

Fixes:

  • waku: 0.0.0.0 isn't considered secure, so webgpu is disabled. Changed the production host to localhost
  • nextjs: output: 'export' is incompatible with next start

Copilot AI lite review requested due to automatic review settings August 24, 2026 09:48

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

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

@github-actions

Copy link
Copy Markdown

pkg.pr.new

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

https://pkg.pr.new/software-mansion/TypeGPU/@typegpu/cli@7b2481ef050b52728fe4d8860b1545d9fffb70f2

benchmark
view benchmark

commit
view commit

@cieplypolar cieplypolar changed the title fix(@typegpu-cli): Production builds fix(@typegpu/cli): Production builds Aug 24, 2026
@github-actions

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

@github-actions

Copy link
Copy Markdown

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

🟢 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 ($${\color{green}-3.5\%}$$)
tgpu_initFromDevice.ts 262.56 kB ($${\color{green}-3.7\%}$$)
tgpu_resolve.ts 161.75 kB ($${\color{green}-40.7\%}$$)
tgpu_resolveWithContext.ts 161.68 kB ($${\color{green}-40.7\%}$$)
tgpu_bindGroupLayout.ts 62.32 kB ($${\color{green}-77.1\%}$$)
tgpu_mutableAccessor.ts 57.04 kB ($${\color{green}-79.1\%}$$)
tgpu_accessor.ts 57.04 kB ($${\color{green}-79.1\%}$$)
tgpu_privateVar.ts 55.73 kB ($${\color{green}-79.6\%}$$)
tgpu_workgroupVar.ts 55.73 kB ($${\color{green}-79.6\%}$$)
tgpu_const.ts 55.15 kB ($${\color{green}-79.8\%}$$)
tgpu_lazy.ts 54.95 kB ($${\color{green}-79.8\%}$$)
tgpu_fragmentFn.ts 39.68 kB ($${\color{green}-85.4\%}$$)
tgpu_fn.ts 39.62 kB ($${\color{green}-85.5\%}$$)
tgpu_vertexFn.ts 39.50 kB ($${\color{green}-85.5\%}$$)
tgpu_computeFn.ts 39.20 kB ($${\color{green}-85.6\%}$$)
tgpu_vertexLayout.ts 28.33 kB ($${\color{green}-89.6\%}$$)
tgpu_comptime.ts 15.93 kB ($${\color{green}-94.2\%}$$)
tgpu_unroll.ts 1.75 kB ($${\color{green}-99.4\%}$$)
tgpu_slot.ts 1.70 kB ($${\color{green}-99.4\%}$$)

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

@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

  • Waku template _package.jsonwaku start now binds the production server to --host localhost instead of the previous 0.0.0.0 default. 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 — removes output: 'export', which was incompatible with the template's start: "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.

Pullfrog  | View workflow run | Using DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

"dev": "waku dev",
"build": "waku build",
"start": "waku start",
"start": "waku start --host localhost",

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I assume that running the production server usually means you're not running it on your own machine. What motivated this change?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

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.

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.

3 participants