Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create typegpu babel plugin #804

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open

Create typegpu babel plugin #804

wants to merge 7 commits into from

Conversation

mhawryluk
Copy link
Collaborator

closes #796

Copy link

codesandbox-ci bot commented Jan 23, 2025

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

@mhawryluk mhawryluk marked this pull request as ready for review January 23, 2025 12:57
@mhawryluk mhawryluk requested review from iwoplaza and reczkok January 23, 2025 12:57
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since we're planning to rewrite the plugin in unplugin (at least the parts that will run on rollup and rollup-adjacent bundlers), we should IMO go with the name unplugin-typegpu.

https://github.com/unplugin/unplugin-starter/tree/main

It will be less ambiguous what the plugin is for, and will be easier to find 🙌

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, could we call the directory unplugin-typegpu instead of matching the current convention and calling it unplugin? I feel like for packages living under the @typegpu namespace it would be fine, but this will make it more clear which package it represents.

@mhawryluk mhawryluk requested a review from iwoplaza January 27, 2025 11:46
@@ -14,6 +15,8 @@ type Context = {
stack: Scope[];
};

type JsNode = babel.Node | acorn.AnyNode;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm wondering if it wouldn't be easier to switch to @types/estree and use the babel plugin to convert the AST? What do you think?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe then we could have a parser agnostic implementation

Copy link
Collaborator Author

@mhawryluk mhawryluk Jan 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure, I can try and see how viable this is

packages/rollup-plugin/README.md Outdated Show resolved Hide resolved
packages/unplugin-typegpu/README.md Outdated Show resolved Hide resolved
packages/unplugin-typegpu/package.json Outdated Show resolved Hide resolved
Co-authored-by: Iwo Plaza <iwoplaza@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create build plugin for React Native
3 participants