Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions apps/website/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@
"dependencies": {
"@fontsource-variable/geist": "^5.2.9",
"@fontsource-variable/geist-mono": "^5.2.8",
"@ilha/router": "^0.8.7",
"@ilha/store": "^0.7.4",
"@ilha/router": "^0.8.8",
"@ilha/store": "^0.7.5",
"areia": "^0.1.36",
"dedent": "^1.7.2",
"ilha": "^0.9.3",
"ilha": "^0.9.4",
"imprensa": "^0.1.21",
"lucide": "^1.23.0",
"shiki": "^4.3.1",
Expand Down
11 changes: 11 additions & 0 deletions apps/website/src/pages/(content)/guide/island/render.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,17 @@ When `order` changes to `["c", "a", "b"]`, the existing `<li>` elements are move

Use `data-key` for plain rendered list items like this. For list items that are themselves child islands with their own local state, use [`Island.key()`](#child-islands) instead — it stabilizes the child island's slot identity rather than a plain element.

**Always key identity-sensitive elements.** An `<iframe>`, `<video>`, `<audio>`, `<canvas>`, `<embed>`, or `<object>` that gets caught in a positional replace loses state that can't be recreated — the iframe reloads its document, media restarts, canvas pixels vanish. Give such elements (or the list items containing them) a `data-key` so the morph preserves their identity; in development, ilha warns when a replace destroys one.

**Controller-owned attributes.** When outside code (a component controller, a third-party script) imperatively manages attributes on an element inside an island, list them in `data-morph-preserve` so re-renders don't overwrite or strip them — `class` can be listed too:

```html
<div
data-widget
data-morph-preserve="class data-open aria-expanded"
></div>
```

## Fragments

Use fragments when a render function needs to return siblings without an extra wrapper:
Expand Down
18 changes: 9 additions & 9 deletions bun.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/ilha/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ilha",
"version": "0.9.3",
"version": "0.9.4",
"description": "A tiny, framework-free island architecture library",
"keywords": [
"framework-free",
Expand Down
Loading
Loading