-
-
Notifications
You must be signed in to change notification settings - Fork 22
feat: Autoname functions in unplugin #1746
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
base: main
Are you sure you want to change the base?
Conversation
pkg.pr.new packages
benchmark commit |
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.
Pull Request Overview
This PR implements auto-naming functionality for functions in the unplugin system. It enables automatic naming of arrow functions, function expressions, and function declarations that contain the 'kernel' directive.
- Adds
getFunctionName
utility function to extract function names from AST nodes - Updates both Babel and Rollup transform pipelines to support function auto-naming
- Enhances the global
__TYPEGPU_AUTONAME__
handler to work with regular JavaScript functions
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
File | Description |
---|---|
packages/unplugin-typegpu/test/auto-naming.test.ts | Adds comprehensive tests for function auto-naming in both Babel and Rollup transforms |
packages/unplugin-typegpu/src/index.ts | Updates Rollup transform to use new getFunctionName utility and apply auto-naming to functions |
packages/unplugin-typegpu/src/common.ts | Introduces getFunctionName utility function to extract function names from AST nodes |
packages/unplugin-typegpu/src/babel.ts | Updates Babel transform to handle function auto-naming with new transpileAndAutoname helper |
packages/typegpu/tests/unplugin/autoname.test.ts | Enables previously disabled tests for function auto-naming functionality |
packages/typegpu/src/shared/meta.ts | Updates global auto-name handler to support regular JavaScript functions via setName |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
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.
Pull Request Overview
Copilot reviewed 23 out of 23 changed files in this pull request and generated 2 comments.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
The behavior has changed a little. |
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.
👏 !Awesome! 👏
Changes:
now the following works.