refactor(docs): Migrate more examples to use tsover#2199
Conversation
c46139e to
5134d4d
Compare
|
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 (344 entries).
If you wish to run a comparison for other, slower bundlers, run the 'Tree-shake test' from the GitHub Actions menu. |
faf1e0b to
8593374
Compare
23f494f to
9a21708
Compare
bef3537 to
1f9b7d0
Compare
9a21708 to
90069d5
Compare
1ebc07e to
85f80f7
Compare
90069d5 to
3dbe69b
Compare
df3b0fe to
2af5c45
Compare
450ad02 to
b097b77
Compare
There was a problem hiding this comment.
Pull request overview
This PR updates TypeGPU docs/examples and corresponding snapshot tests to use the newer “tsover” operator-style syntax (e.g., +, *, +=) and related helpers (e.g., std.saturate) instead of the more verbose functional forms (std.add, .mul(), std.clamp(...), etc.). It aligns the docs site examples and the “examples/individual” snapshot expectations with the refactored output.
Changes:
- Refactor many example shaders (docs + Three.js/TSL integrations) to operator-style expressions and add
'use gpu'directives where needed. - Update snapshot tests under
packages/typegpu/tests/examples/individual/*to match the updated generated WGSL. - Update TypeGPU-Three documentation code blocks to reflect the new style.
Reviewed changes
Copilot reviewed 42 out of 42 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| packages/typegpu/tests/examples/individual/vaporrave.test.ts | Snapshot update for operator-style math and minor simplifications. |
| packages/typegpu/tests/examples/individual/stable-fluid.test.ts | Snapshot update for reordered arithmetic / scalar-vector ops. |
| packages/typegpu/tests/examples/individual/slime-mold.test.ts | Snapshot update (compound assignments, saturate, scalar-vector ops). |
| packages/typegpu/tests/examples/individual/slime-mold-3d.test.ts | Snapshot update (scalar-vector ops, compound assignments). |
| packages/typegpu/tests/examples/individual/ripple-cube.test.ts | Snapshot update (operator-style PBR math, compound assignments). |
| packages/typegpu/tests/examples/individual/gravity.test.ts | Snapshot update (compound assignments / simplified return). |
| packages/typegpu/tests/examples/individual/clouds.test.ts | Snapshot update (saturate, operator-style arithmetic, renamed fragment I/O). |
| packages/typegpu/tests/examples/individual/caustics.test.ts | Snapshot update (operator-style math simplifications). |
| packages/typegpu/tests/examples/individual/boids.test.ts | Snapshot update for operator-style math and domain wrap logic. |
| packages/typegpu/tests/examples/individual/ascii-filter.test.ts | Snapshot update (operate on color.rgb directly). |
| packages/typegpu/tests/examples/individual/3d-fish.test.ts | Snapshot update (compound assignment). |
| apps/typegpu-docs/src/examples/threejs/simple/index.ts | Migrate to operator-style TSL expressions. |
| apps/typegpu-docs/src/examples/threejs/compute-particles/index.ts | Migrate to operator-style compute + material nodes. |
| apps/typegpu-docs/src/examples/threejs/compute-particles-snow/index.ts | Migrate to operator-style math and simplify some expressions. |
| apps/typegpu-docs/src/examples/threejs/compute-particles-snow/entities.ts | Operator-style refactor for opacity node logic. |
| apps/typegpu-docs/src/examples/threejs/compute-geometry/index.ts | Operator-style refactor for pointer interaction and physics. |
| apps/typegpu-docs/src/examples/threejs/compute-cloth/verlet.ts | Operator-style refactor in verlet compute passes. |
| apps/typegpu-docs/src/examples/threejs/compute-cloth/triNoise.ts | Operator-style refactor inside noise loop. |
| apps/typegpu-docs/src/examples/threejs/compute-cloth/index.ts | Operator-style refactor for checker pattern. |
| apps/typegpu-docs/src/examples/threejs/attractors/index.ts | Operator-style refactor for init/update compute logic. |
| apps/typegpu-docs/src/examples/tests/uniformity/index.ts | Operator-style refactor + 'use gpu' directive added. |
| apps/typegpu-docs/src/examples/simulation/stable-fluid/simulation.ts | Refactor math to operators and introduce a GPU helper (getNeighbors) in TS form. |
| apps/typegpu-docs/src/examples/simulation/stable-fluid/render.ts | Operator-style refactor in fragment shader. |
| apps/typegpu-docs/src/examples/simulation/slime-mold/index.ts | Operator-style refactor (agent update + blur). |
| apps/typegpu-docs/src/examples/simulation/slime-mold-3d/index.ts | Operator-style refactor (sense/update/blur/raymarch math). |
| apps/typegpu-docs/src/examples/simulation/gravity/render.ts | Operator-style refactor across vertex/fragment shaders. |
| apps/typegpu-docs/src/examples/simulation/gravity/compute.ts | Operator-style refactor for collision + gravity compute passes. |
| apps/typegpu-docs/src/examples/simulation/boids/index.ts | Operator-style refactor + domain wrap logic expressed with fract. |
| apps/typegpu-docs/src/examples/simple/vaporrave/sphere.ts | Operator-style refactor + 'use gpu' directive. |
| apps/typegpu-docs/src/examples/simple/vaporrave/index.ts | Convert rayMarch to TS GPU function + operator-style refactor. |
| apps/typegpu-docs/src/examples/simple/vaporrave/floor.ts | Operator-style refactor + 'use gpu' directives in helpers. |
| apps/typegpu-docs/src/examples/simple/stencil/index.ts | Operator-style refactor for vertex transform. |
| apps/typegpu-docs/src/examples/simple/ripple-cube/sdf-scene.ts | Operator-style refactor for SDF normal sampling. |
| apps/typegpu-docs/src/examples/simple/ripple-cube/post-processing.ts | Operator-style refactor and some pipeline reshaping for post passes. |
| apps/typegpu-docs/src/examples/simple/ripple-cube/pbr.ts | Operator-style refactor for PBR helpers/shading. |
| apps/typegpu-docs/src/examples/rendering/clouds/utils.ts | Operator-style refactor + convert one helper to TS GPU function form. |
| apps/typegpu-docs/src/examples/rendering/clouds/index.ts | Inline fragment shader using operator-style syntax. |
| apps/typegpu-docs/src/examples/rendering/caustics/index.ts | Operator-style refactor across helper functions and fragment shader. |
| apps/typegpu-docs/src/examples/rendering/3d-fish/compute.ts | Operator-style refactor in compute step. |
| apps/typegpu-docs/src/examples/image-processing/background-segmentation/shaders.ts | Operator-style refactor in compute kernel indexing/accumulation. |
| apps/typegpu-docs/src/examples/image-processing/ascii-filter/index.ts | Operator-style refactor in glyph math and color mode. |
| apps/typegpu-docs/src/content/docs/ecosystem/typegpu-three/index.mdx | Update docs snippets to “tsover” style. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
a58a399 to
cf3d2e8
Compare
cf3d2e8 to
6dec65e
Compare
No description provided.