Skip to content

Crank 0.7.0

Latest

Choose a tag to compare

@brainkim brainkim released this 14 Aug 20:05
· 93 commits to main since this release

Crank 0.7.0

A major release featuring a redesigned async architecture and several new capabilities.

New Features

  • refresh() callbacks - Pass a callback to refresh() to update state: this.refresh(() => count++)
  • Async system overhaul - Two-pass rendering architecture eliminates tearing and enables parallel hydration
  • Racing component state preservation - Components that win races keep their DOM and state intact
  • @b9g/crank/async module - New public module with <lazy>, <Suspense>, and <SuspenseList> components
  • Async unmounting - Components can perform exit animations via async cleanup() callbacks
  • Enhanced copy/hydrate props - String syntax for fine-grained control: copy="\!value", hydrate="class id"
  • Class object syntax - Use objects for class names: class={{active: true, disabled: false}}
  • New <Text> element - Explicit text node creation and improved text rendering
  • Cooperative DOM rendering - Preserves third-party DOM nodes, safe to render to document.body

Breaking Changes

  • flush() renamed to after() (with deprecation warnings for backward compatibility)
  • Async generator components in for await...of loops always return promises
  • Async generators without props loops now behave like sync generators

Bug Fixes

  • Improved error handling for async generator components
  • Better handling of unhandled promise rejections

Full changelog: https://github.com/bikeshaving/crank/blob/main/CHANGELOG.md#070---2025-08-14

Install: npm install @b9g/[email protected]