-
-
Notifications
You must be signed in to change notification settings - Fork 6
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
base: main
Are you sure you want to change the base?
Conversation
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. |
packages/plugin/package.json
Outdated
There was a problem hiding this comment.
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 🙌
There was a problem hiding this comment.
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.
@@ -14,6 +15,8 @@ type Context = { | |||
stack: Scope[]; | |||
}; | |||
|
|||
type JsNode = babel.Node | acorn.AnyNode; |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
Co-authored-by: Iwo Plaza <iwoplaza@gmail.com>
closes #796