Skip to content

fix: unplugin-typegpu should parse files with TS syntax support #1516

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

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

Conversation

iwoplaza
Copy link
Collaborator

@iwoplaza iwoplaza commented Jul 20, 2025

There is a hidden option in the this.parse API, where lang: 'ts' has to be passed in, as stated in rolldown/rolldown#5388

Copy link

github-actions bot commented Jul 20, 2025

pkg.pr.new

packages
Ready to be installed by your favorite package manager ⬇️

https://pkg.pr.new/software-mansion/TypeGPU/typegpu@530761f438d240e8ed57ccb2d9e6d4f76b22b37a
https://pkg.pr.new/software-mansion/TypeGPU/@typegpu/noise@530761f438d240e8ed57ccb2d9e6d4f76b22b37a
https://pkg.pr.new/software-mansion/TypeGPU/unplugin-typegpu@530761f438d240e8ed57ccb2d9e6d4f76b22b37a

benchmark
view benchmark

commit
view commit

@iwoplaza iwoplaza linked an issue Jul 21, 2025 that may be closed by this pull request
@iwoplaza iwoplaza changed the title chore: Upgrade unplugin-typegpu dependencies fix: unplugin-typegpu should parse files with TS syntax support Jul 22, 2025
@iwoplaza iwoplaza marked this pull request as ready for review July 22, 2025 19:28
Copy link
Contributor

@reczkok reczkok left a comment

Choose a reason for hiding this comment

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

Yes

Copy link
Contributor

@aleksanderkatan aleksanderkatan left a comment

Choose a reason for hiding this comment

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

🟦🟦🟦
Could you explain shortly in which case this change matters?

@@ -120,6 +120,7 @@ interface Options {
exclude?: FilterPattern;
enforce?: 'post' | 'pre' | undefined;
forceTgpuAlias?: string;
autoNamingEnabled?: boolean;
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice catch. While we're at it, could you include the default options here as well?

@iwoplaza
Copy link
Collaborator Author

🟦🟦🟦
Could you explain shortly in which case this change matters?

This change matters when the bundler gives us raw TypeScript code, instead of stripping the types first before handing it to us. Rolldown did this, and this change makes it possible to use unplugin-typegpu with rolldown/tsdown.

@iwoplaza iwoplaza requested a review from reczkok July 23, 2025 16:59
Copy link
Contributor

@reczkok reczkok left a comment

Choose a reason for hiding this comment

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

Yep

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.

bug: unplugin-typegpu fails on TS syntax in rolldown
3 participants