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

feat(dev-tools): add ts-transform-remove-glsl-comments #455

Merged
merged 3 commits into from
Feb 23, 2024

Conversation

Pessimistress
Copy link
Collaborator

TypeScript transform to remove comments and unnecessary white space from GLSL source.

A template string is processed as GLSL source if:

  1. the file matches the pattern specified in the plugin config; or
  2. it is tagged as glsl`...`

Usage with ts-patch:

   {
      "plugins": [
        {
          "transform": "ocular-dev-tools/ts-transform-remove-glsl-comments",
          "pattern": ["*.glsl.ts"]
        }
      ]
   }

@Pessimistress
Copy link
Collaborator Author

@ibgreen since template tag (glsl`...` ) only has cosmetic value would you like to remove it when transpiling with this plugin?

@ibgreen
Copy link
Collaborator

ibgreen commented Feb 22, 2024

since template tag (glsl... ) only has cosmetic value would you like to remove it when transpiling with this plugin?

This is used to get syntax highlighting in embedded shaders which is awesome. I am not excited about removing it from the source. It is fine to strip it during the compilation of course.

@Pessimistress
Copy link
Collaborator Author

I am not proposing to strip it from the source. This plugin also relies on it to identify shader code. The plugin is executed during the build process, so it only affects the compiled output.

@Pessimistress Pessimistress merged commit e877883 into master Feb 23, 2024
4 checks passed
@Pessimistress Pessimistress deleted the x/glsl-comments branch February 23, 2024 04:29
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.

2 participants