software-mansion / software-mansion/TypeGPU
[RFC] feat: Rename d.arrayOf and d.disarrayOf to d.array and d.disarray
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 3.2k
- Forks
- 122
- Avg merge
- 3d 5h
- Merged PRs (30d)
- 34
Description
The Of prefix is inherited from the equivalent typed-binary APIs, and my choice to do this back then was not to reduce the risk of conflicting with other definitions when imported. We usually use these APIs through the d namespace anyway, and dropping Of would make them mirror the WGSL typed a lot more.
const GRID_WIDTH = 8;
const GRID_HEIGHT = 6;
-const GridSchema = d.arrayOf(d.arrayOf(d.u32, GRID_HEIGHT), GRID_WIDTH);
+const GridSchema = d.array(d.array(d.u32, GRID_HEIGHT), GRID_WIDTH);
What do you guys think?
Breaking change
This would be a breaking change, so it might not be worth it, but we could keep arrayOf and disarrayOf as aliases for a while (a few minors), and recommend the new APIs in all of our docs and examples. We'd deprecate them after this grace period, and delete them shortly after as well.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing the existing d.arrayOf and d.disarrayOf APIs, then locate their documentation and examples. The issue is an RFC rather than an implementation request; done would require a decided migration plan for the proposed names, compatibility aliases, deprecation period, and documentation updates.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- developer-experience
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100