Skip to content

v0.3.0: In-place styling and universal observable updates

Choose a tag to compare

@jdrumgoole jdrumgoole released this 27 Jan 17:34
· 24 commits to main since this release

What's New

In-place Styling

All styling methods now modify objects in-place instead of returning copies. This aligns with the reactive/observable pattern where users work with a single object reference.

# Before (v0.2.0) - property-based, returned copies
styled = HTMLString("Hello").bold.red

# After (v0.3.0) - method-based, modifies in-place
HTMLString("Hello").bold().red()

Universal Observable Updates

All HTML types now trigger automatic Animate display updates when styled:

from animaid import Animate, HTMLString, HTMLInt

anim = Animate()
anim.run()

# Style changes now trigger automatic browser updates for ALL types
message = HTMLString("Hello")
anim.add(message)
message.bold()        # Browser updates automatically!
message.red()         # Browser updates automatically!

number = HTMLInt(42)
anim.add(number)
number.badge()        # Browser updates automatically!

Previously, only mutable types (HTMLList, HTMLDict, HTMLSet) supported reactive updates. Now HTMLString, HTMLInt, HTMLFloat, and HTMLTuple also notify Animate when their styles change.

API Changes

  • All styling properties (.bold, .pills, .card) are now methods (.bold(), .pills(), .card())
  • Methods modify the object in-place and return self for chaining
  • Backward compatibility: chaining still works as before

Other Improvements

  • 642 tests pass (10 new tests for observable immutable types)
  • Updated documentation with new method syntax examples
  • Updated screenshots