feat: vite + react template#2568
Conversation
|
pkg.pr.new packages benchmark commit |
📊 Bundle Size Comparison
👀 Notable resultsStatic test results:No major changes. Dynamic test results:No major changes. 📋 All resultsClick to reveal the results table (355 entries).
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 [0.80, 1.62, 3.36, 5.15, 6.37, 9.87, 19.08, 19.44]
line [0.74, 1.51, 3.37, 5.06, 6.37, 9.07, 17.84, 20.80]
line [0.84, 1.66, 3.61, 6.01, 6.56, 7.93, 19.13, 23.59]
---
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.32, 0.55, 0.68, 0.78, 1.02, 1.10, 1.33, 1.48]
line [0.27, 0.50, 0.62, 0.73, 0.91, 0.98, 1.20, 1.36]
line [0.28, 0.51, 0.64, 0.76, 1.00, 1.06, 1.26, 1.43]
---
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.89, 1.83, 2.97, 5.33, 10.53, 22.76, 46.67, 97.46]
line [0.80, 1.82, 2.93, 5.30, 10.49, 21.82, 46.71, 94.87]
line [0.88, 1.87, 3.29, 5.97, 11.28, 22.33, 50.54, 99.82]
|
There was a problem hiding this comment.
Pull request overview
Adds a new Vite + React starter template to the TypeGPU CLI and exposes it in the project creation template picker.
Changes:
- Adds a
template-vite-reactscaffold with React/Vite config, TypeScript configs, lint/format settings, assets, and a TypeGPU canvas demo. - Updates the CLI template selector to include
Vite + React. - Adds automated gradient coloring for template labels.
Reviewed changes
Copilot reviewed 16 out of 22 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
packages/typegpu-cli/src/create.ts |
Adds React template option and gradient-colored labels. |
packages/typegpu-cli/templates/template-vite-react/_package.json |
Defines generated project dependencies and scripts. |
packages/typegpu-cli/templates/template-vite-react/index.html |
Adds Vite HTML entry point. |
packages/typegpu-cli/templates/template-vite-react/src/main.tsx |
Adds React root bootstrap. |
packages/typegpu-cli/templates/template-vite-react/src/App.tsx |
Adds TypeGPU React demo UI and canvas rendering. |
packages/typegpu-cli/templates/template-vite-react/src/index.css |
Adds template styling and responsive layout. |
packages/typegpu-cli/templates/template-vite-react/vite.config.ts |
Configures Vite, React, and TypeGPU plugin. |
packages/typegpu-cli/templates/template-vite-react/tsconfig.json |
Adds project references. |
packages/typegpu-cli/templates/template-vite-react/tsconfig.app.json |
Adds app TypeScript configuration. |
packages/typegpu-cli/templates/template-vite-react/tsconfig.node.json |
Adds Vite config TypeScript configuration. |
packages/typegpu-cli/templates/template-vite-react/oxlint.config.ts |
Adds lint configuration. |
packages/typegpu-cli/templates/template-vite-react/_oxfmtrc.json |
Adds formatter configuration. |
packages/typegpu-cli/templates/template-vite-react/_gitignore |
Adds generated project ignore rules. |
packages/typegpu-cli/templates/template-vite-react/_nvmrc |
Pins Node version for generated projects. |
packages/typegpu-cli/templates/template-vite-react/_vscode/settings.json |
Adds VS Code TypeScript SDK settings. |
packages/typegpu-cli/templates/template-vite-react/_zed/settings.json |
Adds Zed TypeScript SDK settings. |
packages/typegpu-cli/templates/template-vite-react/public/favicon.svg |
Adds TypeGPU favicon asset. |
packages/typegpu-cli/templates/template-vite-react/public/icons.svg |
Adds reusable social/tooling icons. |
packages/typegpu-cli/templates/template-vite-react/public/react.svg |
Adds React logo asset. |
packages/typegpu-cli/templates/template-vite-react/public/vite.svg |
Adds Vite logo asset. |
packages/typegpu-cli/templates/template-vite-react/public/typegpu-logo-light.svg |
Adds light TypeGPU logo asset. |
packages/typegpu-cli/templates/template-vite-react/public/typegpu-logo-dark.svg |
Adds dark TypeGPU logo asset. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| @@ -0,0 +1,108 @@ | |||
| import React, { useMemo } from 'react'; | |||
There was a problem hiding this comment.
import React is no longer necessary since React 17, is there a reason to still import it?
| import React, { useMemo } from 'react'; | |
| import { useMemo } from 'react'; |
There was a problem hiding this comment.
oxlint --check is not happy with that
TODO: