{"id":26656,"library":"wonder-glsl-compiler","title":"wonder-glsl-compiler","description":"A GLSL compiler library for transforming GLSL shaders at runtime. Version 0.1.17 is the latest stable release with irregular updates. It provides shader compilation and optimization for WebGL/WebGPU applications. Differentiates by offering a lightweight, pure JavaScript implementation without external GPU dependencies, suitable for shader preprocessing in build tools or runtime environments.","status":"active","version":"0.1.17","language":"javascript","source_language":"en","source_url":"https://github.com/Wonder-Technology/Wonder-GLSL-Compiler.js","tags":["javascript"],"install":[{"cmd":"npm install wonder-glsl-compiler","lang":"bash","label":"npm"},{"cmd":"yarn add wonder-glsl-compiler","lang":"bash","label":"yarn"},{"cmd":"pnpm add wonder-glsl-compiler","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"Default import is the main entry point for the compiler.","symbol":"wonderGLSLCompiler","correct":"import wonderGLSLCompiler from 'wonder-glsl-compiler'"},{"note":"Named export available for tree-shaking.","symbol":"compile","correct":"import { compile } from 'wonder-glsl-compiler'"},{"note":"TypeScript type imports for compile options.","symbol":"Types","correct":"import type { CompileOptions } from 'wonder-glsl-compiler'"}],"quickstart":{"code":"import wonderGLSLCompiler from 'wonder-glsl-compiler';\nconst glslCode = 'void main() { gl_FragColor = vec4(1.0); }';\nconst result = wonderGLSLCompiler.compile(glslCode);\nconsole.log(result.output);","lang":"typescript","description":"Demonstrates basic usage of the compiler: import, compile a simple GLSL shader, and log the output."},"warnings":[{"fix":"Pre-validate shaders using a GLSL linter before compilation.","message":"The library does not validate GLSL syntax; invalid shaders may cause runtime errors.","severity":"gotcha","affected_versions":"<=0.1.17"},{"fix":"Upgrade to 0.1.17 or later.","message":"Older versions may rely on deprecated APIs removed in Node.js 18+.","severity":"deprecated","affected_versions":"<0.1.17"},{"fix":"Implement manual caching if compiling multiple shaders.","message":"Only supports immediate mode compilation; no caching or incremental rebuilds.","severity":"gotcha","affected_versions":"<=0.1.17"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Use default import: import wonderGLSLCompiler from 'wonder-glsl-compiler';","cause":"Importing default as named function incorrectly.","error":"TypeError: wonderGLSLCompiler.compile is not a function"},{"fix":"Run npm install wonder-glsl-compiler and ensure tsconfig.json resolves modules.","cause":"Package not installed or incorrect import path in TypeScript.","error":"Cannot find module 'wonder-glsl-compiler'"},{"fix":"Check the shader code for typos or unsupported features.","cause":"GLSL shader code has syntax or semantics errors.","error":"Error: GLSL compilation failed with errors"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}