software-mansion / software-mansion/TypeGPU

[RFC] feat: Rename d.arrayOf and d.disarrayOf to d.array and d.disarray

Open
#2,685 1 comment 0 reactions 0 assignees View on GitHub

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.