Skip to content

Version 0.7.2

Pre-release
Pre-release
Compare
Choose a tag to compare
@estherbrunner estherbrunner released this 22 Jul 08:09
· 136 commits to main since this release

What's Changed

  • v0.7.2 by @estherbrunner in #10
  • Cause & Effect now features a glitch-free derive() option with memoization for expensive work in computed signals or if the count of execution times matters
  • Even faster Cause & Effect
  • Added tests for async signals and error handling

Non-Core Features

  • New methods for auto-effects on ui() references:
    • ref.text(stateKey) to sync the textContent of an element while preserving HTML comments with a given string state
    • ref.prop(key, stateKey) to sync a property of the element with a given state
    • ref.attr(name, stateKey) to sync an attribute of the element with a given string state
    • ref.bool(name, stateKey) to sync a boolean attribute of the element with a given boolean state
    • ref.class(token, stateKey) to sync a class token on the element with a given boolean state
    • ref.style(prop, stateKey) to sync a style property of the element with a given string state
  • New methods for event binding / unbinding on ui() references:
    • ref.on(event, handler) to add an event listener
    • ref.off(event, handler) to remove an event listener
  • New asJSON() attribute parser
  • New debug-component.ts to parallel component.js with DebugElement instead of UIElement; debug-element.ts and debug-component.ts are available in TypeScript only in src/lib/, not as generated JavaScript

Breaking Changes since 0.7.1 to Non-Core Features

  • Renamed uiRef() to ui()
  • Renamed uiComponent() to component() and it is no longer the default export from component.js; instead UIElement is default export as in core library
  • Removed auto-effects using attributes; use ui(host).<first|all>(selector).<text|prop|attr|bool|class|style>(...args) in JavaScript instead
  • Removed highlightTargets() for now; you can implement your own target highlighting using el.targets(stateKey) and methods on ui(element) references.

Full Changelog: v0.7.1...v0.7.2