{"id":24933,"library":"atom-expression-compiler","title":"Atom Expression Compiler","description":"A Vue expression compiler for server-side rendering (SSR) that pre-compiles Vue template expressions into executable JavaScript functions. Version 2.2.4 supports modern Vue 3 syntax and provides faster runtime evaluation compared to traditional string-based evaluation. It handles interpolation, filters, and complex expressions with proper scoping. The package is lightweight, has no runtime dependencies, and is designed specifically for SSR optimization in Vue applications. It is actively maintained with monthly releases.","status":"active","version":"2.2.4","language":"javascript","source_language":"en","source_url":null,"tags":["javascript","vue","atom","server renderer","expression compiler"],"install":[{"cmd":"npm install atom-expression-compiler","lang":"bash","label":"npm"},{"cmd":"yarn add atom-expression-compiler","lang":"bash","label":"yarn"},{"cmd":"pnpm add atom-expression-compiler","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"ESM-only since v2. CommonJS require will fail.","wrong":"const { compileExpression } = require('atom-expression-compiler')","symbol":"compileExpression","correct":"import { compileExpression } from 'atom-expression-compiler'"},{"note":"TypeScript consumers should use type import for the return type interface.","wrong":"","symbol":"CompileResult","correct":"import type { CompileResult } from 'atom-expression-compiler'"},{"note":"Default export is available but named export recommended.","wrong":"import { default as compiler } from 'atom-expression-compiler'","symbol":"default","correct":"import compiler from 'atom-expression-compiler'"}],"quickstart":{"code":"import { compileExpression } from 'atom-expression-compiler';\n\nconst expr = 'name + \" - \" + age';\nconst code = compileExpression(expr, {\n  compact: true,\n  sourceMap: false\n});\n\nconsole.log(code);\n// Output: function anonymous($event,_ctx,_c,_ssrAttr) { return _ctx.name + ' - ' + _ctx.age }","lang":"typescript","description":"Demonstrates compiling a simple Vue template expression into a render function with compact output."},"warnings":[{"fix":"Use ES module imports (import syntax) instead of require(). If using CommonJS, stick with version 1.x.","message":"Requirement for ESM imports only; CommonJS require throws error.","severity":"breaking","affected_versions":">=2.0.0"},{"fix":"Remove 'sourceMap' option from compile call; it is now always false.","message":"The 'sourceMap' option is deprecated and will be removed in v3.","severity":"deprecated","affected_versions":">=2.0.0 <3.0.0"},{"fix":"Wrap compiled code with proper scope passing _ctx, e.g., using Function.prototype.call.","message":"Compiled functions rely on global _ctx variable; ensure context is passed correctly.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Access compiled code via .code property instead of directly using the returned value.","message":"Return type changed from string to object in v2.","severity":"breaking","affected_versions":">=2.0.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 atom-expression-compiler' and ensure import path is correct.","cause":"Package not installed or incorrect import path.","error":"Cannot find module 'atom-expression-compiler'"},{"fix":"Use import statement or downgrade to version 1.x.","cause":"Using require() with ESM-only version.","error":"'require' is not defined in ES module scope"},{"fix":"Use named import: import { compileExpression } from 'atom-expression-compiler'.","cause":"Default import used for a named export.","error":"TypeError: compiler is not a function"},{"fix":"Enable ESM in package.json (\"type\": \"module\") or use bundler.","cause":"Running code in a CommonJS environment without ESM support.","error":"Unexpected token 'export'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}