LuxelEspañol

Luxel v0.2 · Reference · part 5 of 5

Luxel compiler diagnostics (5)

CodeRuleSeverityWhenWhat to write instead
LUXEL-E066logouterrorSprint 12.3 (C15): a ‹Logout> the build cannot compile to its sign-out form. The form posts to one fixed address and the server answers with one fixed redirect, so an app has one destination: to (or, without it, the view's loginView) names no view or page of luxel.config, or one not served in the variant of home, or one that is not public (the visitor arrives without a session, and the host's route guard would redirect a private view to its loginView); two ‹Logout> of the app name different destinations; the ‹Logout> is inside a form (as="form": a form cannot hold another); or the view is served in a variant that does not fill templates (projection: 'slots'), where the form does not existGive every ‹Logout> the same to, a public view served in the variant of home, and place it outside the forms; in a view of another kind of variant, sign out with an ‹Action> whose handler calls ctx.signOut()
LUXEL-E057throttled-ignorederrorSprint 11 (red team RT-4): accountLimit: 'handler' and a sign-in handler that never reads ctx.throttled (the per-account limit would be gone)Read ctx.throttled and ask for a second factor, or use refuse / delay
LUXEL-W004sign-in-without-identitywarningSprint 11 (red team RT-1): a public view's handler signs in and the view names no identity (only the per-address limit applies)Add identity: '‹username field>' to the view
LUXEL-E056static-load-sessionerrorSprint 11 (ADR-049): the load of a static view reads session, userId, roles or scopes (it runs once, at start-up, for everyone; at run time its context has no session)Show only what is the same for everyone, or drop static: true
LUXEL-E055read-writeserrorSprint 11 (ADR-050): the handler of a read event (effect: 'read') reads ctx.eventId, holds an SQL statement that writes, or calls a store's write() (its own text; a helper's write fails on the read-only connection). Sprint 12: code outside the handler that reads a read's event id throws LUXEL-E055: … is a read, and a read has no event id at run timeMake it a write (remove effect: 'read'), or keep the handler to reading
LUXEL-W001canvas-missing-slotwarningA zone has no slot in the Canvas layout (Luxel Visual will not paint it)Add the slot
LUXEL-W002not-verifiable-staticallywarningluxel check: a policy needs a measurement (initialTransferKiB, scalability); the check reports it as NOT VERIFIABLE STATICALLY with any static lower boundMeasure it (examples/bench, a load test)
LUXEL-W003critical-css-over-limitwarningSprint 8: a page's CSS is above the 4 096 B inline limit and even its first-paint part (critical CSS) is above it, so the whole CSS is linked and blocks the paintTrim the rules the template uses, or split the view

luxel check

luxel check [--json] [--root ‹dir>] [--out ‹dir>] [--surface ‹file>] runs the policies of luxel.config.ts (policies) over the compiled output (codes E030–E039, W002), and, with --surface, checks a dynamic surface before projection (E032–E035, E039–E042). The same checks are a library (@luxel-framework/check: checkProject, checkSurface) with the same codes; the host runs checkSurface on every surface an agent proposes and refuses it (422) on any error. Text and JSON output have the shapes above.

Examples

The examples below are real output: the corpus view packages/compiler/test/project/src/views/e001-onclick.view.tsx, compiled with luxel build.

Text:

src/views/e001-onclick.view.tsx:8:7 - error LUXEL-E001 (no-function-handler): "onClick" on ‹Action> is a function. Functions never run in the browser in Luxel: there are no event handlers. 8 | ‹Action id="pay" event="transfer.submit" onClick={pay}>Pagar‹/Action> | ^ suggestion: Logic runs on the server: use ‹Action event="..."> and handle the event with defineEvent. Local presentation changes go in onSuccess (clear, focus).

JSON (luxel build --json):

{ "code": "LUXEL-E001", "severity": "error", "file": "src/views/e001-onclick.view.tsx", "line": 8, "column": 7, "rule": "no-function-handler", "message": "\"onClick\" on ‹Action> is a function. Functions never run in the browser in Luxel: there are no event handlers.", "suggestion": "Logic runs on the server: use ‹Action event=\"...\"> and handle the event with defineEvent. Local presentation changes go in onSuccess (clear, focus)." }

The corpus has 32 erroneous views, one per file, each with its expected code and position on its first line. They cover 27 of the first 30 error codes (LUXEL-E000 to LUXEL-E029) and LUXEL-E066 (a ‹Logout> inside a form). The three left out of the first 30 are project-level checks, not view mistakes: LUXEL-E023 (Canvas layout), LUXEL-E024 (config) and LUXEL-E027 (exposure guard). packages/compiler/test/compiler.test.ts checks every corpus view in both formats.

Edit this page on GitHub

This page: 7.9 KB of JavaScript (Luxel's shared runtime), 0 KB from your app.

Measured when the site is built: the runtime files this page loads, compressed as they are sent.

Made by IntiOps. The Luxel 0.1.0 betas are on npm (0.1.0-beta.1, 0.1.0-beta.2), with an alpha of 0.2 (0.2.0-alpha.1): no external security review yet.