🔑 ForEach, now with id: 🔑
ForEach can now be keyed by any Hashable id, or use Identifiable elements directly.
struct Todo: Identifiable {
let id: UUID
var title: String
}
ForEach(todos) { todo in
li { todo.title }
}
ForEach(names, id: { $0 }) { name in
li { name }
}⚠️ When upgrading:
key:and.key()are deprecated in favor ofid:and.id()ForEachnow requires aRandomAccessCollection, and is no longerSendable- The minimum macOS version is now 26
🖥️ Server rendering 🖥️
ElementaryUI views now have basic support for SSR/SSG: they can be rendered to HTML using .render().
⚡ Performance ⚡
List updates, reactive state changes and attribute patching are all faster, with fewer allocations.
What's Changed
- basic support for SSR/SSG rendering of ElementaryUI views by @sliemeobn in #145
- persistent reactive listeners by @sliemeobn in #146
- allocation-free listener callback for schedulable nodes by @sliemeobn in #148
- cheaper listener fan-in and inline tracked dependencies by @sliemeobn in #147
- keyed ForEach with id: and per-row tracking by @sliemeobn in #149
- cheaper ForEach row tracking and updates by @sliemeobn in #150
- upgrade JavaScriptKit to 0.62 by @sliemeobn in #151
Full Changelog: 0.8.1...0.9.0