---
title: "Upgrading From LemonadeJS v5 to v6"
description: "The complete v5 to v6 migration map: every old pattern and its new home."
source: https://lemonadejs.com/docs/upgrades/
---

# Upgrading from v5 to v6

Upgrading from v5 means a new engine: native tagged templates
(minifier-proof), fine-grained
signals, contracts, and complete destroy semantics. The shape stays
recognizably lemonade (a function, states, one template), and every v5
pattern has a precise new home. Previous versions remain documented under
[/docs/v5](/docs/v5/).

## The map

| v5 | v6 |
|---|---|
| `return render => render`…`` | `return html`…`` (tag renamed, no wrapper) |
| `lemonade.render(Comp, root)` | `mount(Comp, root)` |
| `this.prop` / `{{self.prop}}` | `const prop = state(…)` + `${prop}` |
| `onload(fn)` / `:ready` | `onMount(fn)` (return a cleanup) / `ref="${fn}"` |
| `self.onchange(prop, o, n)` | `state(v, (val, old) => …)` per state |
| `:loop="self.rows"` | `${() => rows.value.map(r => html`…`)}` |
| `:render="${cond}"` | `${() => cond.value && html`…`}` |
| `:bind="self.name"` | `bind="${name}"` (elements) / `bind()` tool (components) |
| `lemonade.set/get/dispatch` (Sugar) | `store()` + actions, or [`expose`/`use()`](/docs/sugar/) |
| `lemonade.set(k, fn, true)` persistence | `store(initial, 'storage-key')` |
| `setComponents({ Card })` + `<Card/>` | same, or embed by value: `<${Card} />` |
| `lm-path` / `setPath` forms | [`form()`](/docs/forms/) with `$get`/`$set` |
| HTML strings in slots | escaped by default; `unsafe(html)` for trusted markup |
| `self.refresh('prop')` / `refresh()` | `state.touch()` after in-place mutation |
| `createWebComponent(name, fn)` | same, or contract-driven: `createWebComponent(Comp)` |
| per-plugin `react.js` wrappers | one generic [`adaptReact(Comp)`](/docs/react/) |

## What was removed on purpose

The mutable `this`/self bag, `{{…}}` token expressions, inline-string event
handlers and the `Function()` evaluator (CSP), attribute auto-casting, and the
`view.toString()` template recovery. Each removal closes a class of silent
failures; the [contracts layer](/docs/contracts/) restores typed coercion and
interface introspection on declared terms.

## What is new with no v5 equivalent

[Contracts](/docs/contracts/) (`component`, `contract`, `verify`),
[`touch()`/`batch()`](/docs/state/) for big-data mutation,
`subscribe()`/`peek()` interop, the [test harness](/docs/tests/), stable
[error codes](/docs/errors/), and dev/production builds with build-time
dead-code elimination.