impr(@typegpu/cli): Next.js template#2596
Conversation
|
pkg.pr.new packages benchmark commit |
Bundle size comparison (
|
| 🟢 Decreased | ➖ Unchanged | 🔴 Increased | ❔ Unknown |
|---|---|---|---|
| 0 | 321 | 0 | 0 |
import { ... } in PR vs import * as ... in PR (is the library tree-Shakeable?):
| Test | tsdown |
|---|---|
| tgpu_init.ts | 256.14 kB ( |
| tgpu_initFromDevice.ts | 255.63 kB ( |
| tgpu_resolve.ts | 161.62 kB ( |
| tgpu_resolveWithContext.ts | 161.55 kB ( |
| tgpu_bindGroupLayout.ts | 68.88 kB ( |
| tgpu_mutableAccessor.ts | 65.83 kB ( |
| tgpu_accessor.ts | 65.81 kB ( |
| tgpu_privateVar.ts | 65.23 kB ( |
| tgpu_workgroupVar.ts | 65.23 kB ( |
| tgpu_const.ts | 64.48 kB ( |
| tgpu_fn.ts | 38.07 kB ( |
| tgpu_fragmentFn.ts | 37.97 kB ( |
| tgpu_vertexFn.ts | 37.78 kB ( |
| tgpu_computeFn.ts | 37.49 kB ( |
| tgpu_vertexLayout.ts | 26.62 kB ( |
| tgpu_comptime.ts | 14.42 kB ( |
| tgpu_unroll.ts | 2.59 kB ( |
| tgpu_slot.ts | 1.54 kB ( |
| tgpu_lazy.ts | 1.19 kB ( |
If you wish to run a comparison for other, slower bundlers, run the 'Tree-shake test' from the GitHub Actions menu.
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 [1.00, 1.98, 4.42, 6.88, 7.97, 12.14, 22.71, 26.98]
line [0.94, 2.03, 4.34, 6.44, 7.87, 12.01, 22.76, 26.63]
line [0.94, 1.93, 4.19, 7.01, 7.83, 11.16, 23.64, 27.86]
---
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.35, 0.54, 0.74, 0.92, 1.23, 1.30, 1.47, 1.62]
line [0.33, 0.56, 0.74, 0.85, 1.12, 1.24, 1.48, 1.58]
line [0.34, 0.58, 0.79, 0.90, 1.19, 1.33, 1.57, 1.65]
---
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.88, 2.09, 4.43, 7.57, 13.08, 26.29, 57.05, 115.85]
line [0.94, 2.21, 3.73, 7.29, 12.82, 26.50, 58.34, 115.80]
line [1.01, 2.33, 4.16, 6.65, 13.74, 27.55, 59.98, 121.45]
|
e108045 to
1dc6371
Compare
There was a problem hiding this comment.
Important
Two template correctness issues need fixing before this can land: the root page.tsx declares a generateStaticParams() function even though it is not a dynamic route, and SVG imports from public/ are accessed as if they were Next.js StaticImageData objects (they are URL strings at runtime).
Reviewed changes — new nextjs-bare template for @typegpu/cli using Next.js 16 App Router, static export, Tailwind v4, and @typegpu/react.
- Added
nextjs-bareoption toPROJECT_TEMPLATESinoptions.ts. - Added the full template scaffold: page layout, TypeGPU shader component, Next.js/Babel/PostCSS/Tailwind/TypeScript/Oxlint configs, static assets, editor settings, and agent instructions.
ℹ️ Nitpicks
.nvmrcsays Node 24 but_package.jsonuses@types/node ^20;template-vite-reactuses^24.12.3.oxlint.config.tsdoes not setbrowserornodeenv. Consider addingbrowser: trueandnode: truesobabel.config.jsCommonJS globals and browser globals lint correctly.
Kimi K2 (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
Important
The latest commit removes the invalid generateStaticParams() export, but the SVG logo issue raised in the previous review is still present.
Reviewed changes — the follow-up commit addressed one correctness issue in the template's root page, while an earlier image-import issue remains unresolved.
- Removed
generateStaticParams()fromapp/page.tsx— the root page is not a dynamic route, so the function was invalid;output: 'export'already produces a static/. - SVG logo imports still rely on
.src— thepublic/SVG imports are notStaticImageDataobjects in Next.js, so the.srcaccess returnsundefinedat runtime. See the inline comment for evidence and the required fix.
Kimi K2 (free via Pullfrog for OSS) | 𝕏
6bab5ce to
079e5ad
Compare
|
Run failed. View the logs →
|

Let's wait for #2588.