Code-Assembly-Line works for node.js and browsers.
Engine works with templates, data and processes. All items are described in JSON compatible format, in a way to exchange resources via standard AJAX calls. Templates are logicless and are fully decoupled from the data. Partial rendering nature of this engine will give you an opportunity to balance rendering between server and client and you will be able to separate localization, design and data rendering processes. Choose a strategy on missing property values and have fine control on data during rendering process by using hook functions. In brief - Code-Assembly-Line.
From the console:
npm i -S code-assembly-line
It will install module in to the project. You can start using it by
const CodeAssemblyLine = require ( 'code-assembly-line' );
const tplEngine = new CodeAssemblyLine(); // Create instance of template engine
Just go to '/dist' folder and get copy of 'code-assembly-line.min.js'. Put the file inside your project folder and add a reference to it from HTML code by using this script tag:
<script src="code-assembly-line.min.js"></script>
Library is avalable as 'CodeAssemblyLine' and start using it.
const tplEngine = new CodeAssemblyLine();
Find working example in file '/dist/index.html'.
(Nothing yet)
Breaking change in .insertProcessLib
method. In version 1.x method expects JSON argument. Version 2.x require object from type extProcessLib
where key is processName and value is extProcess
type.
Breaking change in .getProcessLib
method. In version 1.x method returns JSON. Version 2.x returns object from type extProcessLib
.
Code change required:
// v.1.x.x
tplEngine.insertProcessLib ( libData, libName );
// libData:string. JSON representation of extProcessLib
const libJSON = tplEngine.getProcessLib ()
// convert to version 2.x.x
tplEngine.insertProcessLib ( JSON.parse(libData), libName )
const libJSON = JSON.stringify ( tplEngine.getProcessLib ())
No more code changes required.
- Fix: method getProcessLib returns JSON representation of intProcess type object. Should be object of extProcessLib type;
- Method 'getTemplateLib' without arguments will return all templates without modification;
- Breaking change: Method 'getProcessLib' returns 'extProcessLib'. Was JSON representation of 'extProcessLib';
- Breaking change: Argument extLib for method 'insertProcessLib' was changed. Was JSON, now is extProcessLib object;
- Run throws console error if any errors
- Bug: method getProcessLib returns JSON representation of intProcess type object. Should be JSON representation of extProcessLib type;
- Process-step 'add' was switched on;
- Readme has link to documentation wiki;
- Bug: method getProcessLib returns JSON representation of intProcess type object. Should be JSON representation of extProcessLib type;
- Process-step 'add' is not active.
- Node.js module;
- Browser module;
- Test package;
- Bug: method getProcessLib returns JSON representation of intProcess type object. Should be JSON representation of extProcessLib type;
'code-assembly-line' was created by Peter Naydenov.
'code-assembly-line' is released under the MIT License.