{"id":25630,"library":"glass-easel-template-compiler","title":"glass-easel-template-compiler","description":"A template compiler for the glass-easel framework, a Web Components-based UI library. Version 0.19.0 compiles HTML templates into JavaScript render functions. It is built using Rust and compiled to WebAssembly for Node.js or browser environments. The compiler is tightly coupled with glass-easel core and is not intended for standalone use. Release cadence follows the main glass-easel project, with updates published on npm and GitHub. Key differentiators include WASM-based performance and integration with WeChat's glass-easel ecosystem.","status":"active","version":"0.19.0","language":"javascript","source_language":"en","source_url":"https://github.com/wechat-miniprogram/glass-easel","tags":["javascript","glass-easel","typescript"],"install":[{"cmd":"npm install glass-easel-template-compiler","lang":"bash","label":"npm"},{"cmd":"yarn add glass-easel-template-compiler","lang":"bash","label":"yarn"},{"cmd":"pnpm add glass-easel-template-compiler","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"Requires ESM import; CJS require is not supported.","wrong":"const compile = require('glass-easel-template-compiler')","symbol":"default","correct":"import compile from 'glass-easel-template-compiler'"},{"note":"Named export 'compile' is available since v0.19.0.","wrong":"const { compile } = require('glass-easel-template-compiler')","symbol":"compile","correct":"import { compile } from 'glass-easel-template-compiler'"},{"note":"TypeScript type for compile results; use type import for cleaner bundling.","wrong":"","symbol":"CompileResult","correct":"import type { CompileResult } from 'glass-easel-template-compiler'"}],"quickstart":{"code":"import compile from 'glass-easel-template-compiler';\n\nconst result = compile('<div>{{ message }}</div>');\nconsole.log(result);\n// { code: 'function render() { ... }', ... }","lang":"typescript","description":"Compiles a simple template string into a render function, demonstrating basic usage."},"warnings":[{"fix":"Use default import directly as a function: import compile from 'glass-easel-template-compiler'","message":"Default export changed from object to function in v0.19.0.","severity":"breaking","affected_versions":"<0.19.0"},{"fix":"Upgrade Node.js to >= 14 or use a polyfill.","message":"Requires Node.js version >= 14 for WebAssembly support.","severity":"gotcha","affected_versions":"all"},{"fix":"Ensure glass-easel core is installed and configured.","message":"The package is only compatible with the glass-easel framework; standalone usage is unsupported.","severity":"gotcha","affected_versions":"all"},{"fix":"Use ESM imports; do not use require().","message":"The CJS build is removed; only ESM is supported.","severity":"deprecated","affected_versions":">=0.19.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Run `npm install glass-easel-template-compiler`.","cause":"Package not installed or not in node_modules.","error":"Cannot find module 'glass-easel-template-compiler'"},{"fix":"Use `import compile from 'glass-easel-template-compiler'`.","cause":"CJS require is not supported; package is ESM-only.","error":"const compile = require('glass-easel-template-compiler'); TypeError: compile is not a function"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}