{"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,"search_vec":"'0.29.0':17 'cadenc':27 'common':32 'compil':4,7,43 'config':35 'current':20 'depend':46 'design':49 'differenti':48 'engin':61 'express':42 'framework':54 'function':15 'general':58 'general-purpos':57 'javascript':62 'key':47 'peer':45 'purpos':59 'releas':22,26 'render':14 'requir':29 'slow':25 'specif':50 'stabl':21 'templat':3,6,12,60 'transform':10 'type':38 'version':16 'yox':2,11,31,34,37,41 'yox-common':30 'yox-config':33 'yox-expression-compil':40 'yox-template-compil':1 'yox-typ':36 'yox.js':9,53","created_at":"2026-05-01T17:46:53.953582+00:00","updated_at":"2026-05-01T17:46:53.953582+00:00","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,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":"","cli_version":null,"type":"library","homepage":"https://yoxjs.github.io/yox/","github":"https://github.com/yoxjs/yox-template-compiler","docs":null,"changelog":null,"pypi":null,"npm":"https://www.npmjs.com/package/yox-template-compiler","openapi_spec":null,"status_page":null,"smithery":null,"categories":["web-framework"],"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}}