For contributors
API review (v1.0)
This review lists what a site, a plugin or a test touches, and what had to change before it was frozen. After v1.0, only compatible changes are allowed, such as new optional arguments and new methods, so renames and reshapes belonged here.
Surfaces
| Surface | Where | State |
|---|---|---|
| Template variables | $cms, $page, $site, $attributes |
see 1, 4, 7 |
| Components | <x-block>, <x-repeat>, <x-form>, <x-seo>, <x-importmap> |
consistent |
| Page files | pages/ layout, [param], [...catchall], [slug].{type}.php, _types/, _404.php, _maintenance.php, _middleware.php, route files |
consistent |
| Page functions | #[Get] #[Post] #[Put] #[Patch] #[Delete] #[Query] #[Method], #[Middleware] (repeatable), #[Cached], #[Paths], #[CrossSite], #[ApiKey], Webhook::verify(), validate() |
see 2 |
| Middleware | BasicAuth, Cache, Cors, Headers, NoIndex, RateLimit, RequireEditor, RequireRole, Skip |
consistent. Maintenance and Redirects are built in (see 1) |
| Config | LapisConfig |
see 3 |
| Definitions | Data\Table + Data\Columns\*, Forms\Form + Forms\Fields\*, Settings\Fields\* |
see 2, 5 |
| Plugins | Plugin, Extend (with panel()), BlockType (with fields), Panel, events (Lapis\Events\*) |
see 6 |
| Editor JS | lapis (version, state, h, api, toast, t, registerPanel, registerBlockType) |
see 8 |
| Helpers | Lapis\cms(), setting(), asset(), validate() (texts: Tempest's translate()) |
consistent |
| Tests | Lapis\Testing\LapisTestCase (state builders, visit, api(), assert*) |
consistent |
| Console | ./lapis … (Tempest's under ./lapis tempest) |
done |
Findings
Clear fixes (no design choice)
- Internals look public.
Cms::repeatView(),enterItem(),leaveItem(),blockView(),blockValue()serve the components, andMiddleware\MaintenanceandMiddleware\Redirectsrun by themselves. Mark them@internalso they are not frozen. - Docblock names a method that does not exist:
Cms::imageVariant()says$cms->image(...). Data\Columns\Slug(from:, label:)is the only definition whose first parameter is not the label. Make itSlug(label: 'Path', from: …)(named arguments keep working).
Decisions
LapisConfigarrays → config objects (as the definitions already are):imageSizes: ['card' => new ImageSize(640, 480, fit: 'cover')],schema: new SchemaOrg(type: 'Bakery'),ogImage: new OgImageStyle(background:, color:, accent:),turnstile: Turnstile::fromEnv()(the keys in.env). Today these are untyped arrays whose keys only the docs know.- Three
Textclasses.validate()in page functions takesData\Columns, while forms useForms\Fieldsand settingsSettings\Fields. A page form that validates with data columns imports the "wrong" family. Proposal:validate()also acceptsForms\Fields(and the docs show those first). The families stay separate, because their options differ (index/unique,placeholder/autocomplete,group/default). - Event names: most are
NounPastVerb(PageCreated,MediaDeleted), some are not:Uploaded→MediaUploaded,Published→BlocksPublished,Discarded→DraftsDiscarded.EditorStateBuilding(a hook while building) stays. $pageis mutable.Page's properties are public and writable, so a template can change$page->titlefor everything rendered after it. Make themreadonly.- Editor JS
lapis.stateis the editor's whole internal state (including the CSRF token and panel data), and the example plugin reads and writeslapis.state.settings.values. Freeze a small surface instead:lapis.user,lapis.locale,lapis.page,lapis.can(ability),lapis.plugin(name)(data fromEditorStateBuilding::plugin()),lapis.settings.get(key)andlapis.settings.set(key, value)(saves), and keepstateout of the API. Cms::editing()next toCms::isEditor(): renamed toisEditing()(signed in and edit mode on).
Marked internal after the review (2026-11-27)
The classes behind the frozen surfaces are @internal: View\BlockView, Content\BlockTypes, BlockKind, BuiltInBlock, PluginBlock, Support\HtmlSanitizer, SafeUrl, Html, Http\EditorApi, Auth\User (the Tempest model behind sign-in: sites and plugins use Auth), and Validation\ValueType with its rules (Validation\Rules\*). A plugin reaches block types through BlockType and templates through <x-block>. These classes may change in a minor version.
Added before v1.0
Before the first release, these public pieces were finalized on top of the table above:
LapisConfig::$captcha(Lapis\Forms\Captcha, withTurnstile,HCaptcha,ReCaptchaandFriendlyCaptcha) replacedturnstile:.Data\Records::paginate()returns Tempest'sPaginatedData.data-lapis-fragmentreturns a single marked element to htmx requests targeting it.Events\AssetsCompilingandEvents\DoctorCheckinglet plugins hook into./lapis assets:compileand./lapis doctor, andEvents\PageRenderedaddsaddToHead()andaddToBody().Lapis\SiteCodeWasInvalidis thrown on invalid config, table, form or plugin definitions.- Plugins may ship
lang/messages.<locale>.ymlandcomponents/x-*.view.phpalongsidesrc/, discovered automatically.
Not changing
- Middleware constructor names (
ttl,seconds,max) read naturally where they are used. - The
Formstyling parameters (submitClass,successClass,successTitleClass) stay flat, because grouping them buys little. ApiKey('ENV_NAME')defaultLAPIS_API_KEY.