Spanish Total.js
English
Documentation For AI agents
Contents

UI Builder compiler

F.uibuildercompiler().

.md GitHub
On this page

API

method

F.uibuildercompiler(opt, [callback])

Compiles a UI Builder schema so it can be rendered without the designer.
ParameterTypeDescription
opt.schema String|Object The UI Builder schema (JSON string or object).
opt.origin? String The origin for relative component URLs.
opt.download? Boolean Embeds the component HTML. Default: false
opt.local? Boolean Skips resolving components. Default: false
callback? Function(err, response) Receives the compiled schema.

Returns Promise Only without a callback.

Finds the components used in the schema and resolves their render URLs from schema.components (relative URLs use opt.origin or schema.origin; a .json value is a list of more components). With opt.download the HTML of each component is downloaded and embedded as base64. With opt.local the components are not downloaded at all. The result is the schema without the editor data, with compiled: true and css taken from cssoutput. Without a callback it returns a Promise.

Compile and store
var app = await F.uibuildercompiler({ schema: body, download: true });
PATH.fs.writeFile(PATH.databases('app.json'), JSON.stringify(app), NOOP);
Made in Europe