{"id":27560,"library":"yox-template-compiler","title":"yox-template-compiler","description":"A template compiler for Yox.js, transforming Yox templates into render functions. Version 0.29.0 is the current stable release, with a slow release cadence. It requires yox-common, yox-config, yox-type, and yox-expression-compiler as peer dependencies. Key differentiator: designed specifically for the Yox.js framework, not a general-purpose template engine.","status":"active","version":"0.29.0","language":"javascript","source_language":"en","source_url":"https://github.com/yoxjs/yox-template-compiler","tags":["javascript"],"install":[{"cmd":"npm install yox-template-compiler","lang":"bash","label":"npm"},{"cmd":"yarn add yox-template-compiler","lang":"bash","label":"yarn"},{"cmd":"pnpm add yox-template-compiler","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Utility functions used by compiled templates","package":"yox-common","optional":false},{"reason":"Configuration for parser/compiler","package":"yox-config","optional":false},{"reason":"Type checking utilities","package":"yox-type","optional":false},{"reason":"Compiles expressions within templates","package":"yox-expression-compiler","optional":false}],"imports":[{"note":"ESM-only; no default export","wrong":"const compile = require('yox-template-compiler').compile","symbol":"compile","correct":"import { compile } from 'yox-template-compiler'"},{"note":"Named export only","wrong":"import compileToFunctions from 'yox-template-compiler'","symbol":"compileToFunctions","correct":"import { compileToFunctions } from 'yox-template-compiler'"},{"note":"TypeScript type import for options","symbol":"CompileOptions","correct":"import type { CompileOptions } from 'yox-template-compiler'"}],"quickstart":{"code":"import { compile } from 'yox-template-compiler';\n\nconst template = '<div>{{ message }}</div>';\nconst result = compile(template);\nconsole.log(result);","lang":"typescript","description":"Compiles a simple Yox template string to a render function object."},"warnings":[{"fix":"Update code to handle new return shape: render function is now under .code","message":"The compile function returns a different structure in v0.29.0 vs v0.28.x","severity":"breaking","affected_versions":">=0.29.0"},{"fix":"Use compile or compileToFunctions instead","message":"compileToString is deprecated since v0.25.0","severity":"deprecated","affected_versions":">=0.25.0"},{"fix":"Install exact versions: yox-common@^0.20.0, yox-config@^0.3.0, etc.","message":"All peer dependencies must be at the exact versions specified; mismatch causes runtime errors","severity":"gotcha","affected_versions":">=0.20.0"},{"fix":"Use a bundler like webpack or Rollup for browser builds","message":"The compiler only works in Node.js; browser usage requires bundling","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"npm install yox-common@^0.20.0","cause":"Missing peer dependency","error":"Cannot find module 'yox-common'"},{"fix":"Use import { compile } from 'yox-template-compiler'","cause":"Incorrect import: using default import instead of named","error":"TypeError: compile is not a function"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}