Skip to content

fix(unplugin-typegpu): Babel plugin doesn't handle functions as object properties #1888

@iwoplaza

Description

@iwoplaza
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.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions