Fix 502: remove inline island calls from Examples section

Calling defisland components during SSR evaluates their bodies, which
reference client-only primitives (resource, def-store, etc.) that don't
exist in the OCaml SSR environment. Show only highlighted source code
instead — the islands still render via client hydration.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-03-31 10:23:53 +00:00
parent d9aa19cfe9
commit c55f6f9c4b

View File

@@ -236,13 +236,11 @@
(~docs/section (~docs/section
:title "Examples" :title "Examples"
:id "examples" :id "examples"
(p (p "Source for every demo island on this page.")
"Each example below shows a live island and its source. Every island hydrates from server-rendered HTML — the reactive behaviour activates on the client.")
(~docs/section (~docs/section
:title "Counter" :title "Counter"
:id "demo-counter" :id "demo-counter"
(p "Signals, computed, and " (code "swap!") " in a minimal example.") (p "Signals, computed, and " (code "swap!") ".")
(~reactive-islands/index/demo-counter :initial 0)
(~docs/code (~docs/code
:src (highlight :src (highlight
(component-source "~reactive-islands/index/demo-counter") (component-source "~reactive-islands/index/demo-counter")
@@ -254,7 +252,6 @@
"Two signals, each derived from the other via " "Two signals, each derived from the other via "
(code "effect") (code "effect")
".") ".")
(~reactive-islands/index/demo-temperature)
(~docs/code (~docs/code
:src (highlight :src (highlight
(component-source "~reactive-islands/index/demo-temperature") (component-source "~reactive-islands/index/demo-temperature")
@@ -263,7 +260,6 @@
:title "Imperative Handlers" :title "Imperative Handlers"
:id "demo-imperative" :id "demo-imperative"
(p "Multi-statement " (code "(do ...)") " bodies in event handlers.") (p "Multi-statement " (code "(do ...)") " bodies in event handlers.")
(~reactive-islands/index/demo-imperative)
(~docs/code (~docs/code
:src (highlight :src (highlight
(component-source "~reactive-islands/index/demo-imperative") (component-source "~reactive-islands/index/demo-imperative")
@@ -276,7 +272,6 @@
" and " " and "
(code "clear-interval") (code "clear-interval")
" with signal-driven UI.") " with signal-driven UI.")
(~reactive-islands/index/demo-stopwatch)
(~docs/code (~docs/code
:src (highlight :src (highlight
(component-source "~reactive-islands/index/demo-stopwatch") (component-source "~reactive-islands/index/demo-stopwatch")
@@ -284,8 +279,7 @@
(~docs/section (~docs/section
:title "Reactive List" :title "Reactive List"
:id "demo-reactive-list" :id "demo-reactive-list"
(p "Dynamic list with keyed reconciliation — add and remove items.") (p "Dynamic list with keyed reconciliation.")
(~reactive-islands/index/demo-reactive-list)
(~docs/code (~docs/code
:src (highlight :src (highlight
(component-source "~reactive-islands/index/demo-reactive-list") (component-source "~reactive-islands/index/demo-reactive-list")
@@ -294,7 +288,6 @@
:title "Input Binding" :title "Input Binding"
:id "demo-input-binding" :id "demo-input-binding"
(p "Two-way binding via " (code ":bind") " attribute.") (p "Two-way binding via " (code ":bind") " attribute.")
(~reactive-islands/index/demo-input-binding)
(~docs/code (~docs/code
:src (highlight :src (highlight
(component-source "~reactive-islands/index/demo-input-binding") (component-source "~reactive-islands/index/demo-input-binding")
@@ -306,7 +299,6 @@
"Reactive class toggling with " "Reactive class toggling with "
(code "deref") (code "deref")
" in attribute expressions.") " in attribute expressions.")
(~reactive-islands/index/demo-dynamic-class)
(~docs/code (~docs/code
:src (highlight :src (highlight
(component-source "~reactive-islands/index/demo-dynamic-class") (component-source "~reactive-islands/index/demo-dynamic-class")
@@ -315,7 +307,6 @@
:title "Portal" :title "Portal"
:id "demo-portal" :id "demo-portal"
(p "Render content outside the island's DOM subtree.") (p "Render content outside the island's DOM subtree.")
(~reactive-islands/index/demo-portal)
(~docs/code (~docs/code
:src (highlight :src (highlight
(component-source "~reactive-islands/index/demo-portal") (component-source "~reactive-islands/index/demo-portal")
@@ -324,7 +315,6 @@
:title "Error Boundary" :title "Error Boundary"
:id "demo-error-boundary" :id "demo-error-boundary"
(p "Catch rendering errors without crashing the page.") (p "Catch rendering errors without crashing the page.")
(~reactive-islands/index/demo-error-boundary)
(~docs/code (~docs/code
:src (highlight :src (highlight
(component-source "~reactive-islands/index/demo-error-boundary") (component-source "~reactive-islands/index/demo-error-boundary")
@@ -333,7 +323,6 @@
:title "DOM Refs" :title "DOM Refs"
:id "demo-refs" :id "demo-refs"
(p "Access raw DOM elements via " (code ":ref") " signal.") (p "Access raw DOM elements via " (code ":ref") " signal.")
(~reactive-islands/index/demo-refs)
(~docs/code (~docs/code
:src (highlight :src (highlight
(component-source "~reactive-islands/index/demo-refs") (component-source "~reactive-islands/index/demo-refs")
@@ -345,7 +334,6 @@
"Async data fetching with " "Async data fetching with "
(code "promise-then") (code "promise-then")
" and loading state.") " and loading state.")
(~reactive-islands/index/demo-resource)
(~docs/code (~docs/code
:src (highlight :src (highlight
(component-source "~reactive-islands/index/demo-resource") (component-source "~reactive-islands/index/demo-resource")
@@ -359,7 +347,6 @@
" and " " and "
(code "batch") (code "batch")
".") ".")
(~reactive-islands/index/demo-transition)
(~docs/code (~docs/code
:src (highlight :src (highlight
(component-source "~reactive-islands/index/demo-transition") (component-source "~reactive-islands/index/demo-transition")
@@ -372,13 +359,11 @@
(code "def-store") (code "def-store")
" / " " / "
(code "use-store") (code "use-store")
". Change the colour in the writer — the reader updates.") ".")
(~reactive-islands/index/demo-store-writer)
(~docs/code (~docs/code
:src (highlight :src (highlight
(component-source "~reactive-islands/index/demo-store-writer") (component-source "~reactive-islands/index/demo-store-writer")
"lisp")) "lisp"))
(~reactive-islands/index/demo-store-reader)
(~docs/code (~docs/code
:src (highlight :src (highlight
(component-source "~reactive-islands/index/demo-store-reader") (component-source "~reactive-islands/index/demo-store-reader")
@@ -390,7 +375,6 @@
"Server-rendered content communicating with an island via " "Server-rendered content communicating with an island via "
(code "bridge-event") (code "bridge-event")
".") ".")
(~reactive-islands/index/demo-event-bridge)
(~docs/code (~docs/code
:src (highlight :src (highlight
(component-source "~reactive-islands/index/demo-event-bridge") (component-source "~reactive-islands/index/demo-event-bridge")