software-mansion / software-mansion/TypeGPU
fix(unplugin-typegpu): Babel plugin doesn't handle functions as object properties
Open
@cieplypolar is already working on this.
Since Nov 4, 2025.
- Dominant language
- TypeScript
- Stars
- 3.2k
- Forks
- 122
- Avg merge
- 3d 5h
- Merged PRs (30d)
- 34
Description
const DEFAULTS = {
getGravity: () => {
'use gpu';
return d.vec3f(1, 2, 3);
},
};
const main = () => {
'use gpu';
const hello = DEFAULTS.getGravity();
};
Allegedly, the babel plugin does not catch the getGravity function and doesn't emit metadata for it. Create a test case for both the rollup and babel version of the plugin, and fix the behavior if it occurs.
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.
Assessment
This issue has not been assessed yet.