Skip to content

impr(@typegpu/cli): Next.js template#2596

Open
cieplypolar wants to merge 18 commits into
mainfrom
impr/nextjs-template
Open

impr(@typegpu/cli): Next.js template#2596
cieplypolar wants to merge 18 commits into
mainfrom
impr/nextjs-template

Conversation

@cieplypolar

@cieplypolar cieplypolar commented Jun 10, 2026

Copy link
Copy Markdown
Collaborator

Let's wait for #2588.

@github-actions

github-actions Bot commented Jun 10, 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@244fa0ba45a0843e2f5a48fe4da0ab883e318a4b
https://pkg.pr.new/software-mansion/TypeGPU/tinyest-for-wgsl@244fa0ba45a0843e2f5a48fe4da0ab883e318a4b
https://pkg.pr.new/software-mansion/TypeGPU/typegpu@244fa0ba45a0843e2f5a48fe4da0ab883e318a4b
https://pkg.pr.new/software-mansion/TypeGPU/@typegpu/cli@244fa0ba45a0843e2f5a48fe4da0ab883e318a4b
https://pkg.pr.new/software-mansion/TypeGPU/@typegpu/color@244fa0ba45a0843e2f5a48fe4da0ab883e318a4b
https://pkg.pr.new/software-mansion/TypeGPU/@typegpu/gl@244fa0ba45a0843e2f5a48fe4da0ab883e318a4b
https://pkg.pr.new/software-mansion/TypeGPU/@typegpu/noise@244fa0ba45a0843e2f5a48fe4da0ab883e318a4b
https://pkg.pr.new/software-mansion/TypeGPU/@typegpu/radiance-cascades@244fa0ba45a0843e2f5a48fe4da0ab883e318a4b
https://pkg.pr.new/software-mansion/TypeGPU/@typegpu/react@244fa0ba45a0843e2f5a48fe4da0ab883e318a4b
https://pkg.pr.new/software-mansion/TypeGPU/@typegpu/sdf@244fa0ba45a0843e2f5a48fe4da0ab883e318a4b
https://pkg.pr.new/software-mansion/TypeGPU/@typegpu/three@244fa0ba45a0843e2f5a48fe4da0ab883e318a4b
https://pkg.pr.new/software-mansion/TypeGPU/unplugin-typegpu@244fa0ba45a0843e2f5a48fe4da0ab883e318a4b

benchmark
view benchmark

commit
view commit

@github-actions

github-actions Bot commented Jun 10, 2026

Copy link
Copy Markdown

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

🟢 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 ($${\color{green}-3.2\%}$$)
tgpu_initFromDevice.ts 255.63 kB ($${\color{green}-3.3\%}$$)
tgpu_resolve.ts 161.62 kB ($${\color{green}-38.9\%}$$)
tgpu_resolveWithContext.ts 161.55 kB ($${\color{green}-38.9\%}$$)
tgpu_bindGroupLayout.ts 68.88 kB ($${\color{green}-74.0\%}$$)
tgpu_mutableAccessor.ts 65.83 kB ($${\color{green}-75.1\%}$$)
tgpu_accessor.ts 65.81 kB ($${\color{green}-75.1\%}$$)
tgpu_privateVar.ts 65.23 kB ($${\color{green}-75.3\%}$$)
tgpu_workgroupVar.ts 65.23 kB ($${\color{green}-75.3\%}$$)
tgpu_const.ts 64.48 kB ($${\color{green}-75.6\%}$$)
tgpu_fn.ts 38.07 kB ($${\color{green}-85.6\%}$$)
tgpu_fragmentFn.ts 37.97 kB ($${\color{green}-85.6\%}$$)
tgpu_vertexFn.ts 37.78 kB ($${\color{green}-85.7\%}$$)
tgpu_computeFn.ts 37.49 kB ($${\color{green}-85.8\%}$$)
tgpu_vertexLayout.ts 26.62 kB ($${\color{green}-89.9\%}$$)
tgpu_comptime.ts 14.42 kB ($${\color{green}-94.5\%}$$)
tgpu_unroll.ts 2.59 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 Jun 10, 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 [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]
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.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]
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.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]
Loading

@cieplypolar cieplypolar force-pushed the impr/nextjs-template branch from e108045 to 1dc6371 Compare July 7, 2026 17:14
@cieplypolar cieplypolar changed the base branch from main to feat/ascii-art July 7, 2026 17:15
@cieplypolar cieplypolar marked this pull request as ready for review July 7, 2026 17:16

@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

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-bare option to PROJECT_TEMPLATES in options.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

  • .nvmrc says Node 24 but _package.json uses @types/node ^20; template-vite-react uses ^24.12.3.
  • oxlint.config.ts does not set browser or node env. Consider adding browser: true and node: true so babel.config.js CommonJS globals and browser globals lint correctly.

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

Comment thread packages/typegpu-cli/templates/template-nextjs-bare/app/page.tsx Outdated
Comment thread packages/typegpu-cli/templates/template-nextjs-bare/app/page.tsx

@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 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() from app/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 — the public/ SVG imports are not StaticImageData objects in Next.js, so the .src access returns undefined at runtime. See the inline comment for evidence and the required fix.

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

Comment thread packages/typegpu-cli/templates/template-nextjs-bare/app/page.tsx
Base automatically changed from feat/ascii-art to main July 13, 2026 15:00
Copilot AI review requested due to automatic review settings July 14, 2026 16:07

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 commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Run failed. View the logs →

Pullfrog  | Rerun failed job ➔View workflow run | via Pullfrog | Using Kimi K2 (free via Pullfrog for OSS) | 𝕏

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.

2 participants