Skip to content

Version 0.16.0

Pre-release
Pre-release

Choose a tag to compare

@estherbrunner estherbrunner released this 01 Dec 15:24
· 289 commits to main since this release
cb64fbb

What's Changed

Breaking Changes

  • Renamed functions to more clearly express what they do and make naming conflicts with local variables less likely:
    • computed() -> createComputed()
    • effect() -> createEffect()
    • state() -> createState()
    • store() -> createStore()
    • watch() -> createWatcher() and watcher.off() -> watcher.unwatch()
  • Changed store events from CustomEvent to light-weight change notifications:
    • store.addEventListener('store-*', handler) -> store.on('*', handler)
    • store.removeEventListener('store-*', handler) -> cleanup function returned from .on() handler
    • Change notification callbacks receive the former details as the only parameter, no more event involved
  • Changed parameters of createComputed() to allow for reducer-like capabilities:
    • Computed callback now receives old value as first parameter, pushing AbortSignal for async callback to second parameter
    • Optional second parameter for initial value

New Features

  • Add reducer-like capabilities to createComputed for accumulative computed signals
  • Basic input validation with more descriptive error messages for all signal types and effects

Tests

  • Updated test cases to reflect API changes
  • Tests covering accumulative computed signals, more edge cases and input validation

Documentation

  • Updated README to document accumulative computed signals and reflect API changes
  • New AI-targeted documentation files:
    • .ai-context.md
    • .cursorrules
    • CLAUDE.md
    • .github/copilot-instructions.md

Full Changelog: v0.15.2...v0.16.0