Concrete
Rulesislands

concrete/islands/editor-declaration

Every island exports a literal `editor = { live }`, and a literal `serverFrame` when it declares one.

Every island exports a literal editor = { live }, and a literal serverFrame when it declares one.

Graded by the lint stage of concrete check, in the lint venue. A violation reports this id and the file it failed at — see every rule and concrete check.

Reason

Hydration in the editor canvas is per-island opt-in, and an omitted declaration once meant "not live" silently — which made a decision and an oversight identical from the outside. An island states it either way: live: true hydrates it in the canvas behind the selection gate, live: false leaves it as the static server-rendered HTML there. The canvas reads the declaration once, when the module loads, so it has to be a literal a reader can see.

Fix

Add export const editor = { live: true }; or { live: false }; to the island module, written literally. If the island also declares serverFrame, declare it in the same module as export const serverFrame = <literal>; — and note that serverFrame: false requires live: true, or the canvas shows a hole nobody can select.

Before and after

"use client";

import { useState } from "react";

// No `editor` declaration: live in the canvas, or not?
export default function Carousel({ slides }: { slides: number }) {
  const [at, setAt] = useState(0);
  return <button onClick={() => setAt((at + 1) % slides)}>{at}</button>;
}
"use client";

import type { IslandEditor } from "@homepages/concrete";
import { useState } from "react";

export const editor = { live: true } satisfies IslandEditor;

export default function Carousel({ slides }: { slides: number }) {
  const [at, setAt] = useState(0);
  return <button onClick={() => setAt((at + 1) % slides)}>{at}</button>;
}

On this page