{"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,"search_vec":"'0.1.17':16 'applic':33 'build':51 'compil':4,7,28 'depend':45 'differenti':34 'environ':55 'extern':43 'glsl':3,6,11 'gpu':44 'implement':41 'irregular':23 'javascript':40,56 'latest':19 'librari':8 'lightweight':38 'offer':36 'optim':30 'preprocess':49 'provid':26 'pure':39 'releas':21 'runtim':14,54 'shader':12,27,48 'stabl':20 'suitabl':46 'tool':52 'transform':10 'updat':24 'version':15 'webgl/webgpu':32 'without':42 'wonder':2 'wonder-glsl-compil':1","created_at":"2026-05-01T13:51:06.705849+00:00","updated_at":"2026-05-01T13:51:06.705849+00:00","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,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":"","cli_version":null,"type":"library","homepage":null,"github":null,"docs":null,"changelog":null,"pypi":null,"npm":"https://www.npmjs.com/package/wonder-glsl-compiler","openapi_spec":null,"status_page":null,"smithery":null,"categories":["ai-ml","data"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-05-01","next_check":"2026-07-30","install_tag":null}}