# SpacePress — Full Documentation Corpus Index: https://spacepress.dev/llms.txt --- # Build a SpacePress app You are helping someone build a TypeScript application that compiles directly into native PHP, SQL migrations, and WordPress plugins — headful WordPress by default, zero Node.js in production. Finish with a working local WordPress site they can open and inspect. ## 1. Inspect the current directory Look at what is already in the workspace before scaffolding or asking questions. If the goal is still unclear, ask **one** concise question: *What are you building, and what should editors manage in WordPress?* Do not re-ask anything the user already told you. Choose the matching path: - **Already a SpacePress project (`typedpress.config.ts` exists):** Read `AGENTS.md` and use the `typedpress` MCP server (`schema`, `check`, `docs_search`, `docs_read`). Do not scaffold over it. - **Migrating an existing schema (EmDash, Payload, Sanity, or Zero):** Run `npx typedpress migrate config --from emdash|payload|sanity|zero --out typedpress.config.ts` to convert statically without executing source code. - **Brand new project:** Scaffold with `npm create typedpress@0.3.0 ` (uses the pre-release identifier `typedpress` for CLI, config file, and imports; requires Node.js 22+, no Docker or Rust toolchain). It writes `AGENTS.md`, `.mcp.json`, and 12 skills into `.agents/skills/` and `.claude/skills/`. - **Different existing app:** Ask before replacing its framework or files. ## 2. Read the compiler rules first Read [https://spacepress.dev/rules.md](https://spacepress.dev/rules.md) before writing TypeScript so you follow the exact TS-to-PHP subset, import boundaries, access rules, and safe migration conventions on the first try. ## 3. Build one complete vertical slice 1. **Model the data:** Use `collection()` (or `wp.posts.extend()`) for editorial content backed by WordPress posts (Gutenberg, drafts, revisions, `sync: "content/**/*.md"`), and `table()` for relational SQL data with explicit `access` rules. 2. **Add server logic & pages:** Export `action()` RPC endpoints or `job()` queues from `tp/`, and build at least one headful server-rendered TSX page in `tp/app/` (plus a `"use client"` island if interactivity is needed). Only generate/wire an external frontend (`tp/_generated/client/` or `@typedpress/astro`) if the user explicitly wants headless. 3. **Compile and check:** Run `npx typedpress check` after every edit (`npx typedpress check --fix` fixes lint warnings like `capital_P_dangit`), and `npx typedpress init` after changing `typedpress.config.ts` so `AGENTS.md` stays in sync. 4. **Boot local WordPress and verify:** Run `npm run dev` (or `npx typedpress dev --detach`). Confirm the local site and `/wp-admin/new/` respond cleanly. 5. **Hand back:** Share the local site URL, `/wp-admin/new/` admin URL, what is editable, and any remaining caveats. Do not create production credentials or push to a live site without explicit user approval. ## 4. Reference & discovery - Compiler rules: https://spacepress.dev/rules.md - Full documentation index: https://spacepress.dev/llms.txt - Full documentation corpus: https://spacepress.dev/llms-full.txt - Agent skills catalog: https://spacepress.dev/.well-known/agent-skills/index.json - Local dev MCP server: `npx --no-install typedpress mcp` (read-only docs, live schema, check, and local queries; separate from a running site's authenticated runtime MCP at `/wp-json/mcp/typedpress-`). --- # SpacePress Coding Agent Rules Targets SpacePress v0 ("Istanbul") / `typedpress` CLI `0.3.0` (WordPress 7.1+, PHP 8.2+). ## Core compilation model - **Server TypeScript compiles to native PHP — not Node.js.** Never import Node built-ins (`fs`, `path`, `crypto`, `process`, `buffer`, `child_process`) or arbitrary npm packages inside `typedpress.config.ts`, `tp/app/`, actions, hooks, jobs, or routes. - **Headful WordPress is the default.** Files under `tp/app/**/page.tsx` and `layout.tsx` compile directly into server-rendered PHP inside WordPress. Interactive widgets belong in `"use client"` components compiled to the WordPress Interactivity API. Only wire `tp/_generated/client/` or `@typedpress/astro` when the user explicitly wants a separate headless frontend. - **Never edit `tp/_generated/` or `tp/dist/`.** `typedpress build` regenerates them. Commit `tp/_generated/` (migrations, snapshots, types, plugin lockfile); git-ignore `tp/dist/` and `.tp/`. - **Pre-release identifier:** The framework brand is SpacePress (`spacepress.dev`), while the npm package, CLI binary, config file (`typedpress.config.ts`), `tp/` directory, and imports (`"typedpress"`, `"typedpress:db"`, `"typedpress/app"`, `"typedpress/client"`) use `typedpress` during v0. ## Exact import boundaries - `"typedpress"`: schema & server builders (`collection`, `table`, `global`, `wp`, `taxonomy`, `store`, `product`, `productCategory`, `productTag`, `order`, `action`, `job`, `jobs`, `db`, `mail`, `HttpError`, `defineConfig`, and field builders `text`, `integer`, `boolean`, `richText`, `slug`, `select`, `timestamp`, `ref`, `email`). - `"typedpress:db"`: visitor-scoped kind queries (e.g. `import { posts, tasks } from "typedpress:db"`). **Always prefer `"typedpress:db"` in `tp/app/` pages** because it enforces `.access()` rules automatically. Reserve trusted `db` from `"typedpress"` for `action()`/`job()` handlers after verifying authorization. - `"typedpress/app"`: server page/layout helpers (`Link`, `Content`, `useFormState`, `type PageProps`, `type LayoutProps`). - `"typedpress/client"`: client-only hooks (`useState`, `useLive`) — valid **only** inside files starting with `"use client";`. - `"php/wordpress"`: typed bridges to WordPress core functions and `abilities.call(...)`. ## Data modeling & migrations - Use `collection()` (or `wp.posts.extend()`) for editorial content that needs Gutenberg, drafts, revisions, comments, URL routing, or `sync: "content/**/*.md"`. - Use `table()` for relational application rows (tasks, votes, orders, subscriptions) stored in dedicated SQL tables with `.index([...])` and incremental migrations. - Export kinds, actions, and jobs from `typedpress.config.ts` or any file under `tp/` — they register automatically by export name; `defineConfig()` does not list them. - **Timestamp values:** Pass ISO-8601 strings (`new Date().toISOString()`) when writing `timestamp()` fields — not raw `Date` objects. - **Safe renames:** When renaming a field or column, chain `.was("oldName")` so `typedpress build` emits a `RENAME` migration instead of dropping data. - **WooCommerce checkout:** Whenever a project exports `store()` alongside `tp/app/`, include a public `tp/app/checkout/page.md` containing WooCommerce's native Checkout Block (``). - **Markdown sync:** Avoid raw HTML comments (``) in synced `.md` files and never reuse a deleted document's `uid` for a new file. ## Security & authorization - Declare explicit `access` rules on every `collection()`, `table()`, `global()`, and `action()`, and export `guard` on every custom `route.ts`. - For user-owned rows, return a row filter (`({ user }) => (user ? { ownerId: user.id } : false)`) rather than only checking truthiness; never trust a client-supplied `userId` in an action. - Attach field-level `.access({ read: "admin" })` to sensitive columns so REST, pages, and generated clients strip them automatically. - Annotate `action()` declarations with `readonly: true` or `destructive: true` to guide WordPress Abilities safety checks (`agents: false` opts internal actions out). ## Verification workflow - Run `npx typedpress check` after every edit to `typedpress.config.ts` or `tp/` (`npx typedpress check --fix` applies auto-fixes such as `capital_P_dangit` for proper `WordPress` spelling). - Run `npx typedpress init` after config changes (`npx typedpress init --check` in CI). - Before deploying to production, always run `npx typedpress push --dry-run`, obtain explicit user approval, and verify afterward with `npx typedpress doctor --site --links`. - On WP Cloud (Pressable / WordPress.com), avoid `/files/*` for custom public downloads and copy top-level `public/*.{js,wasm,txt}` files into `/srv/htdocs/` before purging edge cache. --- # SpacePress Quick Start > Go from zero to a running SpacePress application on local WordPress in 3 minutes — no Docker or Rust toolchain required. Source: https://spacepress.dev/quick-start/ ## 1. Scaffold a new project ```sh npm create typedpress@0.3.0 my-app cd my-app ``` ## 2. Start local WordPress ```sh npm run dev ``` ## 3. Check & auto-fix ```sh npx typedpress check npx typedpress check --fix ``` ## 4. Sync Markdown content ```sh npx typedpress sync ``` ## 5. Build & deploy Deploy to Spacefast, Pressable, WordPress.com, or any self-hosted WordPress site: ```sh npx typedpress build npx typedpress login https://example.com && npx typedpress push ``` --- # The SpacePress Handbook > End-to-end engineering handbook covering every layer of SpacePress — Rust/OXC compiler, schemas, SQL migrations, access control, actions, jobs, TSX pages, WooCommerce, React Email, Markdown sync, MCP, and deployment. Source: https://spacepress.dev/handbook/ ## Chapters - **01. [Project Layout & Mental Model](https://spacepress.dev/handbook/#mental-model)** — typedpress.config.ts, tp/ modules, and how the compiler emits native WordPress artifacts. - **02. [Rust & OXC Compiler](https://spacepress.dev/handbook/#compiler)** — TypeScript/TSX parsing in Rust, emitted PHP/SQL/OpenAPI/types, and capital_P_dangit lint. - **03. [Data Modeling & Migrations](https://spacepress.dev/handbook/#data-modeling)** — collection(), table(), global(), wp.posts.extend(), snapshot.json, and .was() safe renames. - **04. [Queries, Validation & Access](https://spacepress.dev/handbook/#queries-access)** — Typed db queries, row-level filters, field-level .access(), and .validate(). - **05. [Hooks & Lifecycle Events](https://spacepress.dev/handbook/#hooks)** — Transactional collection hooks (.on) and typed WordPress core hooks in tp/wp-hooks/. - **06. [Actions, Jobs, Routes & Files](https://spacepress.dev/handbook/#actions-jobs-routes)** — Typed RPC action(), Action Scheduler job(), custom HTTP route.ts, and file buckets. - **07. [Pages, Layouts & Islands](https://spacepress.dev/handbook/#pages-islands)** — File-based TSX pages in tp/app/ compiled to PHP and "use client" Interactivity API islands. - **08. [Typed Client, React & Astro](https://spacepress.dev/handbook/#clients-astro)** — Generated fetch client, React hooks, and @typedpress/astro external frontend integration. - **09. [WooCommerce Storefront](https://spacepress.dev/handbook/#woocommerce)** — store(), product(), shipping zones, orders, and optimistic cart hooks on native WooCommerce. - **10. [React Email Templates](https://spacepress.dev/handbook/#react-email)** — Transactional email templates in emails/*.tsx rendered via mail.render() and mail.send(). - **11. [Admin, Gutenberg & Plugins](https://spacepress.dev/handbook/#admin-plugins)** — typedpress-admin at /wp-admin/new/, adminScreen(), @typedpress/blocks, and plugins. - **12. [Two-Way Markdown Git Sync](https://spacepress.dev/handbook/#markdown-sync)** — Three-way merges between content/**/*.md and WordPress Admin with stable UIDs. - **13. [MCP, Abilities & AI Agents](https://spacepress.dev/handbook/#mcp-agents)** — WordPress Abilities API annotations and typedpress mcp server for coding agents. - **14. [Hosting, Deploy & CLI](https://spacepress.dev/handbook/#deploy-cli)** — Deploy to Spacefast, Pressable, WordPress.com, or self-hosted WordPress with typedpress push. For complete topic-by-topic technical specs, fetch `/llms.txt` or `/llms-full.txt`. --- # Schema & Storage > Collections, SQL tables, globals, WordPress built-in kinds, field builders, and migrations. Source: https://spacepress.dev/docs/core/schema-and-storage ## Choosing a storage kind | Builder | Storage | When to use | |---------------------|-----------------------------|----------------------------------------------------------------------------------------------------------------| | `collection()` | WordPress custom post type | Editorial items needing Gutenberg, drafts, revisions, staged versions, comments, URL routing, or Markdown sync | | `table()` | Dedicated SQL table | Relational app records, high-volume data, compound indexes (`.index()`), strict SQL migrations | | `global()` | WordPress options singleton | Site-wide settings, navigation links, feature flags | | `wp.posts.extend()` | Built-in WordPress `post` | Native blog posts extended with typed meta fields and URL pattern | | `userProjection()` | `wp_users` + `wp_usermeta` | Typed user profiles without duplicating WordPress accounts | | `taxonomy()` | WordPress term tables | Flat or hierarchical vocabularies attached via `on: [...]` or `terms()` | ## Field builders All columns are `NOT NULL` by default unless `.optional()` is chained. - **Scalars:** `text({ multiline? })`, `integer()`, `number()`, `boolean()`, `date()`, `timestamp()`, `json()` - **Semantic:** `email()`, `url()`, `slug({ source })`, `richText()`, `select([...])` (`.many()` for multi-select) - **Relations & Media:** `ref(kind)` (`.many()`, `.onDelete("cascade" | "restrict" | "setNull")`, `.reverse("name")`), `terms(taxonomy)`, `media({ accept })`, `file(bucket)` - **Structured:** `group(fields)`, `repeater(fields)`, `blocks(layouts)` ## Modifiers & safe renames Chain `.min(n)`, `.max(n)`, `.pattern(/.../)`, `.unique()`, `.default(v)`, `.defaultNow()`, `.$default(fn)`, `.$onUpdate(fn)`, `.validate((v, ctx) => ...)`, `.ui({ label, help, placeholder, width })`, and `.showIf({ ... })`. To rename a column or SQL table without losing production data, declare `.was("oldName")` on the column or `was: "old_table"` on `table()`. SpacePress emits a safe rename migration against `tp/_generated/migrations/snapshot.json`. --- # Queries & Access Control > Visitor-scoped typedpress:db queries, trusted db queries, filtering operators, and declarative access rules. Source: https://spacepress.dev/docs/core/queries-and-access ## Visitor-scoped vs trusted database APIs Import named kinds from `"typedpress:db"` for visitor-scoped operations that automatically enforce access rules, draft visibility, and field masks: ```ts import { posts } from "typedpress:db"; const published = await posts.list({ where: { tags: { has: "release" } }, orderBy: { publishedAt: "desc" }, with: { cover: true }, limit: 20, }); // Explicit system escalation when needed: const all = await posts.system.list({ limit: 100 }); ``` Inside hooks, jobs, and trusted server actions, you can also use the Drizzle-inspired `db` API from `"typedpress"`: ```ts import { db } from "typedpress"; const row = await db.query.posts.findFirst({ where: { slug: "hello" } }); const [created] = await db.insert(tasks).values({ title: "Ship v1" }).returning(); ``` ## Declarative access rules The role ladder is ordered: `guest < subscriber < author < editor < admin`. Naming a role admits that role and every higher role. - Shorthands: `"anyone"`, `"authenticated"`, `"self"`, role name, or boolean. - Functions: `(ctx) => boolean | AccessFilter` — returning a filter restricts `read`, `update`, and `delete` queries to matching rows (non-matching rows return `404`). - Field masks: `.access({ read, create, update })` on any column strips or refuses unauthorized fields across REST, pages, and client queries. --- # Actions, Jobs, Hooks & HTTP Routes > Server RPC actions, Action Scheduler background jobs, transactional hooks, custom routes, and file buckets. Source: https://spacepress.dev/docs/core/actions-jobs-routes ## Server actions Export an `action()` to mount a validated endpoint at `POST /__tp/api/v1/actions/` (and expose it to `"use client"` components and the typed client): ```ts import { action, integer, HttpError, db } from "typedpress"; export const archiveTask = action({ input: { id: integer() }, access: "editor", idempotent: true, async handler({ id }) { const [row] = await db.update(tasks).set({ done: true }).where({ id }).returning(); if (!row) throw new HttpError(404, "not_found", "Task not found"); return row; }, }); ``` Set `readonly: true` or `destructive: true` to annotate the generated WordPress Ability for AI agents, or `signature` to verify incoming HMAC webhooks. ## Background jobs Export a `job()` and enqueue it with `jobs..enqueue(input, { delay?, key? })`. Jobs run asynchronously on WordPress Action Scheduler, commit atomically with the enclosing database transaction, support automatic `retries`, and can guard non-idempotent side effects with `once(key, fn)`. ## Transactional hooks & WordPress hooks - Chain `.on({ beforeCreate, afterCreate, beforeUpdate, afterUpdate, beforeDelete, afterDelete, afterPublish })` onto any collection or table. Throwing aborts the request and rolls back the transaction. - Place typed WordPress core filters/actions in `tp/wp-hooks/.ts` using `Handler<"...">` from `"php/wordpress"`. ## Custom HTTP routes & private files - Create `tp/app//route.ts` exporting `GET`, `POST`, `PUT`, `PATCH`, or `DELETE` plus `export const guard`. - Define private upload buckets with `files({ accept, maxBytes, access })` backed by local disk or S3-compatible storage (`uploads: { backend: "s3", ... }`). Loading a `file(bucket)` column via `with` yields a 5-minute signed URL. --- # Pages, Layouts & Interactive Islands > File-based TSX routing compiled to PHP, progressive forms, "use client" Interactivity API islands, and static export. Source: https://spacepress.dev/docs/core/pages-and-islands ## File-based routing in `tp/app/` SpacePress compiles TSX pages and layouts in `tp/app/` directly into server-rendered PHP: - `tp/app/layout.tsx` — shared shell, `export const template = "theme" | "blank" | ""`, `metadata`, and CSS imports. - `tp/app/page.tsx`, `[slug]/page.tsx`, `[...path]/page.tsx`, `(group)/` — static, dynamic, catch-all, and grouped routes. - `tp/app/not-found.tsx` and `tp/app/login.tsx` — custom 404 and custom WordPress sign-in screens. - `export const search = { page: integer().default(1) }` — typed query string parsing. - `export const guard = "authenticated"` — route-level authorization. ## Built-in server components (`typedpress/app`) Use `` (Interactivity Router navigation), `` (block content via `the_content`), `` (sanitized HTML), ``, ``, ``, ``, ``, ``, ``, and `useFormState(action)` for progressive zero-JS `
` submissions. ## `"use client"` interactive islands (`typedpress/client`) Start a component file with `"use client";`. SpacePress renders its initial HTML in PHP and compiles the interactive logic into a WordPress Interactivity API store supporting `useState`, `useEffect`, `useMount`, `useEvent`, `useRef`, `sharedState`, and live-updating `useLive(kind, query)` subscriptions. ## Static export Set `output: "static"` in `defineConfig()` and export `staticParams()` on dynamic routes, then run `typedpress export` to emit a standalone static site to `tp/dist/static/`. --- # Installation & Setup > Requirements, creating a new app, and starting the local WordPress development environment. Source: https://spacepress.dev/docs/getting-started/installation ## Requirements - **Node.js 22 or newer** and npm - No Docker and no Rust toolchain required — the `typedpress` npm package downloads a prebuilt native compiler binary automatically. ## Create a new application ```bash npm create typedpress@0.3.0 my-app cd my-app npm run dev ``` `create-typedpress` creates a complete starter project with: - `typedpress.config.ts` defining a synced `notes` collection and `site` global - `tp/app/` with a layout, home page, dynamic `/notes/[slug]` page, and a progressive `` - `content/notes/` sample Markdown content - `AGENTS.md`, `.mcp.json`, and coding-agent skills generated via `typedpress init` ## Running locally `npm run dev` invokes `typedpress dev`, which compiles your TypeScript, boots a local WordPress + SQLite server, activates the compiled plugins, and rebuilds automatically on file changes. - Open the printed site URL to view your rendered TSX pages. - Open `/wp-admin/new/` to explore SpacePress Admin (or `/wp-admin/` for classic wp-admin). - Stop the dev server without deleting local data via `npm run stop` (`typedpress dev stop`). ## Adding modules Add first-party modules as source files you own at any time: ```bash npx typedpress add shop # WooCommerce storefront & catalog npx typedpress add db # SQL table starter npx typedpress add api-reference # /api documentation pages from OpenAPI ``` --- # Project Structure > Layout of a SpacePress repository, authored files vs generated artifacts. Source: https://spacepress.dev/docs/getting-started/project-structure ## Directory layout ```text my-app/ ├── typedpress.config.ts # Entry point: defineConfig() + re-exports ├── tsconfig.json # Maps "typedpress", "typedpress/*", "typedpress:db" ├── tp/ │ ├── schema.ts # Collections, SQL tables, globals, taxonomies, stores │ ├── server.ts # Actions, background jobs, mail helpers │ ├── app/ # File-based TSX pages, layouts, and route.ts handlers │ ├── components/ # Server and "use client" components │ ├── wp-hooks/ # Typed WordPress core action & filter handlers │ ├── _generated/ # db.d.ts, routes.d.ts, openapi.json, client/, migrations/ │ └── dist/wp-content/ # Compiled WordPress plugins ready to deploy ├── content/ # Markdown/JSON content synced with WordPress ├── emails/ # React Email (.tsx) templates └── public/ # Static assets served from site root ``` ## What to commit to Git Commit everything you author (`typedpress.config.ts`, `tp/schema.ts`, `tp/app/`, `content/`, `emails/`, `public/`) **plus** these compiler lock/ledger files: - `tp/_generated/migrations/` (`snapshot.json` and numbered `*.sql` files) — tracks schema history for safe incremental deploys. - `tp/_generated/wp-plugins.lock.json` — locks WordPress plugin versions and SHA-256 checksums. - `tp/_generated/plugins.lock.json` — locks capability grants for `use` plugin packages. - `tp/_generated/abilities.json` & `tp/_generated/runtime-schema.json` — when using pulled WordPress Abilities or runtime schema versions. `tp/dist/` is a build artifact and is typically git-ignored. --- # Two-Way Markdown & Git Sync > Synchronize Markdown/JSON files in Git with WordPress collections and taxonomies. Source: https://spacepress.dev/docs/integrations/markdown-sync ## Configuring sync Add a `sync` glob to any `collection()`, `wp.posts.extend()`, `taxonomy()`, `product()`, or `table()`: ```ts export const docs = collection({ title: text(), slug: slug({ source: "title" }), content: richText().optional(), }, { hierarchical: true, url: "/docs/:path", sync: "content/docs/**/*.md", }); ``` A `**` folder pattern maps subdirectories into parent/child hierarchy (`index.md` represents the folder item). Every synced record receives an immutable `uid` so renames and slug changes stay linked. ## Running sync & CI workflows - Run `typedpress sync` to perform a 3-way merge between local Markdown files and WordPress. Front matter is validated against your TypeScript schema before writing. - Run `typedpress init --github` to scaffold GitHub Actions for automated content sync. - Configure `typedpress git-dispatch` so edits saved inside WordPress Admin trigger a repository dispatch event automatically. - Enable `seed: true` in `defineConfig()` to populate synced records when a fresh deployment activates the plugin without overwriting existing editorial changes. --- # WooCommerce Native Storefront > Configure WooCommerce stores, products, shipping zones, orders, and optimistic cart hooks in TypeScript. Source: https://spacepress.dev/docs/integrations/woocommerce ## Scaffolding a storefront Add a complete WooCommerce storefront to any project with: ```bash npx typedpress add shop ``` ## Declarative store & catalog builders Export `store()`, `product()`, `productCategory()`, `productTag()`, and `order()` from `tp/shop.ts` (re-exported in `typedpress.config.ts`): ```ts import { store, product, productCategory, productTag, order } from "typedpress"; export const shop = store({ currency: "EUR", country: "PL", sellTo: ["PL", "DE"], shipping: [ { name: "Poland", countries: ["PL"], methods: [ { type: "flatRate", title: "Courier", cost: "15.00" }, { type: "freeShipping", title: "Free over 200", minimum: "200.00" }, ], }, ], payments: ["cod"], }); export const products = product({ sync: "content/products/*.md", url: "/products/:slug" }); export const categories = productCategory({ url: "/shop/:path" }); export const tags = productTag(); export const orders = order(); ``` ## Optimistic cart client & React hooks Whenever a project exports `store()`, `typedpress build` emits `commerce.ts`, `cart-store.ts`, and `cart-react.ts` in `tp/_generated/client/`. Call `createCartHooks(React)` to obtain `useCart()` and `useCartCount()` with optimistic item quantity updates and automatic rollback on failure. --- # React Email Templates > Render emails/*.tsx templates with mail.render() and deliver transactional email with mail.send(). Source: https://spacepress.dev/docs/integrations/react-email ## Authoring templates in `emails/` Write transactional email templates using `react-email` components under `emails/*.tsx`: ```tsx import { Body, Button, Html, Text } from "react-email"; export default function Invitation({ name, url }: { name: string; url: string }) { return ( Hello, {name}! ); } ``` ## Transactional sending Call `mail.render(Template, props)` to produce `{ html, text }`, then queue delivery with `mail.send()`: ```ts const rendered = mail.render(Invitation, { name, url }); await mail.send({ to: recipientEmail, subject: "You're invited", html: rendered.html, text: rendered.text, }); ``` `mail.send()` queues the message inside the current database transaction and dispatches it after commit with retries — if a hook or action rolls back, no email is sent. --- # Astro & Generated Typed Clients > Connect external React, Next.js, Vite, or Astro frontends to a SpacePress backend. Source: https://spacepress.dev/docs/integrations/astro-and-clients ## Generated TypeScript client & React hooks Every build emits a typed client to `tp/_generated/client/`: - `index.ts` — `createClient({ baseUrl })` for CRUD queries, pagination, live subscriptions, and typed server actions. - `react.ts` — `createHooks(React)` returning `useQuery()` and `useMutation()` (with `optimistic` updates and rollback) for React 18+ or Preact without bundling React into SpacePress. ## `@typedpress/astro` For Astro 7+ sites, install `@typedpress/astro`: - `tpLoader(kind, opts)` — build-time Astro Content Layer loader with relation and media expansion. - `tpLiveLoader(kind, opts)` — live on-demand loader returning `cacheHint.tags` (``, `:`). - `tpWebhook(opts)` — Astro API route handler verifying `TypedPress-Signature` HMAC headers and invalidating cache tags automatically. Set `frontend: "https://your-astro-site.com"` in `defineConfig()` so WordPress permalinks, previews, and feeds point to your Astro deployment. --- # CLI & Deployment > Build, check, export, push, doctor, plugin packaging, and production hosting options. Source: https://spacepress.dev/docs/operations/cli-and-deploy ## Core build & deploy commands - `typedpress dev` / `dev stop` / `dev status` — manage the local WordPress + SQLite site. - `typedpress check [--json] [--frozen]` — compile and report diagnostics without writing output. - `typedpress build` — emit WordPress plugins into `tp/dist/wp-content/plugins/`, migrations, types, client, and OpenAPI. - `typedpress export [--site ]` — prebuild `tp/app/` into `tp/dist/static/` (`output: "static"`). - `typedpress plugin` — package an uploadable `typedpress.zip` plugin for `wp-admin`. - `typedpress login ` & `typedpress push` — authenticate via WordPress Application Passwords and deploy directly to a remote WordPress site. - `typedpress doctor [--links]` — verify build integrity, live site plugins, and crawl internal links/anchors. ## Site operations (WP-CLI bridge) Target local dev (default) or any remote site (`--site `): - `typedpress wp ` — run any WP-CLI command. - `typedpress migrate`, `seed`, `jobs`, `staged`, `publish-due`, `identity`, `find`, `insert`, `update`, `delete`, `action`, `abilities`, `run`. ## Hosting & deployment guides SpacePress runs anywhere WordPress 7.1+ and PHP 8.2+ run: - **[Deploy on Spacefast](/docs/operations/deploy-spacefast)** - **[Deploy on Pressable & WordPress.com (WP Cloud)](/docs/operations/deploy-wp-cloud)** - **[Deploy on Self-hosted WordPress](/docs/operations/deploy-self-hosted)** — server requirements & everywhere else ## Sealed mode & plugin lockfile Declare third-party WordPress plugins in `defineConfig({ plugins: { ... }, sealed: true })`. Exact versions and SHA-256 checksums are locked in `tp/_generated/wp-plugins.lock.json`, and sealed mode refuses activation of undeclared plugins. --- # MCP & AI Agents > Agent playbooks, compiler rules, 12 built-in skills, editor setup for Claude Code/Cursor/Codex, local & runtime MCP servers, and WordPress Abilities. Source: https://spacepress.dev/docs/operations/mcp-and-agents SpacePress treats coding agents (Claude Code, Cursor, Codex, GitHub Copilot) as first-class citizens — from a single-file build playbook before you even scaffold, to compiled `AGENTS.md`, 12 procedural skills, and a version-pinned local MCP server. ## Machine-readable entry points Point any coding agent or LLM directly at: - **[/start.md](https://spacepress.dev/start.md)** — Imperative agent build playbook (inspect workspace → model data → build headful TSX slice → boot local WordPress → verify). - **[/rules.md](https://spacepress.dev/rules.md)** — Dense TS-to-PHP compiler rules, exact import boundaries, access rules, and safe migration conventions. - **[/llms.txt](https://spacepress.dev/llms.txt)** & **[/llms-full.txt](https://spacepress.dev/llms-full.txt)** — Complete documentation index and full plain-text corpus. - **[/.well-known/ai-catalog.json](https://spacepress.dev/.well-known/ai-catalog.json)** & **[/.well-known/agent-skills/index.json](https://spacepress.dev/.well-known/agent-skills/index.json)** — Auto-discovery catalog and SHA-256-indexed Agent Skills manifest. ## Project setup (`typedpress init`) `npm create typedpress@0.3.0 my-app` runs `typedpress init` automatically. Re-run it after changing `typedpress.config.ts` or `tp/`: ```bash npx typedpress init npx typedpress init --check # fails CI if AGENTS.md or skills are stale ``` `typedpress init` maintains three things without overwriting your custom notes: 1. **Compiled `AGENTS.md`:** Writes your app's live kinds, fields, access matrix, actions, jobs, routes, endpoints, command table, and anti-hallucination compiler rules between `` and `` markers. 2. **Project `.mcp.json`:** Registers the local `typedpress` stdio MCP server (`npx --no-install typedpress mcp`). 3. **12 built-in Agent Skills:** Installs every `SKILL.md` into both `.agents/skills/` (Codex and the shared standard) and `.claude/skills/` (Claude Code). ## Editor setup - **Claude Code:** Reads `.mcp.json` and `.claude/skills/` automatically. If your repository has its own `CLAUDE.md`, add `@AGENTS.md` to it so Claude Code loads both. - **Cursor:** Reads `AGENTS.md`, `.agents/skills/`, and `.mcp.json` automatically — or [install the local SpacePress MCP server in Cursor](cursor://anysphere.cursor-deeplink/mcp/install?name=typedpress&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyItLW5vLWluc3RhbGwiLCJ0eXBlZHByZXNzIiwibWNwIl19). - **Codex / VS Code / Copilot:** Automatically pick up `AGENTS.md` and `.agents/skills/`; point your MCP client at `npx --no-install typedpress mcp`. ## Built-in Agent Skills | Skill | When an agent uses it | | :--- | :--- | | `typedpress-add-kind` | Adding or updating `collection()` / `table()` kinds, fields, `ref()`, access rules, or `.was()` renames | | `typedpress-add-page` | Building headful `tp/app/**/page.tsx`, `layout.tsx`, dynamic segments, or custom `route.ts` endpoints | | `typedpress-write-action` | Adding typed `action()` RPC endpoints and retryable Action Scheduler `job()` queues | | `typedpress-dev-site` | Starting, inspecting, querying, or resetting the local WordPress + SQLite dev site | | `typedpress-fix-diagnostic` | Reading `typedpress check --json` diagnostics and fixing TS-to-PHP compiler errors or lint warnings | | `typedpress-woocommerce` | Scaffolding and configuring `store()`, `product()`, shipping zones, orders, and optimistic cart hooks | | `typedpress-markdown-sync` | Configuring `sync: "content/**/*.md"`, UIDs, `typedpress sync`, conflict resolution, and GitHub sync | | `typedpress-security-audit` | Auditing `.access()` rules, field-level leaks, `typedpress:db` vs `db`, route guards, and Abilities flags | | `typedpress-deploy` | Safe preflight (`check`, `push --dry-run`), explicit production consent, WP Cloud static-asset notes, and `doctor --links` | | `typedpress-connect-mcp` | Connecting an agent to a running site's authenticated WordPress MCP endpoint | | `typedpress-migrate` | Converting existing EmDash, Payload, Sanity, or Zero schemas with `typedpress migrate config` | | `typedpress-migrate-astro` | Wiring an optional external Astro frontend with `@typedpress/astro` | ## Two MCP servers: dev-time vs runtime SpacePress ships two distinct MCP servers for different jobs: ### 1. Local dev-time MCP (`typedpress mcp`) Runs on stdio against your source repository — no live WordPress site or credentials required. Exposes read-only tools by default: - `schema` — compiled kinds, fields, access rules, relations, actions, jobs, routes, roles, and Abilities - `check` — runs `typedpress check --json` without writing files - `docs_search` & `docs_read` — searches and reads documentation embedded inside the exact compiler binary version - `commands` — full build & site command table - `dev_status` — local dev server URL, watch state, and last build error - `query` — reads records from the local dev site (`--allow-remote-read` opts into reading named remote sites) Pass `--allow-writes` to additionally expose `run_action`, `insert`, and `update` strictly scoped to the project's local dev site. ### 2. Runtime WordPress MCP (`/wp-json/mcp/typedpress-`) Every running SpacePress site exposes an authenticated WordPress MCP endpoint with one tool per collection operation and `action()`, authenticated as a WordPress user via Application Passwords or scoped agent credentials (`typedpress identity agent add`). ## WordPress Abilities API Every collection, global, action, and job is registered as a WordPress Ability by default (`agents: false` opts out). Annotate actions with `readonly: true` or `destructive: true` to guide agent safety checks. To invoke abilities provided by WordPress core or installed plugins with full TypeScript types: ```bash npx typedpress abilities pull --site https://example.com ``` Then call `abilities.call("ability/name", input)` from `"php/wordpress"` inside any action, hook, or route. ## Guidance evals Compiler-backed guidance evals live in `evals/guidance/` (`node evals/guidance/run.mjs`) to verify reference prompts and negative compiler checks against `typedpress check --json`. --- # Deploy on Spacefast > Deploy a SpacePress app to Spacefast with zero server configuration, automatic PHP compilation, and instant preview environments. Source: https://spacepress.dev/docs/operations/deploy-spacefast [Spacefast](https://spacefast.com) is built to run SpacePress applications natively on WordPress 7.1+ and PHP 8.2+ without managing servers, nginx rules, or manual plugin uploads. ## Prerequisites - A SpacePress project that passes `typedpress check` cleanly - A [Spacefast](https://spacefast.com) account and site URL ## 1. Verify your project locally Run a check and test build before pushing: ```bash npx typedpress check npx typedpress build ``` Commit your migration ledger (`tp/_generated/migrations/`) and plugin lockfile (`tp/_generated/wp-plugins.lock.json`) so every deployment upgrades your database safely and deterministically. ## 2. Sign in and preview the deployment plan Authenticate once with your Spacefast site using WordPress Application Passwords, then inspect what the deployment will change: ```bash npx typedpress login https://your-site.spacefast.com npx typedpress push --dry-run ``` The dry run uploads your compiled runtime and app trees and prints every migration, page, and index change before making the build live. ## 3. Push to production ```bash npx typedpress push ``` `typedpress push` atomically activates the new build, applies pending SQL migrations, seeds synced Markdown content on an empty site, and purges page caches automatically. ## 4. Sync Markdown content & verify If your schema defines synced collections (`sync: "content/**/*.md"`), keep Git and your live Spacefast site in two-way sync: ```bash npx typedpress sync --site https://your-site.spacefast.com npx typedpress doctor --site https://your-site.spacefast.com --links ``` For CI pipelines, supply `TP_APP_PASSWORD="user:application-password"` as a secret environment variable instead of running `typedpress login` interactively. --- # Deploy on Pressable & WordPress.com (WP Cloud) > Deploy a SpacePress app to Pressable or plugin-enabled WordPress.com sites running on WP Cloud using typedpress plugin and typedpress push. Source: https://spacepress.dev/docs/operations/deploy-wp-cloud Both [Pressable](https://pressable.com) and plugin-enabled [WordPress.com](https://wordpress.com) plans (Business and Commerce) run on **WP Cloud** with PHP 8.2+, WordPress 7.1+, `ZipArchive`, SSH/WP-CLI access, and Application Passwords enabled over HTTPS. Deployment works identically on both — `spacepress.dev` itself runs on Pressable. ## Prerequisites - A **Pressable** site or a plugin-enabled **WordPress.com** site (Business or Commerce) running **WordPress 7.1+** and **PHP 8.2+** - Administrator access in `wp-admin` (or SSH/WP-CLI access) ## 1. Package and install the SpacePress plugin Generate the uploadable host plugin (`typedpress.zip`): ```bash npx typedpress plugin --out typedpress.zip ``` Upload and activate `typedpress.zip` in **wp-admin → Plugins → Add New Plugin → Upload Plugin**, or over SSH with WP-CLI: ```bash wp plugin install typedpress.zip --activate --force ``` Activating the plugin automatically installs and activates its pinned platform dependencies (`action-scheduler`, `secure-custom-fields`, `two-factor`, `mcp-adapter`). ## 2. Authenticate and deploy Sign in with WordPress Application Passwords, preview the deployment plan, and make it live: ```bash npx typedpress login https://your-site.example npx typedpress push --dry-run npx typedpress push ``` `typedpress push` uploads the compiled PHP runtime and app trees, runs any new numbered SQL migrations in `tp/_generated/migrations/`, configures pretty permalinks, creates app routes, and activates the build atomically. In CI or non-interactive scripts, create a WordPress Application Password (`wp user application-password create deploy --porcelain`) and pass `TP_APP_PASSWORD=":"`. ## 3. Sync Markdown content & verify If your schema uses `sync: "content/**/*.md"`, sync Markdown edits and verify live health and links: ```bash npx typedpress sync --site https://your-site.example npx typedpress doctor --site https://your-site.example --links ``` ## WP Cloud hosting notes - **Build store location:** On WP Cloud, PHP-FPM runs inside `/srv/htdocs` and cannot write outside it, so SpacePress automatically creates a randomized build store directory (`wp-content/typedpress-store-`). Keep that path private and never link to it publicly. - **Root static files (`.js`, `.wasm`, `.txt`):** WP Cloud's nginx edge serves top-level static file extensions directly from `/srv/htdocs/` before reaching PHP. If your app ships custom browser bundles or WebAssembly assets under `public/` (such as `public/site.js` or `public/compiler.wasm`), copy them into `/srv/htdocs/` during release and purge edge cache so nginx serves them directly from the CDN. - **Avoid `/files/` for public assets:** WP Cloud reserves `/files/*` for legacy WordPress Multisite rewrites. Place downloadable assets in another path (for example, `public/downloads/` or `public/playground-plugins/`). - **Rollbacks:** Earlier builds stay in the site's build store so you can switch back to a previous release in `wp-admin` without re-uploading. Switching code does not revert applied SQL migrations. --- # Deploy on Self-hosted WordPress > Run SpacePress on your own VPS, Docker stack, or any LAMP/LEMP host with zero lock-in — via typedpress push or standalone plugins. Source: https://spacepress.dev/docs/operations/deploy-self-hosted Because SpacePress compiles into standard PHP and WordPress plugins with **zero Node.js in production**, you can host your app on any VPS, Docker container, or traditional LAMP/LEMP server. ## Server requirements - **WordPress 7.1+** - **PHP 8.2+** with the `zip` (`ZipArchive`), `openssl`, and `mbstring` extensions - **MySQL 8.0+**, **MariaDB 10.6+**, or **SQLite** (via `sqlite-database-integration` 3.1.2+) - HTTPS enabled (required by WordPress for Application Passwords) - Pretty permalinks enabled (`/%postname%/`) ## Option A: Deploy with `typedpress push` (recommended) ### 1. Configure a private build store outside the web root On nginx or any server that does not enforce `.htaccess`, point `TP_STORE_DIR` in `wp-config.php` to a writable directory **outside** your web root: ```php `, plus any pinned third-party plugins) into your WordPress `wp-content/plugins/` directory and activate them in order: ```bash wp plugin activate typedpress-runtime typedpress-identity typedpress-admin typedpress-app-my-app wp typedpress migrate wp typedpress seed ``` ## Web server & cron tips - **Nginx routing for `public/`:** Pass unknown paths to `/index.php?$args` so SpacePress's `PublicFiles` handler serves files from `public/`, or map static files from the active app's `public/` directory directly in nginx for faster edge delivery. - **Background jobs (`job()`):** SpacePress queues background jobs on Action Scheduler. Configure a real system cron (`* * * * * wp cron event run --due-now --path=/var/www/html`) rather than relying solely on visitor-triggered `wp-cron.php`. - **Static export (`output: "static"`):** If your site needs no server runtime at all, run `npx typedpress export` and deploy `tp/dist/static/` to any static CDN. --- # Getting Started > Install SpacePress, scaffold your first application, and run local WordPress. Source: https://spacepress.dev/docs/getting-started SpacePress compiles TypeScript schemas, server actions, background jobs, and TSX pages into native PHP, SQL migrations, OpenAPI 3.1, and WordPress plugins — with zero Node.js in production. ## Where to begin - **[Installation & Quick Start](/docs/getting-started/installation)** — requirements, scaffolding, and launching `typedpress dev`. - **[Project Structure](/docs/getting-started/project-structure)** — how `typedpress.config.ts`, `tp/`, `content/`, `emails/`, and `public/` fit together. > **Pre-release naming note:** SpacePress is the product and website brand (`spacepress.dev`). During pre-release, the CLI binary, npm packages, config filename (`typedpress.config.ts`), and module imports (`"typedpress"`, `"typedpress:db"`) use the identifier `typedpress`. --- # Core Framework > Data modeling, queries, access rules, hooks, actions, jobs, routes, and TSX rendering. Source: https://spacepress.dev/docs/core Learn the core primitives that SpacePress compiles from TypeScript into native PHP and SQL: - **[Schema & Storage](/docs/core/schema-and-storage)** — `collection()`, `table()`, `global()`, `userProjection()`, `taxonomy()`, `wp.posts`, fields, and automatic SQL migrations. - **[Queries & Access Control](/docs/core/queries-and-access)** — `typedpress:db` vs trusted `db`, relational filters, role ladder, row-level filters, and field masks. - **[Actions, Jobs & HTTP Routes](/docs/core/actions-jobs-routes)** — server RPC, Action Scheduler queues, lifecycle hooks, `route.ts`, webhooks, and private file buckets. - **[Pages, Layouts & Islands](/docs/core/pages-and-islands)** — file-based TSX rendering, forms, `"use client"` Interactivity API components, and static export. --- # Integrations & Ecosystem > Markdown Git sync, native WooCommerce, React Email, typed clients, and Astro. Source: https://spacepress.dev/docs/integrations SpacePress integrates deeply with both the WordPress ecosystem and modern TypeScript tooling: - **[Two-Way Markdown & Git Sync](/docs/integrations/markdown-sync)** — keep `content/**/*.md` and WordPress in step with 3-way merges. - **[WooCommerce Native Storefront](/docs/integrations/woocommerce)** — declarative `store()`, `product()`, `order()`, and optimistic cart hooks. - **[React Email Templates](/docs/integrations/react-email)** — render `.tsx` emails and deliver them transactionally. - **[Astro & Typed Clients](/docs/integrations/astro-and-clients)** — generated `createClient()`, `createHooks(React)`, and `@typedpress/astro`. --- # Operations & Tooling > CLI commands, deployment, packaging, WordPress Admin screens, MCP, and AI agents. Source: https://spacepress.dev/docs/operations - **[CLI & Deployment](/docs/operations/cli-and-deploy)** — complete command reference, plugin packaging, `typedpress push`, `doctor`, and sealed mode. - **[MCP & AI Agents](/docs/operations/mcp-and-agents)** — `typedpress init`, `typedpress mcp`, WordPress Abilities API, and `runtimeSchema`. - **[Deploy on Spacefast](/docs/operations/deploy-spacefast)** — zero-config cloud deployment built for SpacePress. - **[Deploy on Pressable & WordPress.com (WP Cloud)](/docs/operations/deploy-wp-cloud)** — managed WordPress deployment on WP Cloud (Pressable and plugin-enabled WordPress.com sites). - **[Deploy on Self-hosted WordPress](/docs/operations/deploy-self-hosted)** — server requirements, VPS, Docker, LAMP/LEMP, `TP_STORE_DIR`, standalone plugins, and cron setup. --- # Reference > Generated compiler compatibility inventory and host contract specifications. Source: https://spacepress.dev/docs/reference - **[Host Contract](/docs/reference/host-contract)** — what a hosting platform may rely on when compiling and mounting SpacePress apps. - **[Tested Compiler Compatibility](/docs/reference/language-support)** — fixture-backed inventory of supported TypeScript constructs, intentional divergences, and compiler refusals. --- > Everything a hosting platform may rely on when compiling and mounting SpacePress apps into WordPress. Source: https://spacepress.dev/docs/reference/host-contract # Host contract A host compiles TypedPress apps itself and mounts them into WordPress: Spacefast is one. This page is everything such a host may rely on. Anything not listed here is TypedPress's internals: a host that reads generated files, requires runtime files by path or calls other `TypedPress\` classes breaks when they change. ## Versioning Every hosted manifest (`manifest.json` of a `compile-sources` tree, format `typedpress.hosted.v1`) carries an integer `hostContract`. It changes only when something below changes incompatibly for a host. Additions don't change it. A host refuses a compiled tree whose `hostContract` it doesn't know, rather than serving it on assumptions. Version 2 requires managed commerce hosts to check shipping compatibility before selecting a build, including rollback and recovery after a failed initialization. Version 1 hosts must refuse version 2 manifests until they implement this lifecycle requirement. ## Uploads `compile-sources [previous-output]` takes a captured source bundle: `typedpress.source-bundle.v1` (`app.typedpress.json`, `vendor.typedpress.json`, `manifest.json`), and, for clients released before the rename to TypedPress, `zero.source-bundle.v1` (see [Deploy on Spacefast](/docs/operations/deploy-spacefast)). `previous-output` is the tree of the version being replaced: its snapshot is the migration baseline. A client released before the rename (the hosted MCP server 0.9.0) uploads the raw project instead of a capture: `zero.config.ts` at the root, the relative modules it imports and `public/`. A host may pass that directory as `` to `compile-sources` or `compile-to-store`, or capture it first with `typedpress::host::sources`; TypedPress captures it as the 0.3.0 compiler did and compiles that capture. Refused: an npm import (a host installs no packages; the owner publishes from the CLI), TSX pages (`pages/` or `zero/pages.json`), and a tree that also holds `typedpress.config.ts` or a capture. ## Manifest Besides `format`, `hostContract`, `compiler` and the platform versions (`wordpress`, `php`, `requires`): - `summary`: `{name, collections, tables, actions, identity, admin}`, what a dashboard shows about the app. - `routes`: `[{method, path}]`, the app's HTTP routes outside `/wp-json`, and `pagePaths`, its pages (GET and HEAD). Hand any request whose path matches to WordPress, whatever its method, after trimming one trailing `/` and treating HEAD as GET. Paths use `:name` for one segment and a final `*name` for the rest. - `host`: the names below, as data. Host contract version: **2** (`hostContract` in the manifest). ### Reserved paths | Path | What | |---|---| | `/wp-json/typedpress/v1/*` | TypedPress's HTTP API: kinds, globals, actions, files, `/me`, one route on WordPress's REST server. Every answer is `Cache-Control: private, no-store` with `Vary: Origin, Cookie, Authorization`, except file streams and `/openapi.json` | | `/identity/*` | TypedPress Identity's issuer and pages, when the app mounts identity | | `/wp-json/typedpress-identity/v1/*` | TypedPress Identity's REST API | | `/wp-admin/new/*` | TypedPress Admin, unless the app sets `admin: false`: served by wp-admin's `admin.php?page=typedpress-admin`. Apache applies the plugin's `.htaccess` rule; any other server must send a path that is not a file to WordPress's `index.php`, which redirects it to `admin.php?page=typedpress-admin&p=` | | `/typedpress-admin/*` | the admin's earlier address, redirected to `/wp-admin/new/*` | The app API is `/wp-json/typedpress/v1`; actions are `POST /wp-json/typedpress/v1/actions/`. The generated client is a file of the compiled tree (`client/client.js`); the host chooses the URL it serves it at. ### Mount and lifecycle | Call | When | |---|---| | `TypedPress\Loader\Loader::load($root, $build, $options)` | before WordPress initializes, with the build the host selected for this request | | `TypedPress\Loader\Loader::initialize($root, $build)` | once per build per site, before the host exposes it: storage upgrades, migrations, identity maintenance, the content seed | | `TypedPress\Loader\Loader::inspect($root, $build)` | after mounting with load(..., ['inspect' => true]) and WordPress init, without initialization: returns steps and refusals; a steps entry with id commerce-shipping means the build's declared shipping policy does not match the site's recorded source and current shipping rows | | `TypedPress\Loader\Loader::sealed($root, $build)` | a sealed build's plugin allow-list, or null; with `Loader::allowedPlugins` and `Loader::keepUnlisted` in the host's own early code, before WordPress reads its active plugins | | `TypedPress\Loader\Store::gc($root, $keep)` | after the host deletes a version: keeps exactly the builds it still serves | ### Hooks a host implements or listens to | Hook | Kind | What | |---|---|---| | `tp_mail_transport` | filter | delivers `mail.send` messages; without it, the app's mail is refused | | `tp_purge_urls` | action | the root-relative URLs a committed content write changed, for a host's page cache, each with the query string a page was cached under (only parameters the page declares as `search`; a request with any other parameter is answered `private, no-store` and never named here); `/*` after a new build goes live | | `tp_private_probe_url` | filter | the URL the private-files probe fetches, when the public URL is not reachable from the server | | `tp_prebuild_url` | filter | the URL a prebuilt page is rendered from, when the site cannot reach its own address (`output: "server"` with `prerender`) | | `tp_identity_providers` | filter | OpenID Connect sign-in providers TypedPress Identity offers | | `tp_identity_rest_cookie_auth` | filter | lets the identity session cookie authenticate the app's REST API (a host serving its own frontend) | | `tp_identity_session_cookie_aliases` | filter | other cookie names whose session a migrated site keeps | | `tp_fetch_allow_address` | filter | allows an outgoing `fetch` to an address TypedPress denies by default | | `tp_runtime_loaded` | action | the runtime has booted; register commands and seams after it | ### Live updates | Name | What | |---|---| | `tp_realtime_changes` | WordPress action fired once per committed transaction with its change notice `{id, at, changes: [{collection, ops, ids}]}` | | `TypedPress\Realtime\Publisher` | PHP interface a host implements to send each notice to its realtime transport (`TypedPress\Realtime\Module::publish`) | | `TypedPress\Realtime\Module::shared($notice)` | the notice with the ids of collections not every visitor can list set to null, for a room every visitor shares | | `__tpRealtime` | the page-wide registry on `globalThis` that every generated client on a page shares; a host script calls `registerRealtimeTransport` from the client to set it | ### Background work `wp typedpress jobs tick [--limit=<1..100>] [--budget-ms=]` ### Sealed mode When the app sets `sealed: true`, the hosted manifest and the build manifest carry `sealed`: the plugin directory names that may load (TypedPress's own, the platform pins, and the plugins the config declares). The key is absent when the app isn't sealed. TypedPress itself only refuses new activations and reports what else is loaded, because WordPress loads drop-ins, must-use plugins and active plugins before TypedPress's app plugin. A host that wants the list enforced does it in its own early code (a must-use plugin of the host's, or `sunrise.php`): it filters `option_active_plugins` with `TypedPress\Loader\Loader::allowedPlugins($active, $sealed)`, keeps the hidden entries stored with `TypedPress\Loader\Loader::keepUnlisted($new, $stored, $sealed)` on `pre_update_option_active_plugins`, ships no must-use plugin or drop-in beyond its own, and defines `TP_SEALED_ENFORCED` so the app reports `enforced: "host"`. `allowedPlugins` never passes `vip-block-data-api` or `vip-decoupled-bundle`, whatever list it is given: each serves stored content around the app's read rules. Nothing changes for sites that don't serve a TypedPress app. docs/sealed.md has the example. ### Prebuilt pages A build with prebuilt pages writes their HTML and Markdown below `wp-content/cache/typedpress-prebuilt/` (moved by the `tp_prebuilt_dir` filter), and PHP serves them: `TypedPress\Render\Prebuilt::serve()` answers at `plugins_loaded` when the request, its cookies, the site's visibility and the file's age allow it, and lets WordPress render otherwise. A host must not serve these files directly, from its web server or any cache of its own, and must not expose the folder over HTTP: deny requests to it as it does for other private paths. Whether a file may be served is decided per request, and only `serve()` decides it. A host's page cache stores and purges these answers as it does any other page. The rebuild runs as the `tp_prebuild` Action Scheduler action, on the host's jobs worker like any other. ### Table prefix TypedPress puts every table under WordPress's `$wpdb->prefix` and never changes it. App tables are `{prefix}tp_`, system tables `{prefix}tp__`, identity tables `{prefix}tp_identity_`. The host owns the prefix: a host that binds several apps to one database gives each its own prefix before WordPress loads. An app's `existingTable` must be under that prefix (and not WordPress's, TypedPress's or Action Scheduler's own table, nor under another site's longer prefix, which need not end in `_`), or the Space's own Zero 0.8 table `sf__
_<10 hex>` with the converter's digest of that Space id and table name. The Space id comes from the host: `spacefast_content_space_id()` when it exists, else the `TP_SPACE_ID` constant defined before WordPress loads; on a `sfz_<24 hex>_` prefix it must also be the Space that prefix was made from. With neither, no 0.8 table binds. The longest name TypedPress adds after it is 29 characters, so a prefix may be at most 35 characters. ### Manifest `host` object For a build with `store()`, both the hosted manifest's `maxTablePrefix` and `host.maxTablePrefix` are **20**, because Woo's longest table suffix is 44 characters. The loader's early commerce policy enforces this before Woo initializes. Other builds use the ordinary 35-character limit shown below. ```json { "reservedPaths": [ "/wp-json/typedpress/v1/*", "/identity/*", "/wp-json/typedpress-identity/v1/*", "/wp-admin/new/*", "/typedpress-admin/*" ], "apiPrefix": "/wp-json/typedpress/v1", "actionPrefix": "/wp-json/typedpress/v1/actions/", "liveUpdates": { "action": "tp_realtime_changes", "publisher": "TypedPress\\Realtime\\Publisher", "registry": "__tpRealtime" }, "hooks": [ "tp_mail_transport", "tp_purge_urls", "tp_private_probe_url", "tp_prebuild_url", "tp_identity_providers", "tp_identity_rest_cookie_auth", "tp_identity_session_cookie_aliases", "tp_fetch_allow_address", "tp_runtime_loaded" ], "mount": "TypedPress\\Loader\\Loader::load", "jobsCommand": "wp typedpress jobs tick", "maxTablePrefix": 35 } ``` --- > Fixture-backed inventory of supported TypeScript constructs, intentional divergences, and compiler refusals. Source: https://spacepress.dev/docs/reference/language-support # Tested compiler compatibility Generated from `tests/compatibility/registry.json`; run `python3 scripts/compiler-contracts.py` to update. This is a growing evidence inventory, not an exhaustive language specification. Refusals are verified by running `typedpress check --json` on each registered fixture in `tests/compiler_contracts.rs`. Supported behavior and intentional differences link to their executable evidence. A silent, undocumented mismatch is a bug, not an exclusion. String semantics here describe the current implementation; changes require updating the evidence and this registry. ## classes Status: **supported**. Named module-level classes compile inside callbacks: constructors, public fields and typed parameter properties, methods, lexical this in arrows, static members, named inheritance, super and instanceof. Private names (#field, #method, static #x, #x in value) are per declaring class: subclasses get separate slots, private state is invisible to enumeration/JSON/clone, and foreign receivers throw TypeError. Classes extending Error/TypeError/RangeError/SyntaxError get non-enumerable message/cause/stack, prototype name/message/toString, instanceof along the chain, and keep their identity through throw/catch; stack is the header line without frames and Error.captureStackTrace sets it. Class and static get/set accessors dispatch after own data and before methods; getter-only writes are refused or throw TypeError; super reads parent getters; class toJSON methods run in JSON.stringify. Classes in imported JavaScript need no annotations and use checked values; class method values keep one identity per class. Instances share object identity; JSON and clone boundaries expose only own fields and drop class identity. See config-api.md for initialization, inference and refusal limits. Evidence: `tests/compiler_contracts.rs` (`classes_match_node_through_generated_php_and_wire_client_types`) ## error-constructors Status: **supported**. Error, TypeError, RangeError and SyntaxError are globals in typed code, imported JavaScript and configuration evaluation, from one list (ERROR_CONSTRUCTORS in src/builtins.rs, generated into TypedPress\Builtins for the runtime). Calling or constructing one gives name, message, String() and a frameless stack as in JavaScript. instanceof matches the constructor and Error, also for errors the runtime throws, such as the SyntaxError from JSON.parse. Classes can extend any of them. Configuration evaluation can reference them and read typeof but refuses construction, because errors are runtime values. ReferenceError, EvalError, URIError and AggregateError are not globals. Evidence: `tests/compiler_contracts.rs` (`private_names_accessors_and_imported_javascript_classes_match_node`) ## javascript-promises Status: **supported**. Imported JavaScript can hold promises as values: new Promise, then/catch/finally, Promise.resolve/reject/all/allSettled/any/race/withResolvers and async callbacks. Reactions run on a deterministic per-request job queue in ECMA-262 order, and async bodies run on PHP Fibers. The queue drains to empty at handler end; an unhandled rejection is then a runtime error, and so is a promise nothing can settle (no job or timer is left). Real I/O completes in issue order. See docs/decisions/2026-11-07-promises-generators-streams.md. Evidence: `tests/compiler_contracts.rs` (`promise_jobs_generators_and_async_iteration_match_node_in_generated_php`) ## javascript-generators Status: **supported**. Imported JavaScript generators and async generators compile to PHP Generators behind the iterator protocol: yield, yield*, next/return/throw, and finally on early exit. for…of and for await…of follow the protocol and close the iterator when the loop breaks, returns or throws. Authored TypeScript still refuses generators and for await. Evidence: `tests/compiler_contracts.rs` (`promise_jobs_generators_and_async_iteration_match_node_in_generated_php`) ## javascript-streams Status: **supported**. ReadableStream (start/pull/cancel, default reader, tee, async iteration), WritableStream and TransformStream, with pipeTo and pipeThrough, are pull-driven chunk queues over the job queue. Byte streams, BYOB readers, size() strategies and pipeTo signals are refused at runtime. TypedPress\JsReadableStream::fromResource wraps a PHP stream resource. Evidence: `tests/compiler_contracts.rs` (`promise_jobs_generators_and_async_iteration_match_node_in_generated_php`) ## class-metaprogramming Status: **refused**. Diagnostic: `F1101`. Use concrete named classes with public fields and methods. See config-api.md for the supported surface. Evidence: `tests/fixtures/reject-class` ## uninstalled-package Status: **refused**. Diagnostic: `F1102`. Install the package with your package manager. TypedPress reads supported local TypeScript/ESM sources; it does not install packages or execute JavaScript. Evidence: `tests/fixtures/reject-uninstalled-package` ## installed-source-packages Status: **supported**. Locally installed source packages resolve through nearest node_modules: exact exports with import/default conditions, module entries, and supported main/index entries. Scoped packages and exact exported subpaths are supported. Static CommonJS runs once at build time: top-level `require("")` of relative files and CommonJS packages (require/default conditions), `module.exports = …` and `exports.name = …`, with named exports for ESM importers found like Node's cjs-module-lexer. Dynamic require, require inside functions, require of ES modules, require cycles, writes to module or exports inside functions, other module properties, implicit sloppy arguments, Node built-ins other than node:crypto, export patterns, package aliases, declaration-only entries and package-target escapes are refused. Raw JavaScript uses checked runtime operations; TypeScript keeps static checking. Resolving a package does not establish compatibility with its host APIs or every export. Pinned npm probes compare selected real imports to Node. Evidence: `src/loader.rs` (`installed_sources_follow_nearest_packages_exact_exports_and_relative_ts_imports`) ## unannotated-javascript Status: **supported**. Raw .js/.mjs/.cjs functions compile supported property access, calls, mutations and coercions through checked PHP dispatch. Missing values preserve undefined identity, invalid methods and null receivers throw TypeError, and TypeScript unknown still requires refinement. This supplies no Node/browser APIs, arbitrary prototypes, accessors, sparse arrays or custom iterators. The pinned npm matrix separately qualifies selected original library algorithms and combinations. Evidence: `tests/compiler_contracts.rs` (`unannotated_javascript_uses_checked_value_operations_without_weakening_typescript_unknown`) ## javascript-symbols Status: **supported**. Imported JavaScript can create symbols with Symbol(description), Symbol.for and Symbol.keyFor, and read Symbol.iterator, Symbol.asyncIterator, Symbol.toStringTag and Symbol.hasInstance. typeof is "symbol", identity is per symbol and Symbol.for registers one symbol per key for the request. description, toString() and String(symbol) work; implicit string or number conversion throws TypeError. Plain objects hold symbol-keyed properties apart from string keys, so Object.keys, Object.entries, for...in and JSON.stringify skip them; object spread copies enumerable ones, and Object.hasOwn sees them. Object.defineProperty accepts data descriptors: symbol keys keep writable/enumerable/configurable, string keys accept only the ordinary all-true descriptor. `key in object` and `delete object[key]` accept symbol keys. Class instances, classes and class prototypes resolve symbol keys exactly through their class chain (see class-symbol-members). Other built-in values may inherit well-known symbol methods TypedPress doesn't model, so reading, testing or writing a well-known symbol on them throws TypeError instead of guessing; other symbols on built-in values are absent. Evidence: `tests/compiler_contracts.rs` (`symbols_and_weak_collections_match_node_in_imported_javascript`) ## class-symbol-members Status: **supported**. Imported JavaScript classes can declare methods with a computed symbol key (`[Symbol.for("k")](x) {}`, `static [sym]() {}`, generators and async included); the key is evaluated once when the class is defined. `obj[sym](...)` and `C[sym](...)` call them with the receiver, subclasses inherit and override them, named `super.m()` calls work inside (computed `super[key]` does not), and reads give one function per class and key. `static [Symbol.hasInstance](value)` decides `value instanceof C` for C and every subclass that inherits it, and `Function.prototype[Symbol.hasInstance].call(C, value)` is the ordinary prototype-chain check. `C.prototype` is one object per class: `===`, `typeof`, `.constructor`, method reads and `key in C.prototype` (methods, accessors, `constructor` and Object.prototype names) behave as in JavaScript, and `Object.defineProperty(C.prototype, symbol, { value })` installs symbol-keyed data that instances inherit, both while the module is evaluated and inside handlers, so `symbol in instance` and `instance[symbol]` see it; a non-writable inherited symbol blocks assignment on instances. Writing, deleting, enumerating, spreading, serializing or cloning `C.prototype`, `Object.hasOwn(C.prototype, ...)`, string keys or accessor descriptors in `Object.defineProperty` on it, and reading an accessor through it throw TypeError. Typed TypeScript can use these classes through `instanceof` and `in`; see docs/decisions/2026-11-11-class-symbol-members.md. Evidence: `tests/compiler_contracts.rs` (`language_constructs_match_node_through_generated_php`) ## class-computed-string-key Status: **refused**. Diagnostic: `F2001`. A computed class method key must evaluate to a symbol. Name the method instead of computing a string key. Evidence: `tests/fixtures/reject-class-computed-string-key` ## class-well-known-symbol-method Status: **refused**. Diagnostic: `F4001`. `Symbol.iterator`, `Symbol.asyncIterator` and `Symbol.toStringTag` class methods would change iteration and tagging protocols TypedPress's runtime doesn't route through classes. Name the method and call it explicitly. Only `static [Symbol.hasInstance]` is supported. Evidence: `tests/fixtures/reject-class-well-known-symbol-method` ## typescript-class-symbol-method Status: **refused**. Diagnostic: `F4001`. Authored TypeScript has no symbol type yet, so its classes can't declare symbol-keyed methods or read `C.prototype`. Keep such classes in an imported JavaScript module and use them from TypeScript with `instanceof` and `in`. Evidence: `tests/fixtures/reject-typescript-class-symbol-method` ## typescript-symbols Status: **refused**. Diagnostic: `F4001`. Authored TypeScript has no symbol type yet. Use a string key, or keep the symbol inside an imported JavaScript module. Symbol-keyed properties can't be created while the config is evaluated. Evidence: `tests/fixtures/reject-typescript-symbol` ## javascript-weak-collections Status: **supported**. Imported JavaScript can use WeakMap (get, set, has, delete) and WeakSet (add, has, delete), built on PHP's native WeakMap. Keys must be objects or unregistered symbols; primitives, undefined and Symbol.for symbols throw TypeError as in JavaScript. A module-level new WeakMap() is one empty collection per request; entries given while the config is evaluated are refused, so populate it in code that runs in PHP. Authored TypeScript refuses WeakMap and WeakSet like Map. Evidence: `tests/compiler_contracts.rs` (`symbols_and_weak_collections_match_node_in_imported_javascript`) ## globalthis-detection Status: **refused**. Diagnostic: `F4001`. typeof globalThis, typeof globalThis.X and globalThis.X compared with undefined are resolved at compile time when X is one of TypedPress's globals (its JavaScript typeof) or a runtime TypedPress never provides (window, document, self, location, Bun, Deno, EdgeRuntime, DOMParser, WebSocketPair, XMLHttpRequest, importScripts, WorkerGlobalScope: undefined). typeof globalThis.navigator and typeof globalThis.process are "object" (host-platform). Host globals such as fetch, process, navigator, crypto, Buffer, atob and timers, and any other name, are refused at the read; call supported capabilities directly instead of detecting them. Calling an absent global is refused because it always throws. Evidence: `tests/fixtures/reject-globalthis-host` ## erased-package-typescript Status: **supported**. TypeScript sources installed under node_modules compile like JavaScript: annotations, type declarations, type-only imports and re-exports, generics, overload and abstract signatures, `this` parameters, assertion signatures and type assertions are erased, not modelled. Runtime constructs keep the checked-JavaScript subset and its refusals; enums, namespaces, parameter properties and decorators are not erased. Values crossing into authored code are JavaScript values that need refinement, and authored code can't name a package type until declaration hydration lands. Evidence: `tests/compiler_contracts.rs` (`installed_package_typescript_is_type_erased_like_javascript_and_matches_node`) ## bitwise-operators Status: **supported**. `&`, `|`, `^`, `~`, `<<`, `>>`, `>>>` and their compound assignments compile in typed code, imported JavaScript and configuration evaluation. Operands go through ToNumber, then ToInt32 (ToUint32 for the left side of `>>>`); shift counts use ToUint32 masked to five bits, so negative counts and counts of 32 or more wrap as in JavaScript. Results are signed 32-bit integers, except `>>>`, which is unsigned. NaN, the infinities and -0 become 0. Typed code requires number operands; imported JavaScript coerces strings, booleans, null, undefined and objects through their primitive value. Evidence: `tests/compiler_contracts.rs` (`language_constructs_match_node_through_generated_php`) ## in-operator Status: **supported**. `key in object` compiles in typed code, imported JavaScript and configuration evaluation. The key goes through ToPropertyKey after the key expression runs; own properties are checked first, then the value's fixed prototype chain: class methods and statics, the built-in prototype of arrays, arguments, functions, errors, regexes, Map, Set, Date and Math, then Object.prototype. Arrays are dense, so an index is present exactly when it is below the length. A primitive right side throws JavaScript's TypeError. `"key" in x` narrows object unions like TypeScript; members with an optional key stay on both branches, and `unknown` narrows to an object whose key reads stay checked. Configuration evaluation inspects plain objects, arrays and arguments, and refuses a primitive right side at build time. Evidence: `tests/compiler_contracts.rs` (`language_constructs_match_node_through_generated_php`) ## null-prototype-literals Status: **supported**. `{ __proto__: null, ... }` (a non-computed, non-shorthand `__proto__` key with the literal `null`) creates a null-prototype object in typed code, imported JavaScript and configuration evaluation, including tables built at module scope and captured by handlers. Reads of keys the object doesn't own are undefined, also for Object.prototype names such as constructor, toString and hasOwnProperty; `in` sees own keys only; calling an inherited method throws TypeError; string and number conversion throw TypeError (refused during configuration evaluation); `__proto__` and other Object.prototype names are ordinary own keys when written. Object.keys, for…in, spread and JSON.stringify behave as on an ordinary object with the same own keys, and a spread copy has the ordinary prototype. TypeScript's `__proto__: null` field is not part of the literal's type. Object.getPrototypeOf, Object.create and Object.setPrototypeOf are not supported. Evidence: `tests/compiler_contracts.rs` (`language_constructs_match_node_through_generated_php`) ## commonjs-interop-helpers Status: **supported**. While a module is evaluated at build time (module top level, including CommonJS), TypeScript, esbuild and Babel interop helpers run as in Node: `Object.create(null)` and `Object.create(Object.prototype)`; `Object.defineProperty` on plain objects, `exports` and functions with `value`, `get`, `set`, `enumerable`, `writable` and `configurable` (returning the target, with JavaScript's defaults and redefinition rules); `Object.getOwnPropertyDescriptor` on objects, arrays, strings and functions; `Object.prototype.hasOwnProperty`, `propertyIsEnumerable` and `toString` through `.call`/`.apply`; module-level `this` as `module.exports`; and own properties on a function `module.exports`, including `const { name } = require(...)`. Getters run on each build-time read; non-enumerable properties are skipped by for-in, Object.keys, spread and rest. A value with a getter, setter or non-default attribute that reaches compiled code is refused (see reject-captured-getter); docs/decisions/2026-11-12-commonjs-interop-helpers.md. Evidence: `tests/compiler_contracts.rs` (`language_constructs_match_node_through_generated_php`) ## captured-property-attributes Status: **refused**. Diagnostic: `F1002`. Compiled code reads build-time objects as constants, so a getter, setter, or non-enumerable, read-only or non-configurable property made with Object.defineProperty at module level can't reach a handler yet. Assign the value as a plain property, or read it inside the function that runs in PHP. Evidence: `tests/fixtures/reject-captured-getter` ## object-create-prototype Status: **refused**. Diagnostic: `F2001`. Object.create is modeled for `null` and `Object.prototype` only, without the properties argument; use an object literal (or `{ __proto__: null }`) for other shapes. Evidence: `tests/fixtures/reject-object-create-proto` ## boolean-function-value Status: **supported**. The global `Boolean` compiles as a call and as a function value in typed code, imported JavaScript and configuration evaluation: `.filter(Boolean)`, `.map(Boolean)`, `.some`/`.every`/`.find(Boolean)`, local and captured aliases, `globalThis.Boolean`, and arguments to user functions. Calls and the value both apply ToBoolean to the first argument and ignore the rest: 0, -0, NaN, "", null, undefined, false and 0n are false; every other value, including "0", "false", arrays, objects and functions, is true. The value is one shared function, so aliases compare equal to `Boolean`. `Boolean.name`, `Boolean.length` and `Boolean.prototype` are not supported. Evidence: `tests/compiler_contracts.rs` (`language_constructs_match_node_through_generated_php`) ## primitive-wrapper-objects Status: **refused**. Diagnostic: `F4001`. `new Boolean(x)`, `new String(x)` and `new Number(x)` create wrapper objects, which are always truthy and compare by identity; TypedPress has primitives only. Call `Boolean(x)`, `String(x)` or `Number(x)` without `new`. Configuration evaluation refuses them with the same message (F2001). Evidence: `tests/fixtures/reject-new-boolean` ## prototype-literal-object Status: **refused**. Diagnostic: `F1002`. Only `__proto__: null` is supported. A `__proto__:` key with any other value would install a custom prototype, which TypedPress doesn't model; copy the shared properties with a spread instead, or use a computed ['__proto__'] key for an own data property. Evidence: `tests/fixtures/reject-proto-object` ## prototype-literal-variable Status: **refused**. Diagnostic: `F1002`. `__proto__: someVar` is refused even when the variable holds null; write the literal `__proto__: null` for a null-prototype object, or spread the variable's properties for an ordinary one. Evidence: `tests/fixtures/reject-proto-variable` ## delete-operator Status: **supported**. `delete obj.key`, `delete obj[key]` and `delete obj?.key` compile in typed code, imported JavaScript and configuration evaluation with strict-mode semantics. They return true, also for absent and inherited properties, and remove own object keys without reordering the rest. Non-configurable properties (array and string length, string indexes, regex lastIndex, class and function prototype, arguments callee, Math constants) throw JavaScript's TypeError; null and undefined receivers throw TypeError. Typed code may delete only optional properties and map entries, as TypeScript requires, so later reads stay sound; a property the closed type lacks is a missing-field error. Evidence: `tests/compiler_contracts.rs` (`language_constructs_match_node_through_generated_php`) ## delete-required-property Status: **refused**. Diagnostic: `F4001`. TypeScript allows `delete` only on optional properties. Declare the property optional (`key?: T`) or build a new object without it. Evidence: `tests/fixtures/reject-delete-required` ## delete-array-element Status: **refused**. Diagnostic: `F4001`. TypedPress arrays are dense, and deleting an element leaves a hole that keeps the length. Use `splice(index, 1)` to remove it, or assign `undefined` to keep the length. Imported JavaScript throws RangeError at runtime instead. Evidence: `tests/fixtures/reject-delete-array-element` ## do-while-and-labels Status: **supported**. `do…while` runs its body before the first test; `continue` goes to the test. Labeled loops, switches and blocks compile with `break label` and `continue label` in typed code, imported JavaScript and configuration evaluation, through nested loops, switches and labeled blocks. Labeled function declarations are refused, as in strict mode. Evidence: `tests/compiler_contracts.rs` (`language_constructs_match_node_through_generated_php`) ## destructuring-assignment Status: **supported**. Array and object patterns on the left of `=` assign existing variables, object fields and array elements, including elisions, defaults, rest elements, nested patterns and computed keys. The right side is evaluated once and is the expression's value. Each leaf runs in JavaScript order: computed key, target reference, read, default (only for undefined), write. Typed targets must accept the value, so a missing optional field needs a default or an optional target; computed keys need an open map or a literal key. Compound destructuring assignment does not exist in JavaScript. Evidence: `tests/compiler_contracts.rs` (`language_constructs_match_node_through_generated_php`) ## typed-for-await Status: **supported**. In authored TypeScript, `for await` runs over arrays, tuples and strings whose elements are plain values or TypedPress's own promises, which the blocking model settles exactly. Async iterables, generators and values from imported JavaScript need the job queue and are refused there; imported JavaScript runs every `for await` through it. Evidence: `tests/compiler_contracts.rs` (`typed_for_await_accepts_only_settled_sync_iterables`) ## for-await-promise-literal Status: **refused**. Diagnostic: `F4001`. `for await` awaits each element as the loop reaches it, but TypedPress's blocking calls would all run before the loop starts. Await each call where it is written: `for (const v of [await a(), await b()])`. Evidence: `tests/fixtures/reject-for-await-promise-literal` ## for-await-class-instance Status: **refused**. Diagnostic: `F4001`. `for await` adopts an instance with a `then` method as a promise, which needs the job queue. Use `for (const v of items)`, or call the method explicitly. Evidence: `tests/fixtures/reject-for-await-class-instance` ## tagged-templates Status: **supported**. tag`…${x}…` calls the tag with the call site's strings array, then the substitutions, in typed code and imported JavaScript. The strings array has a `raw` property with the source text, cooked strings are undefined where an escape is invalid, each call site keeps one array across calls, and both arrays are frozen. String.raw is supported, including its object form in imported JavaScript. Configuration evaluation refuses tagged templates; call the tag inside a handler. Evidence: `tests/compiler_contracts.rs` (`language_constructs_match_node_through_generated_php`) ## bigint Status: **supported**. BigInt literals, the `bigint` type, BigInt(), BigInt.asIntN/asUintN, Number(b), String(b) and b.toString(radix) compile in typed code and imported JavaScript with ECMAScript semantics, in pure PHP (TypedPress\JsBigInt, no GMP or bcmath). Arithmetic is exact, division truncates, bitwise operators and shifts act on infinite two's complement, comparisons and loose equality compare mathematically across BigInt, number and numeric strings. Mixing BigInt and number in arithmetic, `>>>`, unary `+`, JSON serialization and Math functions throw JavaScript's TypeError; typed code refuses a static mix at the source. Configuration evaluation refuses BigInt. tests/php/bigint_test.php checks 8,800 Node-computed results. Evidence: `tests/compiler_contracts.rs` (`language_constructs_match_node_through_generated_php`) ## binary-data Status: **supported**. Imported JavaScript compiles ArrayBuffer, the integer and float typed arrays, DataView, TextEncoder, TextDecoder (UTF-8 only, fatal and ignoreBOM), Blob, File, atob and btoa through checked runtime dispatch. Views share one buffer: subarray and buffer-offset views write through, slice copies. Element writes use the ECMAScript conversions (ToUint8 wraparound, Uint8Clamped round-half-even, Int32 modulo), and integer elements are little-endian. Invalid UTF-8 decodes with WHATWG maximal-subpart replacement. Blob.stream() is a ReadableStream of Uint8Array chunks, one per non-empty part as in Node. Module-scope byte constructions with plain-data arguments are rebuilt once per request. JSON.stringify of a typed array is an object of indexes; action and ability results that contain bytes throw a TypeError with a text fix, because JSON has no byte type. TextDecoder streaming, FileReader, and typed TypeScript use of byte globals are refused. See docs/decisions/2026-11-07-binary-data.md. Evidence: `tests/compiler_contracts.rs` (`binary_data_matches_node_through_generated_php`) ## shared-memory Status: **refused**. Diagnostic: `F4001`. PHP requests share no memory between threads, so SharedArrayBuffer and Atomics have no meaning. Use ArrayBuffer. BigInt64Array and BigUint64Array are refused the same way; use DataView getUint32/setUint32 pairs. Evidence: `tests/fixtures/reject-shared-array-buffer` ## build-time-clock Status: **refused**. Diagnostic: `F2101`. Use the clock in a handler or timestamp().defaultNow(). Configuration evaluation stays pure. Evidence: `tests/fixtures/reject-build-time-clock` ## access-database-query Status: **refused**. Diagnostic: `F4101`. Return a row filter; put database effects in a hook or action. Evidence: `tests/fixtures/reject-access-query` ## field-ui-width Status: **refused**. Diagnostic: `F3101`. Use an integer percentage from 1 to 100 for .ui({ width }). Evidence: `tests/fixtures/reject-field-ui` ## undefined-as-null Status: **divergence**. Explicit undefined preserves typeof, coercion and JSON omission in compiled PHP. Some statically typed missing reads and annotation-only undefined/void still normalize to null; raw imported JavaScript uses a distinct undefined sentinel. The differential oracle normalizes final undefined results explicitly. Evidence: `tests/compiler_contracts.rs` (`documented_runtime_differences_are_measured_in_evaluation_and_compiled_php`) ## unicode-codepoint-indexing Status: **divergence**. Configuration evaluation and compiled PHP index and slice strings in UTF-16 code units, like JS. A result that would split a surrogate pair is refused at build time or throws a RangeError at runtime, because UTF-8 cannot represent a lone surrogate. Diagnostic columns also count UTF-16 code units. Evidence: `tests/compiler_contracts.rs` (`documented_runtime_differences_are_measured_in_evaluation_and_compiled_php`) ## uri-encoding Status: **supported**. encodeURI and encodeURIComponent accept one string in configuration and handlers. Component punctuation is preserved; whole-URI delimiters are preserved only by encodeURI. Values must be valid Unicode scalar strings. Evidence: `tests/compiler_contracts.rs` (`uri_vectors_agree_in_node_pure_evaluation_and_generated_php`) ## field-presentation Status: **supported**. Field .ui() metadata survives nested schema emission and schema description and maps to native SCF. It does not affect data paths, validation or access. Evidence: `tests/compiler_contracts.rs` (`nested_presentation_reaches_scf_and_public_schema_without_storage_migrations`) ## finite-type-algebra Status: **supported**. Finite object interface inheritance and intersections, generic aliases/interfaces with constraints and defaults, finite keyof/indexed access and dynamic key reads, mapped types and selected utility/conditional types retain literal and optional boundaries. Concrete aliases also preserve class identity, typed fields/constructor parameter properties and method results while generated clients erase methods at the wire boundary. See runtime-contract.md (TypeScript type normalization) for the supported domains and refusals; the strict type-semantics fixture also checks generated-client boundaries and native/WASM parity. Evidence: `tests/compiler.rs` (`compiled_php_matches_node_on_every_differential_case`) ## declared-type-predicates Status: **supported**. Synchronous concrete helpers and inline callbacks can return named-parameter type predicates. The target must be a subtype of the parameter and the body must return booleans. Calls narrow their checked argument on the true branch; filter, find and findLast narrow elements when their first callback parameter is refined. Function aliases preserve predicates; map produces booleans. As in TypeScript, the authored predicate declares the refinement; the compiler does not prove nested runtime checks. Assertions, this predicates and predicate function-type annotations are refused. Direct Boolean callbacks retain JavaScript truthiness. Required tuple destructuring positions retain their declared types; array positions may be undefined, and mutation widens tuple read views. The type-semantics fixture checks native/WASM emission and strict client types. Evidence: `tests/compiler.rs` (`compiled_php_matches_node_on_every_differential_case`) ## finite-key-validation Status: **refused**. Diagnostic: `F4001`. A finite keyof is a literal union, not string. Evidence: `tests/fixtures/reject-type-keyof` ## generic-constraint-validation Status: **refused**. Diagnostic: `F4001`. Generic arguments must satisfy their declared structural constraints. Evidence: `tests/fixtures/reject-type-constraint` ## generic-required-argument Status: **refused**. Diagnostic: `F4001`. Provide every required argument; missing arguments never widen to unknown. Evidence: `tests/fixtures/reject-type-arity` ## indexed-union-missing-key Status: **refused**. Diagnostic: `F4001`. An indexed key must exist in every member of an object union. Evidence: `tests/fixtures/reject-type-index` ## open-keyof Status: **refused**. Diagnostic: `F4001`. Use an explicit string key type for open maps. Array/prototype and symbol key spaces are not modeled. Evidence: `tests/fixtures/reject-type-open-keyof` ## recursive-type-expansion Status: **refused**. Diagnostic: `F4001`. Recursive types are refused by bounded expansion; type operations also have a step and finite-key budget. Evidence: `tests/fixtures/reject-type-recursion` ## runtime-generic-functions Status: **refused**. Diagnostic: `F4001`. Use generic aliases with concrete PHP-reachable function signatures. There is no generic runtime specialization. Evidence: `tests/fixtures/reject-type-runtime-generic` ## finite-record-presence Status: **refused**. Diagnostic: `F4001`. Record with finite string keys requires every declared key; it is not an open string map. Evidence: `tests/fixtures/reject-type-record-keys` ## boxed-structural-conditional Status: **refused**. Diagnostic: `F4001`. Conditional matching of primitive/array prototype properties is refused; use concrete scalar, array or finite object comparisons. Evidence: `tests/fixtures/reject-type-structural-predicate` ## type-declaration-merging Status: **refused**. Diagnostic: `F4001`. Combine interface declarations explicitly or use interface extends. Repeated declarations never silently replace earlier fields. Evidence: `tests/fixtures/reject-type-merging` ## conditional-check-provenance Status: **refused**. Diagnostic: `F4001`. Use direct type parameters for distributive checks, or tuple-wrap alias/type-operation checks to make non-distributivity explicit. Alias reduction can otherwise change TypeScript distributivity before instantiation. Evidence: `tests/fixtures/reject-type-conditional-alias` ## mapped-key-provenance Status: **refused**. Diagnostic: `F4001`. Use direct keyof T, a direct key parameter constrained by keyof T, or literal key domains. Aliased or reduced mapped key expressions (including Keys, Identity and keyof T | never) are refused before shape emission because reduction can change optional presence. Aliased or reduced key-parameter constraints are also refused. Evidence: `tests/fixtures/reject-type-mapped-provenance` ## scalar-typeof-guards Status: **supported**. Equality and inequality comparisons of typeof with number, string or boolean narrow unknown values and known scalar unions, including reversed operand order, property paths, conjunctions and early returns. False branches remove matching known union members; the complement of unknown remains unknown. Object, function, symbol, bigint and undefined guard domains are not added. The type-semantics fixture checks identical native/WASM output and strict generated-client types. Evidence: `tests/compiler.rs` (`compiled_php_matches_node_on_every_differential_case`) ## numeric-finiteness Status: **supported**. Global isFinite accepts zero or one argument and applies numeric coercion; Number.isFinite checks numbers without coercion. Number.isFinite is available as a stable function value, including local and captured aliases and feature detection. The differential numeric owner compares NaN, infinities, numbers, strings, null, booleans and arrays in pure configuration evaluation and PHP. Missing reads, built-in results and explicit undefined preserve their identity separately from null. Evidence: `tests/compiler.rs` (`compiled_php_matches_node_on_every_differential_case`) ## map-set-collections Status: **supported**. Typed `Map`, `Set`, `ReadonlyMap` and `ReadonlySet` compile to `TypedPress\JsMap`/`TypedPress\JsSet`: insertion order, SameValueZero keys (NaN equals NaN, -0 is +0), object keys by identity, and O(1) lookup. get/set/has/delete/clear/size/forEach, keys/values/entries, for...of, spread, Array.from and array-pattern destructuring follow JavaScript's live iteration: entries added during iteration are visited, deleted ones are skipped. An empty `new Map()`/`new Set()` needs type arguments. Module-level `new Map(entries)`/`new Set(values)` of static data are built once during configuration evaluation, which can read them with has/get/size but not mutate them, and compiled code captures one shared collection per request. Type arguments are invariant, because both collections are mutable. Calling `next()` on an iterator by hand is refused in typed code but supported in checked JavaScript, which also covers array keys/values/entries. Set algebra methods and Map getOrInsert are refused. Evidence: `tests/compiler.rs` (`compiled_php_matches_node_on_every_differential_case`) ## whatwg-url Status: **supported**. `URL` and `URLSearchParams` follow the WHATWG URL Standard through the bundled rowbot/url 4.2.1 parser (MIT), not PHP's parse_url. All 886 cases in web-platform-tests urltestdata.json (pinned revision, see tests/differential/URL-WPT-NOTICE.txt) produce WPT's expected href and components, and invalid input throws TypeError. Node 22 passes 879 of them; it lags the standard on seven newer cases. URLSearchParams and setter results match Node byte for byte. Supported: construction with a base, URL.parse and URL.canParse, component getters and setters, searchParams live-linked to its URL, toString/toJSON and JSON.stringify, and URLSearchParams from a string, [name, value] pairs or a record, with get/getAll/has/append/set/delete/sort/size/forEach/keys/values/entries and for...of. Refused: URL.createObjectURL/revokeObjectURL, and instanceof URL, because instanceof works only with named TypedPress classes. Evidence: `tests/compiler_contracts.rs` (`url_vectors_agree_in_node_and_generated_php`) ## abort-signals-and-timers Status: **supported**. `AbortController`, `AbortSignal` (aborted, reason, throwIfAborted, onabort, add/removeEventListener for "abort" with { once }), `AbortSignal.abort`, `AbortSignal.any` and `AbortSignal.timeout` follow the DOM standard. PHP has no event loop, so `abort()` dispatches synchronously in registration order, as Node does. `setTimeout`/`clearTimeout` create `TypedPress\Timers` entries that run only while the request waits: the promise job loop calls `Timers::runNext()` once microtasks are empty. That makes a timeout an observation at the next await, never an interruption mid-statement. Waiting is capped by the request budget (`TP_TIMER_BUDGET_MS`, default 30000, and the remaining max_execution_time), and with TP_NOW pinned it advances a virtual clock. A user setTimeout still pending when the handler returns is a runtime Error naming its creation site, because in Node it would fire after the response. A non-Error abort reason, dispatchEvent and listener options other than once are refused. Nested AbortSignal.any folds to its root sources, and a throwing listener doesn't stop dispatch: the error is rethrown once every listener has run, where Node would report it as uncaught. Plugins record timers in the capability lock (`timers`). The differential cases in tests/differential/cases.ts (jsAbort, typedAbort, jsTimers) compare abort ordering, backoff sleeps and timer/microtask interleaving with Node. Evidence: `tests/compiler_contracts.rs` (`timers_run_only_while_the_request_waits_and_refuse_to_outlive_the_handler`) ## builtin-overloads Status: **supported**. src/builtins.rs owns JavaScript built-in overloads, arity and phase support. Unsupported arguments are refused at the call site; runtime-only dynamic receivers throw a TypeError. Captured and runtime vectors compare UTF-16 ordering, replacement substitution, ECMAScript whitespace, modulo radix conversion and signed-zero rounding to Node. Positioned includes/startsWith/endsWith are refused in typed code and configuration evaluation; checked imported JavaScript implements those positions. Callback thisArg and nondecimal numeric toString are refused. Object.freeze is refused because freezing is not modeled. JSON parsing/serialization and Error construction are runtime-only; configuration evaluation refuses them. Custom object and function coercion are refused during configuration evaluation; handlers use the checked runtime conversion path. parseInt supports correctly rounded large values in base 10 and power-of-two bases; other radices require safe integer results. Database builders, configuration/schema factories and column modifiers share the source arity contract. Build-time function-coercion refusals include extracted methods; typed replacement callbacks preserve undefined captures and receive named groups. Captured explicit undefined remains distinct from null in both language modes. Dynamic method values use the shared built-in contract. Unknown built-in properties are refused during configuration evaluation. Powers accept safe integer results, integral binary scaling, squares, square roots and IEEE special values; other powers are refused at source or explicitly at runtime. Prototype setter literals other than `__proto__: null` are refused; computed __proto__ data properties remain supported. Extracted method calls are refused during configuration evaluation. Database writes require static collection references. Configuration for-of and destructuring use live iterators. Addition uses default primitive conversion. Sorting keeps undefined last and excludes it from comparators. JSON schemas must accept serialized values, and custom toJSON callbacks are refused. Typed Dates require explicit toISOString/toJSON before JSON.stringify or action returns. Imported JavaScript for-of uses live iterators. Ignore-case regexes require literal ASCII source and ASCII input in both modes; non-ASCII folding and encoded character escapes are refused. RegExp source and string conversion escape delimiters and line terminators. Regex split on astral text requires the u flag. Astral pattern literals and surrogate escapes also require u, even for ASCII/BMP subjects. Lone surrogate escapes in classes are refused; valid surrogate pairs and braced scalar escapes remain supported in Unicode mode. Typed invalid-Date toJSON returns null. Generated undefined defaults become null at the storage boundary. Object overwrites preserve key order. Stored JSON defaults omit undefined object properties and normalize undefined array slots to null. Numeric string conversion uses ECMAScript shortest ties-to-even formatting. Nullish narrowing retains undefined. Cyclic array string conversion omits recursive visits. Dynamic array/arguments prototype writes are refused. Typed Date string coercion requires explicit formatting. Function call/apply property values use the function contract; unmodeled function metadata/bind reads and function string conversion are refused. Optional Error/RegExp reads preserve undefined. Date construction runs default-hint object coercion. Typed Date addition/concat requires explicit formatting. Typed and imported Dates share JsDate identity and numeric primitive conversion; timestamp/date storage and filters convert explicitly. Date JSON schemas must describe their serialized text/null form. Non-ISO Date syntax receives a source diagnostic for literals and an explicit runtime refusal for computed values. Negative-zero expanded Date years are refused. Cross-family borrowed methods are refused. Unary minus performs ToNumber, and parsed JSON retains negative zero. Missing indexed and optional-property logical assignment operands retain undefined in runtime narrowing and serialized client types. Regex source escaping uses explicit UTF-8 regardless of ambient PHP multibyte settings. Configuration refuses extracted built-in method values, including identity comparisons; direct and computed receiver calls remain supported. JSON negative-zero preservation leaves exponent signs intact. Non-Unicode regex classes support digit/underscore control escapes. Runtime hasIndices and unicodeSets are false because d/v flags are refused. Runtime Error messages are own nonenumerable properties only when a defined message is supplied; name is inherited. Configuration refuses restricted arguments access instead of fabricating native Error descriptors. Error stack is the Name: message header without frames. Captured arrays and objects retain one identity across typed and imported JavaScript. Capturing lookbehind is refused because JavaScript matches captures backward. Quantified noncapturing groups require a provably nonempty body; nullable groups are refused because regex engines choose different empty iterations. JavaScript-invalid regex literals receive syntax diagnostics before lowering. Runtime constructors refuse unsupported quantifier chains. Legacy class identity escapes preserve subsequent members. Undefined becomes null at schema-shaped storage boundaries, while required fields still reject null. Unicode regex property escapes are refused because PCRE and JavaScript use different Unicode databases; use explicit character classes. Character-class escapes next to unescaped hyphens are refused; escape literal hyphens. Date strings accept ISO syntax without space/compact-offset extensions, and time requires a complete date. Typed flat accepts depths 0 and 1 (null selects 0; undefined defaults to 1), with depth-specific element inference; checked imported JavaScript supports computed depths. Configuration typeof classifies Math, JSON, console and globalThis as objects; typeof navigator and typeof process are "object"; host-dependent require/crypto detection is refused. Lexical for headers retain per-iteration bindings during configuration evaluation. Runtime closures must be created after the lexical bindings they capture are initialized; forward captures are refused instead of resolving an outer binding. The exception is a closure that is its own binding's whole initializer (self-referencing-bindings). Named callbacks may omit only parameters that accept undefined; null does not allow omission. Lexical reads and assignments before initialization refuse at source in configuration and handlers, including for/of/in source expressions; parameter defaults cannot consume a later uninitialized parameter. Error cause options are refused whether cause is own data or an inherited class method. Captured closures use closure-object identity rather than function syntax for helper/type/wrapper caches, preserving distinct factory environments. Reassigning a named exported binding is refused at the write, preventing stale import snapshots while retaining stable let/var export aliases. This includes export aliases and named default exports. Const object identity and default-export expression snapshots retain JavaScript behavior. Lexical declarations directly under switch cases require explicit braces; shared switch lexical environments are refused. Checked JavaScript class-method reads return one function per class and member; call/apply supply the receiver. Typed array calls require native methods: own overrides installed by JavaScript receive an explicit runtime refusal before arguments run; checked JavaScript retains override dispatch. Runtime for-in snapshots keys and skips deleted properties. For-of lexical destructuring bindings are predeclared in each iteration before defaults run; earlier initialized bindings remain available. Configuration evaluation shares the handler refusal of destructured var loops. Computed data-method calls retain their receiver and resolve the callee before arguments. Evidence: `tests/compiler_contracts.rs` (`builtin_vectors_agree_in_evaluation_generated_php_and_node`) ## array-sort Status: **supported**. `Array.prototype.sort` and `toSorted` match Node in typed code, checked imported JavaScript and configuration evaluation. With no comparator, elements compare by the UTF-16 code units of their string forms, so `[10, 9, 1]` sorts to `[1, 10, 9]` and astral characters sort before U+E000..U+FFFF. Any comparator function is accepted, including inconsistent ones such as `(a, b) => a.key < b.key ? -1 : 1`; its result converts with ToNumber and NaN counts as 0. Undefined elements go last and never reach the comparator. Both the runtime and the evaluator run V8's TimSort step for step, so the comparator receives Node's pairs in Node's order and effectful comparators see the same calls. `sort` returns the same array and writes it only after sorting succeeds; `toSorted` returns a new array. A non-function comparator throws TypeError at run time, including a PHP callable name such as "strcmp" passed through a cast. A generator comparator sorts as Node does in compiled code and is refused during configuration evaluation (generator-comparator-build-time). Configuration evaluation refuses objects with custom toString/valueOf in default sorting, as it does for every custom coercion. Arrays are dense, so holes do not occur. Evidence: tests/differential/language/sort.ts and sort-helpers.mjs. Evidence: `tests/compiler_contracts.rs` (`language_constructs_match_node_through_generated_php`) ## generator-comparator-build-time Status: **refused**. Diagnostic: `F2001`. A generator function returns a generator object, which ToNumber turns into NaN, so as a comparator it leaves the order unchanged. Configuration evaluation runs a generator's body as a plain call and would see its return value instead, so it refuses a generator comparator at the sort. Compiled handlers and imported JavaScript run it as Node does. Evidence: `tests/fixtures/reject-generator-comparator` ## symbol-comparator-result-build-time Status: **refused**. Diagnostic: `F2001`. A comparator result converts with ToNumber, and a symbol can't, so Node throws a TypeError. Configuration evaluation refuses the sort at the call; compiled handlers and imported JavaScript throw the TypeError. Evidence: `tests/fixtures/reject-symbol-comparator` ## locale-collation Status: **refused**. Diagnostic: `F4001`. Locale collation depends on the host and cannot be reproduced deterministically. localeCompare is refused in configuration and typed handlers; checked imported JavaScript throws TypeError. Use < or > for deterministic UTF-16 ordering. No byte-order substitute is exposed under the localeCompare name. Evidence: `tests/fixtures/reject-locale-compare` ## object-reflect-runtime Status: **supported**. Imported JavaScript runs Object.assign(target, ...sources) on an object or array target (own enumerable string keys, then symbols, null and undefined sources skipped, TypeError on a null target), Reflect.ownKeys on plain objects and arrays (integer keys ascending, then strings in insertion order, then symbols; arrays add length), and Object.prototype.toString.call(x) at request time. Evidence: tests/differential/language/object-reflect.ts. Typed code keeps Object.assign at build time only. Evidence: `tests/compiler_contracts.rs` (`language_constructs_match_node_through_generated_php`) ## subtle-digest Status: **supported**. Imported JavaScript compiles crypto.subtle.digest(algorithm, data): SHA-1, SHA-256, SHA-384 and SHA-512 by name in any case or as { name }, over an ArrayBuffer, typed array or DataView, resolving to an ArrayBuffer; an unknown algorithm rejects with NotSupportedError and non-binary data with TypeError. Evidence: tests/differential/language/subtle-digest.ts. Evidence: `tests/compiler_contracts.rs` (`language_constructs_match_node_through_generated_php`) ## host-platform Status: **supported**. typeof navigator and typeof process, also through globalThis., are the constant "object" in compiled code and in the build-time evaluator. navigator.platform and process.platform (and navigator?.platform, process?.platform) are strings read when PHP runs, from TypedPress\Host, with Node's names: process.platform is win32, darwin, sunos or the lower-cased PHP_OS (linux, freebsd, aix), and navigator.platform follows Node's rule over platform and CPU architecture (Win32, MacIntel, Linux x86_64, Linux arm64, FreeBSD amd64, AIX). They are never decided on the build machine. picomatch 4.0.7's isWindows compiles unchanged. Evidence: tests/differential/language/host-platform.ts; the mapping for every OS is tests/php/host_test.php. See docs/decisions/2026-11-14-host-platform-detection.md. Evidence: `tests/compiler_contracts.rs` (`language_constructs_match_node_through_generated_php`) ## string-from-char-code Status: **supported**. String.fromCharCode(...codes) (each ToUint16, one UTF-16 code unit, so surrogate pairs combine) and String.fromCodePoint(...points) (RangeError outside 0..0x10FFFF or for a fraction) compile in typed TypeScript, imported JavaScript and configuration evaluation. Evidence: tests/differential/language/char-codes.ts. Evidence: `tests/compiler_contracts.rs` (`language_constructs_match_node_through_generated_php`) ## lone-surrogate-char-code Status: **refused**. Diagnostic: `F2001`. Strings are stored as UTF-8, which has no lone surrogates. Pair each high surrogate with a low one, or build the character with String.fromCodePoint. At run time the same call throws a RangeError. Evidence: `tests/fixtures/reject-lone-surrogate-char-code` ## builtin-instanceof Status: **supported**. In imported JavaScript, `value instanceof C` answers from the runtime class when C is RegExp, Map, Set, WeakMap, WeakSet, Date, URL, URLSearchParams, AbortController, AbortSignal, Promise or a stream class. None of these can be subclassed in compiled code, so the check is exact. Evidence: tests/differential/language/builtin-instanceof.ts. Evidence: `tests/compiler_contracts.rs` (`language_constructs_match_node_through_generated_php`) ## optional-chains Status: **supported**. Optional chains support guarded property/index steps and single optional method calls. In imported JavaScript, optional calls `f?.()`, `o.m?.()` and `o[k]?.()` read the callee once (keeping its receiver) and skip the call and its arguments when it is null or undefined (tests/differential/language/optional-calls.ts). A non-optional continuation after a short-circuiting link is refused at source; guard each nullable step explicitly. Parenthesized chain boundaries retain ordinary property access and call behavior. Evidence: `tests/compiler_contracts.rs` (`optional_chains_refuse_unguarded_continuations_at_source`) ## optional-call-typed Status: **refused**. Diagnostic: `F4001`. Optional calls compile in imported JavaScript. In typed TypeScript, check the function first: `if (f) f(...)`. Evidence: `tests/fixtures/reject-optional-call-typed` ## parameter-default-scope Status: **supported**. Defaults may reference earlier parameters. Closure defaults require a function body without new bindings and cannot refer to the current/later parameter. Classes and nested function creation in defaults are refused. These source diagnostics also cover nested destructuring defaults, preserving parameter initialization and closure scope. Evidence: `tests/compiler_contracts.rs` (`parameter_default_scope_limits_are_located_refusals`) ## undefined-bindings Status: **supported**. undefined denotes the built-in missing value. Runtime bindings named undefined are refused at source, including function/class names, parameters, local declarations, imports, catch variables, loop variables and rest/destructuring bindings. Use a different local name. Evidence: `tests/compiler_contracts.rs` (`undefined_bindings_are_located_refusals_in_all_runtime_binding_forms`) ## wordpress-ability-unknown Status: **refused**. Diagnostic: `F4001`. abilities.call from "php/wordpress" names an ability the build can type: one of the app's own (collections, actions, globals) or one locked in tp/_generated/abilities.json by `typedpress abilities pull --site `. Any other name is refused with the closest known name; pull and commit the lock to call another plugin's ability. Evidence: `tests/fixtures/reject-ability-unknown` ## wordpress-ability-input Status: **refused**. Diagnostic: `F4001`. An ability's input is checked against the TypeScript type generated from its input JSON Schema (enums, required properties, closed objects). WordPress validates the same schema again at run time; a mismatch the build can see never ships. Evidence: `tests/fixtures/reject-ability-input` ## wordpress-ability-name Status: **refused**. Diagnostic: `F4001`. The ability name must be written in place so the build can type the input and result and record which abilities the app uses. Branch between literal calls when the ability depends on data. Evidence: `tests/fixtures/reject-ability-name` ## wordpress-ability-call Status: **supported**. abilities.call("vendor/name", input) compiles to TypedPress\Wp\Abilities\Call::run, which runs core's WP_Ability::execute() for the current WordPress user. The app's own abilities are typed from the schema without a pull; others from tp/_generated/abilities.json, which build and check read without touching the network. tp/_generated/db.d.ts carries the same types for the editor. Evidence: `tests/compiler_contracts.rs` (`wordpress_abilities_are_typed_from_the_lock_and_the_schema`) ## wordpress-hook-unknown Status: **refused**. Diagnostic: `F3001`. A tp/wp-hooks/ file or directory is named after a hook in the pinned catalog (src/wordpress/catalog.json, generated by scripts/wordpress-catalog.py from core's docblocks). Any other name is refused with the closest catalog hook, because an untyped hook would pass PHP values the compiler cannot check. Evidence: `tests/fixtures/reject-wp-hook-unknown` ## wordpress-hook-filter-return Status: **refused**. Diagnostic: `F4001`. A filter handler returns the filtered value: its first argument's type, from the catalog. Returning another type would hand WordPress a value its later callbacks do not expect. Evidence: `tests/fixtures/reject-wp-hook-filter-return` ## wordpress-hook-no-default Status: **refused**. Diagnostic: `F3001`. Each tp/wp-hooks/ file default-exports one handler and may export an integer `priority`. Other exports are refused; share code through an ordinary imported module. Evidence: `tests/fixtures/reject-wp-hook-no-default` ## wordpress-hook-file Status: **refused**. Diagnostic: `F1003`. tp/wp-hooks/ holds only .ts handler files (directly, or one directory deep named after the hook). Anything else is refused at its path instead of being skipped, so a handler never silently fails to register. Evidence: `tests/fixtures/reject-wp-hook-file` ## wordpress-hooks Status: **supported**. tp/wp-hooks/.ts and tp/wp-hooks//*.ts handlers compile to PHP functions typed from the catalog and register with add_filter/add_action in the app plugin; one hook's files run in file-name order at priority 10 unless a file exports `priority`. Evidence: `tests/compiler_contracts.rs` (`wp_hooks_register_in_file_order_with_their_priorities`) ## wordpress-function-unknown Status: **refused**. Diagnostic: `F2001`. "php/wordpress" exports the catalog's WordPress functions only: each is admitted when its PHP signature maps soundly (no by-reference parameters, no echoing template tags, no reliance on request globals). Anything else is refused at the import with the list of admitted functions. Template tags such as the_title echo; use their get_ form (get_the_title, once admitted) or a wp-hooks/ filter. Evidence: `tests/fixtures/reject-wp-function-unknown` ## wordpress-function-argument Status: **refused**. Diagnostic: `F4001`. WordPress function arguments are checked against the catalog's types, from the pinned php-stubs/wordpress-stubs signatures and phpdoc, narrowed where a PHP parameter accepts several shapes (get_post takes a post id). Evidence: `tests/fixtures/reject-wp-function-argument` ## wordpress-functions Status: **supported**. Allowlisted WordPress functions compile to TypedPress\Wp\Functions::call(name, [args]): a direct PHP call through the value conversions. WP_Post and WP_User results become the same read-only views hook arguments are, and a WP_Error result throws an HttpError with its own status (422 when it has none). A function that answers "or false" (get_userdata: WP_User | false, get_permalink: string | false) is narrowed by `=== false`, `!== false` or truthiness, and stays narrowed across the calls that follow, as a null check does. Evidence: `tests/compiler_contracts.rs` (`wordpress_functions_run_as_the_signed_in_user`) ## wordpress-protected-option Status: **refused**. Diagnostic: `F4301`. get_option, update_option and delete_option refuse WordPress's site settings that load code, move sign-in or change roles (active_plugins, template, stylesheet, siteurl, home, admin_email, users_can_register, default_role, {prefix}user_roles, cron, upload paths, jetpack_* and the others in runtime/TypedPress/Wp/guard.json), TypedPress's own tp_* options and transients; options whose names hold secrets (salts, tokens, passwords, jetpack_private_options) can't be read either. A literal name is refused here; a name built at runtime is refused by TypedPress\Wp\Guard with 403 protected_option. Names compare case-insensitively, and a name outside printable ASCII is refused. wp_insert_post takes post, page or another plugin's public post type only. Keep app settings in a global, a table or an option name of the app's own. Evidence: `tests/fixtures/reject-wp-protected-option` ## plugin-narrowed-write Status: **refused**. Diagnostic: `F4201`. A plugin's capabilities are inferred from its compiled code, including writes made by helpers it passes a row to. The committed tp/_generated/plugins.lock.json is the grant: when the owner narrows an entry and the package source is unchanged, code beyond the entry is refused at the call that needs it. Remove the call or add the value to the entry. Evidence: `tests/fixtures/reject-plugin-write` ## plugin-static-host Status: **refused**. Diagnostic: `F4201`. A fetch URL with a written https://host/ prefix (string, template or concatenation) is checked against the plugin's locked hosts at build time. A URL built at runtime is recorded as * and checked against the locked hosts on every request and redirect hop. Evidence: `tests/fixtures/reject-plugin-http` ## plugin-cross-import Status: **refused**. Diagnostic: `F1201`. A plugin package imports its own modules, "typedpress" and ordinary npm packages, compiled under its own grant. It can't import the app's modules or another registered plugin's package; its compiled helpers, captured data and class state are namespaced per plugin. Evidence: `tests/fixtures/reject-plugin-isolation` ## plugin-app-kinds Status: **refused**. Diagnostic: `F1201`. A plugin can't import "typedpress:db": the app's kinds are app values, which a plugin receives only through its options, so its lock grant names exactly what the app handed it. Evidence: `tests/fixtures/reject-plugin-db` ## host-globals Status: **supported**. Handlers use the standard host forms, type-checked by @types/node: the global fetch(url, { method, headers, body, redirect }) with a Response (status, statusText, ok, url, redirected, bodyUsed, headers.get/has/forEach, text(), json()), Headers and URLSearchParams; process.env.NAME and process.env["NAME"] (string | undefined); crypto.randomUUID(); and from "node:crypto" (import or a top-level const require) createHash and createHmac chains ending in digest("hex" | "base64" | "base64url"), randomBytes(n).toString(encoding), randomUUID and timingSafeEqual(Buffer.from(a), Buffer.from(b)). They lower in src/compile/host.rs onto TypedPress\Fetch (HTTPS-only egress policy), TypedPress\Env and TypedPress\Crypto. See config-api.md. Evidence: `tests/compiler_contracts.rs` (`host_globals_match_node_through_generated_php`) ## fetch-signal Status: **refused**. Diagnostic: `F4001`. Every call already ends after 10 s. credentials, mode, cache and the other browser options are refused because they have no effect server-side. Evidence: `tests/fixtures/reject-fetch-signal` ## fetch-binary-body Status: **refused**. Diagnostic: `F4001`. Send a string (JSON.stringify(value) for JSON) or URLSearchParams. Blob, FormData, ArrayBuffer and stream bodies are not available. Evidence: `tests/fixtures/reject-fetch-body` ## response-streams Status: **refused**. Diagnostic: `F4001`. The body is read in full (at most 1 MiB) before fetch() resolves. Read it with text() or json(); arrayBuffer, blob, formData and clone are refused. Evidence: `tests/fixtures/reject-response-stream` ## process-env-dynamic Status: **refused**. Diagnostic: `F4001`. Name the variable: process.env.NAME or process.env["NAME"]. Computed names, iterating process.env and writes are refused, so request input cannot choose a server variable. Evidence: `tests/fixtures/reject-process-env-dynamic` ## process-env-host Status: **refused**. Diagnostic: `F4001`. WordPress's database login (DB_NAME, DB_USER, DB_PASSWORD, DB_HOST), its keys and salts (AUTH_KEY … NONCE_SALT, SECRET_KEY, SECRET_SALT, WP_CACHE_KEY_SALT) the Secrets API site key (WP_SECRETS_KEY, WP_SECRETS_KEY_PREVIOUS) and core's filesystem and proxy credentials (FTP_USER, FTP_PASS, FTP_PUBKEY, FTP_PRIVKEY, WP_PROXY_USERNAME, WP_PROXY_PASSWORD) can't be read through process.env or env(), and read as unset at runtime on every host. Give the app its own variable. Evidence: `tests/fixtures/reject-process-env-host` ## process-members Status: **refused**. Diagnostic: `F4001`. Handlers run in PHP. Only process.env.NAME and process.platform are supported. Evidence: `tests/fixtures/reject-process-member` ## process-member-reads Status: **refused**. Diagnostic: `F4001`. process.arch, process.version, process.versions, process.release, process.argv, process.title, process.browser and every other process member except env.NAME and platform are refused at the read: Node defines them and TypedPress has no true value for them. Detecting Node itself (process.versions.node, process.release.name) is not decided yet. Evidence: `tests/fixtures/reject-process-member-read` ## navigator-members Status: **refused**. Diagnostic: `F4001`. navigator.userAgent, navigator.language, navigator.languages, navigator.hardwareConcurrency and every other navigator member, and navigator[k], are refused at the read. Node defines them, so answering undefined would differ silently. Read navigator.platform, or test typeof navigator. Evidence: `tests/fixtures/reject-navigator-member` ## host-object-values Status: **refused**. Diagnostic: `F4001`. navigator and process are not values: passing, assigning, returning, comparing or testing them alone (if (process), process && x) is refused at the name. globalThis.navigator and globalThis.process are refused except under typeof. Writes to either object are refused. Evidence: `tests/fixtures/reject-host-object-value` ## platform-at-build-time Status: **refused**. Diagnostic: `F2001`. process.platform and navigator.platform exist only when PHP runs on the WordPress server, so reading either while a module's top level is evaluated at build time is refused at the read. Read it inside a hook, action, route or job, or a function they call. Evidence: `tests/fixtures/reject-platform-build-time` ## env-in-handlers Status: **refused**. Diagnostic: `F4001`. env("NAME") is a deferred reference inside defineConfig (webhook URLs and secrets, action signatures, upload credentials). Handlers read runtime variables with process.env.NAME. Evidence: `tests/fixtures/reject-env-handler` ## web-crypto-subtle Status: **refused**. Diagnostic: `F4001`. Imported JavaScript compiles crypto.subtle.digest (see subtle-digest). Typed TypeScript hashes and signs with createHash and createHmac from "node:crypto". Evidence: `tests/fixtures/reject-crypto-subtle` ## web-crypto-random-values Status: **refused**. Diagnostic: `F4001`. Typed arrays are not compiled. Use randomBytes(n).toString("hex") from "node:crypto", or crypto.randomUUID(). Evidence: `tests/fixtures/reject-crypto-random-values` ## node-crypto-members Status: **refused**. Diagnostic: `F2001`. node:crypto provides createHash, createHmac, randomBytes, randomUUID and timingSafeEqual. Ciphers, keys, KDFs and streams are not compiled. Evidence: `tests/fixtures/reject-node-crypto-member` ## node-crypto-buffers Status: **refused**. Diagnostic: `F4001`. Finish a hash in one expression with a string encoding: createHash("sha256").update(text).digest("hex"). Buffers exist only inside timingSafeEqual(Buffer.from(a), Buffer.from(b)) and Buffer.byteLength(text). Evidence: `tests/fixtures/reject-digest-buffer` ## timing-safe-equal-strings Status: **refused**. Diagnostic: `F4001`. Pass Buffer.from(a) and Buffer.from(b). As in Node, inputs of different byte lengths throw RangeError, so check Buffer.byteLength first. Evidence: `tests/fixtures/reject-timing-safe-equal` ## node-builtins Status: **refused**. Diagnostic: `F1102`. Handlers run in PHP. Use the global fetch, process.env.NAME and "node:crypto". Evidence: `tests/fixtures/reject-node-builtin` ## require Status: **refused**. Diagnostic: `F1102`. Static CommonJS may require("node:crypto") (or "crypto"); it resolves through the same built-in module lookup as import. Other Node built-ins are refused whether imported or required. Evidence: `tests/fixtures/reject-require-module` ## typedpress-fetch-import Status: **refused**. Diagnostic: `F2001`. fetch and crypto are the standard globals, not "typedpress" exports. Remove them from the import. Evidence: `tests/fixtures/reject-typedpress-fetch-import` ## build-time-namespaces Status: **supported**. A member chain rooted at a module-level object that holds functions (`import * as ns`, `const o = { f }`, `export default { f }`) resolves at compile time: functions compile to helpers and data to the shared captured singleton for that sub-value. Functions may carry own properties set with `f.x = v` or build-time `Object.assign(f, ...)`; they are called and their properties are read the same way. The differential cases `namespaceImport`, `namespaceLocal`, `namespaceDefault`, `functionProperties` and `functionAssign` run in Node and PHP. Evidence: `tests/compiler_contracts.rs` (`build_time_namespaces_resolve_members_and_refuse_whole_values`) ## namespace-value Status: **refused**. Diagnostic: `F4001`. An object that holds functions has no PHP form. Call or read its members directly (`ns.fn(x)`, `ns.value`) instead of passing, storing, spreading, iterating or writing the object. Evidence: `tests/fixtures/reject-namespace-value` ## function-properties-value Status: **refused**. Diagnostic: `F4001`. A PHP closure can't carry properties. Call the function or read its properties directly (`f(x)`, `f.prop`, `f.method(x)`) instead of using it as a value. Evidence: `tests/fixtures/reject-function-properties-value` ## named-function-expressions Status: **supported**. `function name() {}` as an expression binds `name` only inside itself, to itself, as in JavaScript: recursion works, parameters and `var`s of the same name shadow it, and the name is not visible outside. Assigning to the name inside the function throws in strict JavaScript, so it is refused with a pointer; assign to a local variable instead. Local function declarations with a declared signature, and every function in imported JavaScript, may also call themselves; so may a `const`/`let` arrow or function expression (self-referencing-bindings). Evidence: `tests/compiler_contracts.rs` (`language_constructs_match_node_through_generated_php`) ## self-referencing-bindings Status: **supported**. A `const` or `let` whose whole initializer is an arrow or function expression (optionally under `as`, `satisfies` or `!`) can be named inside that function, so `const fact = (n) => (n <= 1 ? 1 : n * fact(n - 1))` recurses as in JavaScript. Nothing inside the function can run before the binding holds it, so no runtime check is needed. A parameter or inner binding of the same name shadows it. In typed TypeScript the self-reference is typed by the function's own parameter and return annotations, or by a function-type annotation on the declaration; without them it is refused. A `let` can be reassigned before its closure runs, so its self-reference reads as the declared type (dynamic in imported JavaScript): calling it after it was set to a non-function throws a TypeError, as in JavaScript. Direct reads during initialization and closures created any other way in the initializer stay refused. Mutual recursion between `const` bindings is a forward reference and is refused; use function declarations. See docs/decisions/2026-11-09-self-referencing-bindings.md. Evidence: `tests/compiler_contracts.rs` (`language_constructs_match_node_through_generated_php`) ## self-reference-read-during-initialization Status: **refused**. Diagnostic: `F4001`. Reading a `const`/`let` in its own initializer throws a ReferenceError in JavaScript. Compute the value without the binding, or make the initializer a function that refers to itself. Evidence: `tests/fixtures/reject-self-reference-read` ## self-reference-called-during-initialization Status: **refused**. Diagnostic: `F4001`. A closure that captures its own binding but is created inside a larger initializer, such as an immediately called function, could run before the binding is assigned, where JavaScript throws a ReferenceError. Only a closure that is the whole initializer may capture its binding; restructure so the function is assigned directly. Evidence: `tests/fixtures/reject-self-reference-called-in-initializer` ## self-reference-nullable-let Status: **refused**. Diagnostic: `F4001`. A `let` can be reassigned before its closure calls it, so the self-call is checked against the declared type, as TypeScript does. Check the binding first (`if (f) f(n - 1)`), declare it as a function type, or use `const`. Evidence: `tests/fixtures/reject-self-reference-nullable-let` ## self-reference-untyped Status: **refused**. Diagnostic: `F4001`. In typed TypeScript a recursive `const` arrow needs its type before its body compiles. Annotate every parameter and the return type, e.g. `const fact = (n: number): number => ...`, or annotate the declaration with a function type. Evidence: `tests/fixtures/reject-self-reference-untyped` ## this-outside-classes Status: **supported**. An ordinary function or object-literal method that reads `this` gets its call receiver: the object for a method call (`obj.m()`, `obj[k]()`), the first argument of `call`/`apply`, and undefined for a plain call (strict mode). Arrows inside see the same `this`. In authored TypeScript, `this` is typed by a `this:` parameter, or for an object-literal method by the literal's own fields. `this` at module level, in a module-level arrow, or before `super()` in a derived constructor is refused with a fix. Evidence: `tests/compiler_contracts.rs` (`language_constructs_match_node_through_generated_php`) ## tsx-server-components Status: **supported**. Functions exported under a capitalized name from `tp/components/*.tsx` compile to PHP functions that return escaped HTML (`\TypedPress\Html`), listed in schema.php `components`; lowercase exports are ordinary helpers. Output matches react-dom/server 19.2.8 byte for byte, apart from its `` text separators and image preload links: null, undefined and booleans render nothing, `{0 && }` renders 0, numbers print as JavaScript prints them, arrays concatenate, entities are spelled `& < > " '`, and attributes follow React's names, boolean, style and form-element rules. `&&`, `?:`, `??`, `.map`, `.length` and string and array methods on props work as in handlers. Components are called with one typed props object; `children` is what React passes (one child as itself, several as an array, absent as undefined; type it `ReactNode`), and a component runs only when its element is placed, so children it never places never run. `key` evaluates and is dropped. Async components block until their data is in. Attributes a browser loads or navigates to (`href`, `src`, `action`, `formAction`, `data`, `poster`, `xlink:href` and others, in any letter case) allow http(s), mailto and URLs without a scheme; anything else is a build error when literal and dropped when computed. `on*` attributes never reach the HTML. See docs/decisions/2026-11-08-tsx-to-php.md. Evidence: `tests/compiler.rs` (`compiled_tsx_renders_the_html_react_renders`) ## jsx-unsafe-url Status: **refused**. Diagnostic: `F4001`. Use an http(s) or mailto URL, or one without a scheme (`/path`, `?page=2`, `#top`). A computed URL that fails the same check drops the attribute at render time. Evidence: `tests/fixtures/reject-jsx-unsafe-url` ## jsx-server-event-handler Status: **refused**. Diagnostic: `F4001`. Event handlers run in the browser; move them into a "use client" component. Evidence: `tests/fixtures/reject-jsx-handler` ## jsx-dangerously-set-inner-html Status: **refused**. Diagnostic: `F4001`. Render the value as a child, which is escaped. Trusted markup will use ``. Evidence: `tests/fixtures/reject-jsx-inner-html` ## jsx-object-child Status: **refused**. Diagnostic: `F4001`. React throws on an object child; render one of its fields, or map a list to elements. Evidence: `tests/fixtures/reject-jsx-object-child` ## jsx-component-props Status: **refused**. Diagnostic: `F4001`. Props are type-checked against the component's annotation like any call; pass values of the declared types. Evidence: `tests/fixtures/reject-jsx-props` ## jsx-head-elements Status: **refused**. Diagnostic: `F4001`. React hoists ``, `<meta>`, `<link>`, `<script>`, `<style>` and `<base>` into the document head, which a server component can't reproduce. Set titles and meta tags with `export const metadata`, import a stylesheet from TSX (`import "./site.css"`), and load a script module with `scripts` in `metadata` (`scripts: ["/app.js"]` is `public/app.js`). Evidence: `tests/fixtures/reject-jsx-head` ## jsx-in-config Status: **refused**. Diagnostic: `F1003`. JSX compiles in `tp/components/`, pages and "use client" files; modules the config imports stay plain TypeScript. Evidence: `tests/fixtures/reject-jsx-config` ## jsx-in-action-result Status: **refused**. Diagnostic: `F1003`. Rendered JSX exists only while a page renders, so the config (and the actions it defines) can't import a component; return data from actions and render it in a component. Evidence: `tests/fixtures/reject-jsx-action` ## jsx-textarea-children Status: **refused**. Diagnostic: `F4001`. Set a textarea's text with `defaultValue` (or `value`), as React asks. Evidence: `tests/fixtures/reject-jsx-textarea` ## jsx-srcdoc-value Status: **refused**. Diagnostic: `F4001`. `srcDoc` is a document parsed as HTML, so it is refused even as a literal. Link to the document with `src`; trusted markup will use `<Html>`. Evidence: `tests/fixtures/reject-jsx-srcdoc` ## jsx-raw-text-tag-case Status: **refused**. Diagnostic: `F4001`. Tag names are matched case-insensitively, as browsers read them: `<sCript>` is `<script>`. Evidence: `tests/fixtures/reject-jsx-script-case` ## jsx-raw-text-children Status: **refused**. Diagnostic: `F4001`. `script`, `style`, `textarea`, `title`, `iframe`, `noscript`, `template`, `xmp`, `noembed`, `noframes`, `plaintext`, `object` and `embed` take only literal children, because their content isn't escaped text. Evidence: `tests/fixtures/reject-jsx-iframe-child` ## jsx-raw-text-close Status: **refused**. Diagnostic: `F4001`. A literal child of a raw-text tag can't contain that tag's closing `</tag`. Evidence: `tests/fixtures/reject-jsx-raw-close` ## jsx-open-spread Status: **refused**. Diagnostic: `F4001`. Spread only objects whose type lists their keys; each key is checked as if written out. `Record<string, …>`, index signatures, `any` and `unknown` are refused. Evidence: `tests/fixtures/reject-jsx-open-spread` ## jsx-spread-event-handler Status: **refused**. Diagnostic: `F4001`. A closed spread's keys meet the same rules as written attributes, so a spread can't add an event handler, `srcDoc` or an unsafe literal URL. Evidence: `tests/fixtures/reject-jsx-spread-handler` ## jsx-computed-style Status: **refused**. Diagnostic: `F4001`. `style` takes an object whose keys are known at build time; values from data are escaped, and values that add declarations or load a `url(` are dropped. Evidence: `tests/fixtures/reject-jsx-style-keys` ## jsx-attribute-name Status: **refused**. Diagnostic: `F4001`. Attribute names match `[a-zA-Z_:][a-zA-Z0-9_.:-]*`. Evidence: `tests/fixtures/reject-jsx-attribute-name` ## jsx-svg-animation Status: **refused**. Diagnostic: `F4001`. SVG `animate`/`set` can rewrite their target's attributes: they never target URL or event attributes, and `values`/`to`/`from`/`by`/`attributeName` must be literal. Evidence: `tests/fixtures/reject-jsx-svg-animate` ## jsx-use-client Status: **supported**. A .tsx file under tp/components/ that starts with "use client" (after comments and other directives such as "use strict") compiles to the WordPress Interactivity API: its server HTML from the server generator, plus a store module the page loads. useState, derived values, handlers, useEffect, useMount, useEvent, useRef (attached to one element of the component with `ref={name}`; `name.current` is that element in handlers and effects), sharedState, useLive (a list read the server seeds and the page keeps current), server action calls, keyed lists (`items.map((item) => <li key={item.id}>…</li>)`) and reactive `&&` and `?:` over elements compile; the browser re-renders lists and conditionals from `<template>`s. Evidence: `tests/app_router.rs` (`client_components_compile_to_interactivity_stores`) ## jsx-comments Status: **supported**. `<Comments for={item} />` from "typedpress/app" renders the item's thread as the visitor may read it and a form that works without JavaScript. The item's kind must turn `comments` on; who may comment, moderation and reply depth are the kind's and enforced where comments are created, not props. Evidence: `tests/app_router.rs` (`comments_follow_the_kind_policy_on_every_path`) ## jsx-pagination Status: **supported**. `<Pagination page={search.page} pages={n} />` from "typedpress/app" renders numbered links to a listing's other pages as a `<nav>` that works without JavaScript: each link changes only `page` (or `param`) in the current URL, page 1 drops it, and long runs collapse around the current page. Evidence: `tests/app_router.rs` (`app_router_serves_pages_on_wordpress`) ## jsx-search Status: **supported**. `<Search />` and `<SearchResults q={search.q} />` from "typedpress/app" are a search form that works without JavaScript (a GET with `q`) and the matching rows the visitor may read, each its title linked to its kind's URL; one kind pages with `page`, every kind groups per kind. A page that searched is private, noindex and never recorded for purges. Evidence: `tests/app_router.rs` (`search_pages_answer_as_the_visitor`) ## jsx-live Status: **supported**. `<Live id="notes">…</Live>` from "typedpress/app" marks part of a server page the browser keeps current: when something the page read for it changes, the region is rendered again as the visitor and updated in place through the Interactivity router. `id` is a literal, unique on the page; `<Live>` belongs in server components (a client component uses `useLive`). Evidence: `tests/app_router.rs` (`live_regions_update_in_the_browser`) ## jsx-form-action Status: **supported**. `<form action={subscribe}>` in a page or server component posts to the imported action and works without JavaScript: the form is sent form-encoded to the action's endpoint, fields read as the action's input types them, and the visitor comes back to the page with a 303. `useFormState(subscribe)` from "typedpress/app" reads the result or the error once. `method` and `encType` on such a form, and an action form inside a "use client" component, are build errors. Evidence: `tests/app_router.rs` (`forms_work_without_javascript`) ## jsx-use-client-npm Status: **refused**. Diagnostic: `F1003`. Client components run in the browser without a bundler: import "typedpress/client" and relative modules only. Evidence: `tests/fixtures/reject-client-npm` ## jsx-use-client-root Status: **refused**. Diagnostic: `F4001`. The root element carries the Interactivity directives: wrap fragments, components and conditionals in one element. Evidence: `tests/fixtures/reject-client-root` ## jsx-children-type Status: **refused**. Diagnostic: `F4001`. `children` is what JSX passes: type it `ReactNode`, `JSX.Element`, `string` or `number`. Taking rendered children apart isn't supported. Evidence: `tests/fixtures/reject-jsx-children-object` ## jsx-config-reachable Status: **refused**. Diagnostic: `F1003`. A `.tsx` module the config imports is refused even when its JSX never runs; components live in `tp/components/`. Evidence: `tests/fixtures/reject-jsx-config-unused` ## jsx-children-type-local Status: **refused**. Diagnostic: `F4001`. Every component's `children`, exported or local, is checked where JSX calls it. Evidence: `tests/fixtures/reject-jsx-children-local` ## jsx-style-spelling Status: **refused**. Diagnostic: `F4001`. Browsers read `STYLE` and `Style` as `style`, which TypedPress narrows to the properties its type declares; write `style` in lowercase, as an attribute or a spread key. Evidence: `tests/fixtures/reject-jsx-style-case` --- # Introducing SpacePress: TypeScript That Compiles Directly to WordPress > Write schemas, SQL tables, access rules, server actions, background jobs, and TSX pages in TypeScript — compiled with Rust into native PHP and WordPress plugins with zero Node.js in production. Source: https://spacepress.dev/blog/introducing-spacepress Today we are introducing **SpacePress** (`spacepress.dev`) — a full-stack TypeScript framework whose Rust and OXC compiler turns your application directly into native PHP, numbered SQL migrations, OpenAPI 3.1, a typed client, and standard WordPress plugins. ## Why compile TypeScript to WordPress? Teams building content-heavy products, editorial sites, and storefronts face an awkward split: either adopt a modern TypeScript stack and rebuild editorial workflows, media libraries, permissions, comments, and commerce from scratch — or adopt WordPress and give up end-to-end type safety, clean migrations, and modern component authoring. SpacePress bridges both worlds without running a Node.js server in production: - **One TypeScript schema, two storage engines:** Use `collection()` for WordPress posts (with Gutenberg, drafts, revisions, staged versions, and comments) right alongside `table()` for relational SQL tables with automatic migrations and compound indexes. - **Native PHP compilation:** Declarative access rules, field validation, transactional hooks, `action()` RPC endpoints, Action Scheduler `job()` queues, custom `route.ts` handlers, and file-based TSX pages all compile directly to PHP. - **Progressive interactivity:** Forms bound to server actions work without JavaScript, while `"use client"` components compile to WordPress Interactivity API stores with `useState` and live-updating `useLive()`. - **Ecosystem included:** Native WooCommerce store & optimistic cart hooks, React Email transactional templates, two-way Markdown & Git sync, modern SpacePress Admin (`/wp-admin/new/`), `@typedpress/blocks` for Gutenberg in TSX, `@typedpress/astro` for external frontends, and a built-in MCP server for AI coding agents. ## Built with SpacePress itself Everything you are reading on **spacepress.dev** is itself a real SpacePress application: - This blog post is synced from `www/content/posts/introducing-spacepress.md` via `wp.posts.extend()` and rendered through `tp/app/blog/[slug]/page.tsx` with WordPress's native `<Comments>` component. - The `/docs` section is synced from `www/content/docs/**/*.md` into a hierarchical `docs` collection rendered with `nav()`, `pager()`, and `headings()`. - The `/examples` directory lives in a custom SQL `table()` whose GitHub star counts refresh asynchronously on Action Scheduler via the `refreshStars` job. - Saved links in the `/play` browser playground are stored in the `shares` SQL table via the `share` server action, while the live compiler sandboxes across `/`, `/quick-start`, `/handbook`, and `/play` run our real Rust compiler compiled to WebAssembly (`compiler.wasm`). ## Try it now Head to the [Quick Start](/quick-start) to launch a local WordPress site in under three minutes, explore the [Interactive Handbook](/handbook) with live compiler sandboxes in every section, or jump straight into the [Playground](/play) right in your browser.