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