Xuda JavaScript Framework User Guide
Xuda JavaScript Framework User Guide
This guide is for a developer who wants to know what the Xuda JavaScript Framework actually is and how to get something running with it. It explains the two authoring paths, Xuda Slim and Xuda CLI, shows the shortest route from a blank HTML file to a reactive page, and then walks the growth path up through a full local project, a Studio-authored app and a deployed one. It also says plainly which parts of the toolchain are ready to use today and which are not.
This is the product-level guide. Xuda Slim and Xuda CLI each have their own guide, and every Studio tab has one too. Where a step is covered in depth elsewhere, this guide names that guide instead of repeating it.
What The Xuda JavaScript Framework Is
The Xuda JavaScript Framework is a reactive runtime driven by HTML attributes. There is no build step, no JSX and no virtual DOM. You decorate real markup with xu-* attributes, and the runtime binds it to state.
The important idea is that there is one runtime with two authoring paths, and both produce the same thing:
| Authoring Path | What It Is | What You Get |
|---|---|---|
| Xuda Slim | A single browser bundle you drop into any HTML page with one script tag. | A reactive page with no project, no npm install and no build. Good for one page, a widget or an existing site. |
| Xuda CLI | A source-first local toolchain, installed from npm, that compiles .xu and .json5 files. |
A full app project with typed source folders, live reload, optional server-side rendering and a plugin model. |
Both paths compile down to the same document model the Xuda platform already runs. A Slim page, a CLI component and a Studio-authored component all go through the same HTML parser module, which is why a document authored in one surface runs in the others.
The product is made of these areas:
| Area | What It Is For |
|---|---|
The xuda() constructor |
Boots the runtime into a DOM element. One global, one call, arguments matched by type rather than position. |
The xu-* attributes |
The whole authoring vocabulary: 18 attributes plus two suffixed families, xu-on:<event> and xu-exp:<attr>. |
The xu script API |
A 15-method object handed to every javascript program, covering fields, events, table reads and writes, other programs, platform calls and the workspace drive. |
| Workflows | The step lists behind events and actions. 24 actions, 9 lifecycle event types. |
| Xuda Slim | The no-install path. One script tag, one <template>, one constructor call. |
| Xuda CLI | The project path. npm create xuda-cli@latest, then dev, sync and clean-readmes. |
| Xuda Studio | The visual authoring surface for the same documents, with a live preview panel. |
| The project document model | Every unit of an app is one document with a menuType from a closed list of 12 values. This is the shared format. |
Before You Start
What you need depends entirely on which path you take.
For the Slim path you need nothing. A text editor, a browser and one HTML file. No account, no npm, no plan.
For the CLI path you need Node.js 18.17.0 or newer. That is the engine floor the CLI declares. The CLI itself has exactly three dependencies, express, socket.io and chokidar, and the project scaffolder has none, so installation is small and fast.
For Studio, cloud projects and deployment you need a Xuda account. Local development against either path never calls a plan-gated method, so building costs nothing. Deployment is the part your membership plan actually buys. See Plans And Limits.
Four honest notes before you begin:
- Cloud sync is not something to build a workflow on today.
xuda-cli syncruns a precondition check that the platform method catalog cannot currently satisfy, and connected mode needs platform modules that a normal npm install of the CLI does not ship. Treat the CLI as a local toolchain for now, and use Studio when you want your work in the cloud project. Step 9 covers this in full. - Xuda Slim does not carry the reactive signals engine. The Slim bundle deliberately leaves it out, along with a few other runtime files. Anything that depends on signals, keyed list diffing or the
xu-if / xu-else-if / xu-elsesibling chain exists only in the full platform bundle. The CLI's bundled runtime does not carry it either. xu-routeandxu-progdo not exist. They appear on the framework's marketing page but there is no handler for either in the runtime. Routing is done withrouteprograms and theroute_idandmenu_idsession values, and a Slim program is selected with<template id="...">plusprog_id.- Do not set
build_idinxuda.config.js. The remote build path it turns on targets two endpoints that have no implementation, so it will fail.
Step 1: Choose Slim Or The CLI
This is the only decision you have to make before writing anything, and it is reversible, because both paths produce the same document model.
Choose Xuda Slim when the unit of work is a page. You have an existing site, a landing page, a marketing page, a widget inside somebody else's CMS, or you just want to try the attribute model in five minutes without installing anything.
Choose Xuda CLI when the unit of work is an app. You want more than one screen, shared state across screens, tables, server-side data programs, a plugin, server-side rendering, or a project you will eventually deploy.
If you are undecided, start with Slim. The attributes you learn there are the same attributes the CLI compiles to, so nothing is wasted.
Xuda Slim User Guide covers the Slim decision in more depth, including what Slim is not, and Xuda CLI User Guide does the same from the CLI side. This guide does not repeat either.
The result is a path chosen, and either way the next thing you write is markup with xu-* attributes on it.
Step 2: Make One HTML Page Reactive
This is the shortest possible complete result, and it needs no project.
- Create an
index.htmlanywhere. - Load the Slim runtime. The supported way to get it is the npm package
@xuda.io/xuda-runtime-slim-es, which is public and free. If you have a deployed Xuda app, the platform also serves the runtime bundle from your own app domain at/cdn, and an unminified build at/cdn/debug. - Put your markup inside a
<template>and give it an id. Every<template>on the page becomes a program keyed on its id. A template with no id becomestemplate_<index>, and the first template on the page becomes the defaultprog_id. - Decorate the markup. Seed state with
xu-store="{'count': 0}", bind text withxu-exp:xu-content="'Count: ' + @count", and mutate on click withxu-click="{'@count': @count + 1}". - Call the constructor after
DOMContentLoaded:
const app = new xuda(document.body, { prog_id: 'counter' });
app.on_mounted(() => console.log('mounted'));
- Confirm it booted. The call returns an object with a single method,
on_mounted(fn), which subscribes to theon_mountedevent dispatched ondocument.body. You can also pass a callback as a third argument and it will be invoked with("xuda_ready", SESSION_ID, SESSION_OBJ).
Two things worth knowing at this point. First, the constructor matches its arguments by type and not by position, so an element, an options object and a function can be passed in any order. Second, in Slim the mount element is optional: leave it out and the runtime falls back to document.body and logs a warning rather than failing.
Xuda Slim User Guide has the friendly walkthrough of the three Slim modes and the first-day mistakes, and Xuda Slim is the full technical reference for the constructor, the options, the project_data shape and the attribute value parsing rules. Read those for the detail. This step only exists to show you where Slim sits in the product.
The result is a plain HTML file that reacts to a click with no build tooling anywhere in the loop.
Step 3: Scaffold A Real Project
When one page is no longer enough, move to the CLI. In a terminal:
npm create xuda-cli@latest my-app
cd my-app
npm install
npm run dev
The scaffolder writes package.json, xuda.config.js, App.xu, index.html, eleven typed source folders, a README guide inside each folder, and a first node_modules/.project_data/globals.json. The generated package.json already declares the Xuda database plugin and the Tailwind framework plugin as dependencies, xuda-cli as a dev dependency, and the scripts dev, sync and clean:readmes.
npm run dev prints the URL it is listening on, by default http://localhost:3000. Open it. index.html is served as the shell and App.xu is mounted into #app automatically, because the scaffolded config sets entry: 'index.html' and no other component claims that file. App.xu always compiles to the program id app.
Edit App.xu and save. The watcher recompiles the project, regenerates the runtime documents, and pushes a reload over a socket.io channel, so the browser refreshes itself.
Once the folder README guides have taught you what you need, npm run clean:readmes removes them. It only deletes the ones the scaffolder generated, leaves any README you wrote yourself alone, and reports removed, skipped and missing counts separately.
Xuda CLI User Guide explains the layer model, what every folder is for and the first-day workflow in detail. This step only covers getting from nothing to a running local app.
The result is a project on disk that rebuilds and reloads every time you save a file.
Where The Compiled Documents Live
Your sources are .xu and .json5 files. The CLI compiles them into runtime JSON documents, one globals.json plus one file per program, and the canonical location for those is node_modules/.project_data/. Stale files there are deleted on every compile.
You may see a project_data/ folder or a root .project_data/ folder mentioned in older material or left over in an older project. Those are legacy input directories, still read during migration only. Do not write to them and do not treat any of these as your source: the .xu and .json5 files are the source, and everything under .project_data is generated output.
Step 4: Build A Screen From Source Blocks
A .xu file is a block file, not a JavaScript module. Each block is one concern, and the object blocks are parsed as JSON5-style literals.
| Block | What Goes In It |
|---|---|
<meta> |
The component's id, menuTitle and optional uiFramework. |
<params> |
The in and out interface of the component. |
<fields> |
Local state, for example show_panel_v: { type: "boolean", value: false }. |
<actions> |
Named workflows you can call by name from the template. |
<events> |
Lifecycle handlers. |
<datasource> |
The data binding for a data program. |
<template> |
The markup. |
<script> |
A client mount module whose default export receives a context object and may return a disposer. |
<style> |
Component CSS, collected into one served stylesheet. |
<mount> |
A file and a selector, to mount this component into an existing HTML page. |
Inside <template> the compiler accepts friendly aliases and rewrites them into runtime markup for you:
| You Write | It Compiles To |
|---|---|
<single-view>, <multi-view>, <panel> |
xu-single-view, xu-multi-view, xu-panel |
bind="search_v" |
xu-bind |
if="@show_panel_v" |
xu-exp:xu-render |
for="@students_v" |
xu-for plus xu-exp:xu-for |
:title="@name_v" |
xu-exp:title |
@click="togglePanel" |
xu-on:click |
@click.stop, @click.prevent |
stopPropagation, preventDefault |
The folder a file sits in decides what kind of unit it becomes. The mapping is deterministic and enforced in one place:
| Source Location | Unit Type |
|---|---|
App.xu |
component, always compiled to program id app |
components/**/*.xu |
component |
globals/** |
globals |
data/get/** |
get_data |
data/set/** |
set_data |
data/batch/** |
batch |
apis/** |
api |
scripts/** |
javascript |
alerts/** |
alert |
tables/**.table.json5 |
table |
routes/**.route.json5 |
route |
ai-agents/**.agent.json5 |
ai_agent |
Xuda CLI User Guide covers what each of these folders is for and when to reach for each one. Do not put root app UI in components/, and do not mix shared state with local screen state: that guide explains both.
The result is a component compiled into a runtime document, rendered in the browser, reloading on save.
Step 5: Add A Table And Bind A Screen To It
Data is a separate unit type from UI on purpose, so the same query can feed more than one screen.
- Create
tables/student-profiles.table.json5with anid, afieldslist and at least one entry underindexes. - Create
data/get/LoadStudents.xuwith a<datasource>block in the readable wrapper form, naming the table, the filter, the output field, and optionallyrealtime: trueand alimit. - In the component, add a workflow step with the
get_dataaction, pointing at the data program and naming the field the rows land in. - Render the rows with
for="@students_v", and read each row inside the loop through the iterator value. The iterator names default to_FOR_VALand_FOR_KEYand can be renamed withfor-valandfor-key.
When the datasource is marked realtime: true, a change to the underlying table pushes a refresh to that datasource without a page reload.
Xuda Studio Component Datasource Options User Guide documents the datasource options themselves, and Xuda Dashboard Project Data User Guide covers working with the project's tables from the dashboard.
The result is a list on screen that comes from a real table and updates itself when the table changes.
Step 6: Write Script Logic With The xu API
When a workflow step is not enough, write a javascript program. In the CLI path that is a file under scripts/; in Studio it is a javascript unit.
Every javascript program is handed an object named xu with 15 methods on it. That object is the framework's script API, and it is the same in both paths:
| Group | Methods |
|---|---|
| Fields and events | get_field_value, set_field_value, invoke_event |
| App tables | dbs_create, dbs_read, dbs_update, dbs_delete |
| Calling other units | call_javascript, call_project_api |
| Calling out | call_system_api, call_external_api |
| Telling the user or the log | alert, log |
| Workspace drive | read_drive, write_drive |
Four practical notes that save an afternoon:
xu.dbs_readreturns the rows as an array of{ id, value }objects and defaults to a limit of 999. Leave thefieldsprojection argument empty; passing one breaks the server read.xu.set_field_valueis the idiomatic way to hand a result back to a component. Writing the field updates the datasource and refreshes anything bound to it.xu.call_system_apiposts to a platform method and attaches the app id and app token for you, so it inherits whatever clearance the method it targets requires.xu.call_external_apitakes the url without thehttps://prefix.
The full method signatures, including which arguments are required, are in the Xuda JavaScript Framework API Reference.
The result is a script that can read and write your tables, call other programs and call the platform, without you wiring up any transport.
Step 7: Author And Preview In Studio
Studio is the visual surface over the same documents. It is worth opening even if you prefer files, because the preview panel is the fastest way to see one component in isolation.
Open the project in the dashboard and press the Studio button in the project header. It is shown for studio-backed app types. Select a component in the tree and press the preview play button; the runtime boots inside the preview panel. A device picker lets you preview at a specific viewport.
One quirk to know about the preview, because it looks like a bug and is not: writes land in the real database, but preview reads come from a local draft store. A row you just wrote can look missing for a moment right after you write it.
Studio has a full set of guides and this one does not duplicate them. Start with Xuda Studio User Guide for the overall shape, then go to the per-tab guides as you need them: Xuda Studio Component UI Tab User Guide, Xuda Studio Component Fields Tab User Guide, Xuda Studio Component Events Tab User Guide, Xuda Studio Component Datasource Options User Guide, Xuda Studio Globals User Guide, Xuda Studio Events Workflow User Guide and Xuda Studio UI Live Preview And Console User Guide.
The result is the same component you wrote as a file, running in an isolated preview you can point at a device size.
Step 8: Turn On Server Side Rendering
Server rendering is one line of configuration in xuda.config.js.
Set ssr to first_page to server render the entry program and have the client take over from there, or to full to server render the app and have the client hydrate it. Leave it at none to render entirely in the browser. Any other value is rejected when the project loads, with an Invalid SSR mode error.
Restart npm run dev after changing it. The CLI renders the entry program to a string in a sandboxed context, injects the markup into the shell, and hands the client a render payload to continue from.
Underneath, this maps onto three render profiles the runtime normalizes at boot: where logic runs, how the page is rendered, and what the client does with server markup. You do not have to set those yourself when you use ssr.
The result is a first paint that arrives as HTML rather than as an empty shell.
Step 9: Get An API Key And Understand Cloud Sync
The CLI has a sync command whose intent is to pull your cloud project's documents down into local source files and push your local changes back up. It needs a developer API key.
Getting a key. In the dashboard open Developers, then the API Keys tab, then press Create. Give the key a name, optionally restrict Allowed Domains, and choose an access mode:
| Access Mode | What It Does |
|---|---|
| Full access | Everything the account can do over the API, including methods added in future. Internal methods stay excluded. |
| Custom access | Only the methods you tick on the per-method Allow and Deny list. |
The same component appears on a project's own API Keys tab, scoped to that one app. Xuda Dashboard Project API User Guide covers managing keys from the project side.
What you can do with a key today. A key with the right access can call the app data methods directly over HTTP: dbs_read, dbs_create, dbs_update and dbs_delete. That is a real, working integration surface. The Xuda JavaScript Framework API Reference documents their parameters.
What sync cannot do yet, stated plainly. Do not plan around xuda-cli sync:
- Its own precondition check asks the platform to confirm four methods are callable, but two of those methods are dashboard-session methods that by design never appear in the catalog listing it checks, and the other two are not registered as callable platform methods at all. The check therefore cannot pass.
- Anything that needs
api_key, including upstream proxying andsyncitself, loads platform modules from disk that a published npm install of the CLI does not ship.
Until that changes, treat the CLI as a local toolchain and use Studio as the way your work reaches the cloud project. Nothing about local development, dev, live reload, SSR or plugins depends on any of this.
The result is a working API key you can use against the data methods, and no surprises later about what sync does.
Step 10: Deploy
The framework is the engine every deployed Xuda app already runs on. The runtime bundle is embedded by the deployment templates with a build-scoped cache buster, so a deployed app always loads the runtime build that matches it.
Deployment itself is a platform feature and not a framework command. There is no CLI deploy command: the CLI has three commands and none of them ships anything. Deploy from the dashboard.
Xuda Deploy Overview User Guide explains the deployment types and how to choose between them, and each deployment type has its own guide.
The result is the same document model you have been editing locally, served from the platform.
Constructor Options Explained
These are the options most people need. Every one of them resolves through the same six-step chain: URL query parameter first, then an attribute on the root element, then options.params[key], then options[key], then a cookie, then localStorage. That is why a Slim page can be reconfigured from a query string with no code change.
| Option | What It Does |
|---|---|
prog_id |
The program to render first. Must match a program key or a <template id="...">. In Slim template mode it defaults to the first template's id. |
project_data |
An inline project definition with globals, tables and programs. Slim's main non-template input mode. |
domain |
The host used to resolve runtime assets and platform calls. Defaults to the current host. |
app_id |
The platform app id. Defaults to unknown. Required for the full remote project loader, optional in Slim when you supply project_data. |
engine_mode |
Defaults to miniapp. Studio's preview uses live_preview. |
params |
Supplemental session values by key, consulted third in the resolution chain. |
url_params |
Extra program input values merged into the session's url params. |
debug_js |
Turns on debug behavior in the runtime. |
route_id and menu_id |
Route-driven startup and which route menu entry to open. This is how routing works. There is no routing attribute. |
gtp_token and app_token |
The platform session token and the app session token. |
ssr_payload |
The server render payload. Also read from the page when not passed. |
app_build_id and app_version |
Cache busting for assets, and the version printed in the runtime banner. |
Full types, defaults and the remaining options are in the Xuda JavaScript Framework API Reference.
Attributes Explained
The entire authoring vocabulary is 18 attributes plus two suffixed families. That is the whole surface, and it is worth reading once end to end because it is short.
| Attribute | What It Does |
|---|---|
xu-bind |
Two-way binding between an input element and a field. The value is the bare field id, with no @ prefix. |
xu-render |
Conditional render. The element is removed from the DOM when the expression is falsy. |
xu-show |
Conditional visibility through CSS display. The element stays in the DOM. |
xu-for |
Repeats the element for each item of an array or object. |
xu-for-key |
Renames the iterator key variable. |
xu-for-val |
Renames the iterator value variable. |
xu-class |
Class names mapped to condition expressions. |
xu-store |
Parses an object and stores its keys and values as dynamic fields. The easiest way to seed local state. |
xu-text |
Sets inner text, usually driven through xu-exp:xu-text. |
xu-html |
Sets raw inner HTML, usually through xu-exp:xu-html. |
xu-content |
Sets text content, usually through xu-exp:xu-content. Static text belongs in the node's own content instead. |
xu-ref |
Registers the element under a name so expressions and scripts can target it. |
xu-style |
Scoped CSS. Selectors are automatically prefixed with the node's own id. Must contain no quote characters. |
xu-style-global |
The same, injected globally with no scoping. Same no-quotes rule. |
xu-script |
A bare function (el) { ... } expression, called with the DOM element when the node first becomes visible. Must contain no quote characters. |
xu-cdn |
Loads an external CSS or JS resource by URL before the node renders. |
xu-ui-plugin |
Attaches and configures an installed UI plugin on the element. |
xu-viewport |
Viewport-conditional rendering logic. |
The two families:
| Family | What It Does |
|---|---|
xu-on:<event> |
An event listener. The value is always an array of handler objects, each of which can carry a workflow. |
xu-exp:<attr> |
Evaluates an expression and applies the result to <attr>. Works for plain HTML attributes and for xu-* attributes alike. |
One sharp edge: xu-exp:class replaces the static class attribute entirely rather than merging with it. If you need both, put the static classes into the expression.
Eight shorthand event attributes are normalized into full xu-on:* workflows for you, so a value like xu-click="count++" works with no handler JSON: xu-click, xu-dblclick, xu-contextmenu, xu-focus, xu-keyup, xu-change, xu-blur, xu-init.
Four tags are yours to author: xu-single-view, xu-multi-view, xu-panel and xu-teleport. Other xu-* tags you may see in a rendered page are runtime-internal and the validator will flag them if you author them yourself.
Nine names are reserved and must never be used as a field id: _NULL, _THIS, _FOR_KEY, _FOR_VAL, _ROWNO, _ROWID, _ROWDOC, _KEY, _VAL.
Attributes run in ordered phases per element. xu-cdn, xu-style, xu-render, xu-for-key and xu-for-val run before the node is built; xu-bind, xu-class, xu-script, xu-ui-plugin and xu-ref run after it. That ordering is why an xu-cdn resource is available to an xu-script on the same element.
CLI Commands Explained
The CLI is three commands, plus help. None of them takes a flag: any extra argument is a hard error, and all configuration lives in xuda.config.js.
| Command | What It Does |
|---|---|
xuda-cli dev |
Compiles every .xu and .json5 source into runtime documents, serves the app over a local server, opens a live reload channel, and watches the project for changes, excluding node_modules, .git and the generated document folders. |
xuda-cli sync |
Intended to pull cloud project documents down and push local changes up. See Step 9 for why this is not usable today. |
xuda-cli clean-readmes |
Deletes the folder guide READMEs the scaffolder generated. Custom READMEs are preserved and reported separately. |
xuda-cli --help |
Prints the command list. -h also works. |
dev runs the app without any cloud connection at all. It answers five local endpoints itself so the app has everything it needs, and in that isolated mode it also handles the four table read and write operations locally. Anything else is proxied upstream when an api key is configured, and refused with a clear message when one is not.
xuda.config.js Options Explained
| Field | What It Does |
|---|---|
entry |
The app entry. An .html filename is served as the shell; anything else is treated as a program id. Defaults to app. |
port |
The local dev port. An integer from 1 to 65535. Defaults to 3000. |
ssr |
none, first_page or full. Defaults to none. Any other value throws when the project loads. |
api_key |
A developer API key. apiKey is accepted too. Required by sync. |
build_id |
A remote build target. Leave this unset: the endpoints it targets are not implemented. Setting it also makes api_key mandatory. |
Plans And Limits
This is the short version: the framework itself is free and has no plan gate.
- Nothing in the local path costs anything. Neither Slim nor the CLI calls a method that carries a minimum plan. There is no framework plan ladder, no per-unit fee, no build quota and no free-tier limit on framework usage anywhere in the product.
- The npm packages are public and free.
xuda-cli,create-xuda-cli, the Slim ES runtime package and the worker bundle packages are all published openly. The CLI packages are pre-1.0, which is a fair signal of how settled the surface is. - The API keys themselves are free. Full access and custom access are two access modes, not two price points.
What your account plan buys is deployment. Deployment is listed as not available on the Free plan and available from Pro upward, so the practical rule is: build for free, pay when you ship.
| Plan | What It Adds That Matters Here |
|---|---|
| Free, $0 | Studio, 5 projects, 1 team member, 15 GB drive, 30 AI credits. Deployment is not included. |
| Pro, $49 | Deployment becomes available. 50 projects, 2 members, 50 GB drive, 600 AI credits. |
| Team, $149 | 250 projects, 100 members, 250 GB drive, 1600 AI credits. |
| Agency, $399 | 1000 projects, 1000 members, 500 instances, 1000 GB drive, 3500 AI credits, Marketplace access. |
| Enterprise | Three enterprise tiers above Agency, starting at $1999. |
Two limits that are not about billing but will shape what you build:
xu.dbs_readdefaults to a limit of 999 rows. Page deliberately rather than assuming you got everything.- Slim is a full runtime, not a micro-library. It is meaningfully smaller than the platform bundle, because it leaves out the reactive engine and several other files, but do not plan a page budget around a specific kilobyte figure you have seen quoted. Measure the build you actually ship.
Troubleshooting
| What You See | What It Means | What To Do |
|---|---|---|
| Nothing renders on a Slim page | One of four things is wrong. | Check in this order: the bundle actually loaded, prog_id matches a real template id or program key, the program exists in project_data.programs, and the mount element is a real element. |
A console warning that the runtime fell back to body |
You did not pass a mount element. Slim allows this and mounts on document.body. |
Nothing, unless you meant to mount somewhere specific. Then pass the element. |
The full bundle errors instead of falling back to body |
Only Slim makes the mount element optional. | Pass a real mount element. |
| An object-valued attribute behaves like a string | The attribute value did not parse. xu-store and xu-class take object literals. |
Check the quoting. Attribute values are parsed as JSON5-style literals, and xu-style, xu-style-global and xu-script must contain no quote characters at all. |
| Your static classes disappear when a condition fires | xu-exp:class replaces the static class attribute rather than merging with it. |
Include the static class names inside the expression, or use xu-class for conditional classes and leave class alone. |
xu-if, xu-else-if or xu-else does nothing |
Those live in the reactive renderer, which is in the platform bundle only. Slim and the CLI's bundled runtime run the legacy renderer. | Use xu-render or xu-show with an expression on each branch. |
Studio warns that xu-if is an unknown attribute |
The validator's attribute registry does not know about the sibling chain yet, even though the reactive renderer implements it. | The warning is the validator being behind, not your markup being wrong. Prefer xu-render if you want a clean validation pass. |
xu-route does not do anything |
There is no such attribute. It appears on the marketing page but has no implementation. | Use a route program with a routeMenu, and drive it with the route_id and menu_id session values. |
xu-prog does not do anything |
Same: no implementation. | In Slim, select a program with <template id="..."> plus prog_id. |
A field with a name like _VAL behaves strangely |
You used a reserved iterator name as a field id. | Rename the field. The nine reserved names are listed under Attributes Explained. |
| A screen visibly renders twice when it opens | By design. The reactive engine performs a takeover after the first render, on every screen for every visitor. | Nothing. If you need to rule it out while debugging, the engine can be switched off for your own browser only, then switched back. |
| The dev server rejects your command | The CLI takes no flags. Any extra token is an error such as Unexpected arguments for "dev". |
Move the setting into xuda.config.js. |
Invalid SSR mode when the project loads |
ssr is set to something other than none, first_page or full. |
Fix the value in xuda.config.js. |
build_id requires api_key |
You set build_id in the config. |
Remove build_id. The remote build path it turns on is not implemented, so it cannot succeed even with a key. |
Unable to load local CPI modules for api_key mode |
Connected mode needs platform modules that a published CLI install does not ship. | Work in local mode. Do not configure api_key in the CLI for now. |
sync fails its access check |
The precondition check cannot pass against the current method catalog. See Step 9. | Use Studio to get work into the cloud project. |
method "..." not exist from a platform call |
The method name is not in the platform's registered catalog. | Check the spelling. If you were calling one of the methods sync uses internally, note that two of them are not registered as callable methods. |
| A component references a UI framework that is not installed | The plugin is not in package.json. This is a hard error, not a warning. |
npm install the plugin package, then restart dev. |
| A row you just wrote looks missing in the Studio preview | Preview writes go to the real database but preview reads come from a local draft store. | Reload the preview, or verify the row from the project's data screens. |
| Your edits vanish after a rebuild | You edited a generated document instead of a source file. | Edit the .xu and .json5 files. Everything under node_modules/.project_data/ is regenerated and stale files there are deleted on every compile. |
Corrections To Older Material
Some of the earlier framework documents were written against a developer's local checkout and have drifted. Here is what is true now:
- The generated runtime documents live in
node_modules/.project_data/. Older text refers to "generated runtime docs" without a location, and you may seeproject_data/or a root.project_data/mentioned. Those two are legacy import-only paths kept for migration. - The CLI has three commands, not two.
clean-readmesis missing from older command lists. - Do not load the runtime from a
dev.host. Older Slim examples point the script tag at Xuda's development host, which is not a production source. Use the public npm package@xuda.io/xuda-runtime-slim-es, or serve the bundle from your own deployed app domain. - Ignore absolute file paths in older guides. Several of them link to folders on a developer's laptop, which resolve to nothing for you. Everything you need is either in this guide, in the API reference, or in the package README that ships with the CLI.
- The Slim directive list in the older reference is incomplete about what Slim leaves out. Slim carries no reactive engine, so signals, keyed list diffing and the
xu-ifsibling chain are platform-bundle features, not Slim features.
Extra Feature Tips
- Reconfigure a Slim page from the URL without touching the code. Startup values resolve from the query string first, ahead of the root element attribute, the options object, cookies and localStorage. That makes a single deployed HTML page reusable across several configurations, and it makes debugging a customer's page much easier.
- Use
xu-storeto seed state before you reach for a fields block. For a small page it is the fastest path from static markup to reactive markup: one attribute holding an object literal, and every key in it becomes a field. - Let the folder decide the unit type. The CLI's source-to-unit mapping is deterministic, so putting a file in the right folder is the whole of the configuration. Fighting it by putting data logic in a component or root UI in
components/costs you more than it saves. - Keep data in
data/geteven when only one screen uses it. A datasource markedrealtime: truerefreshes itself when the underlying table changes, and a second screen that needs the same query later gets it for free. - Reach for a workflow before you reach for a script. There are 24 workflow actions and 9 lifecycle event types, which covers most of what a screen needs. A
javascriptprogram is the right answer when you need real logic, not when you need to set a field. - Author in one surface, run in all of them. Slim, the CLI and Studio share one HTML parser and one document model, so a component you build in files opens in Studio, and one you build in Studio runs in a CLI project. Use whichever surface suits the task in front of you rather than committing to one.