fix: Inconsistent whitespace in WGSL functions#2338
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 (349 entries).
If you wish to run a comparison for other, slower bundlers, run the 'Tree-shake test' from the GitHub Actions menu. |
There was a problem hiding this comment.
Pull request overview
This pull request fixes inconsistent whitespace formatting in generated WGSL function signatures. The changes ensure that all WGSL functions have exactly one space before the opening brace and consistent spacing around return types, improving code formatting consistency across the codebase.
Changes:
- Refactored spacing logic in
fnCore.tsto consolidate whitespace handling into theoutputvariable, eliminating the need for multiple spacing concatenations - Updated all test snapshots across 27 test files to reflect the new consistent spacing pattern
- Fixed both missing spaces (e.g.,
() -> type{→() -> type {) and excessive spaces (e.g.,) {→) {)
Reviewed changes
Copilot reviewed 1 out of 33 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| packages/typegpu/src/core/function/fnCore.ts | Source code changes implementing consistent whitespace handling for WGSL function signatures |
| packages/typegpu/src/tgsl/consoleLog/serializers.ts | Updates to raw WGSL function implementations to use correct syntax without arrow functions |
| packages/typegpu/tests/consoleLog.test.ts | Test snapshot updates for consistent spacing |
| packages/typegpu/tests/tgpuGenericFn.test.ts | Test snapshot updates for consistent spacing |
| packages/typegpu/tests/slot.test.ts | Test snapshot updates for consistent spacing |
| packages/typegpu/tests/resolve.test.ts | Test snapshot updates for consistent spacing |
| packages/typegpu/tests/rawFn.test.ts | Test snapshot updates for consistent spacing |
| packages/typegpu/tests/pipeline-resolution.test.ts | Test snapshot updates for consistent spacing |
| packages/typegpu/tests/functionTagged.test.ts | Test snapshot updates for consistent spacing |
| packages/typegpu/tests/entryFnHeaderGen.test.ts | Test snapshot updates for consistent spacing |
| packages/typegpu/tests/constant.test.ts | Test snapshot updates for consistent spacing |
| packages/typegpu/tests/accessor.test.ts | Test snapshot updates for consistent spacing |
| apps/typegpu-docs/tests/individual-example-tests/*.test.ts | Multiple example test files updated for consistent spacing (20+ files) |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
0a99b84 to
3801b7c
Compare
No description provided.