Skip to content

Dars Framework v1.4.9

Choose a tag to compare

@ZtaMDev ZtaMDev released this 27 Nov 02:56
· 62 commits to CrystalMain since this release

Release Notes v1.4.9

Event Handler Support & Dual State System Documentation

Installation

pip install --upgrade dars-framework

What's New

State V2: Event Handler Support

State V2 now supports updating event handlers:

from dars.all import *

# Update events in State V2
state.update(
    text="Click me",
    on_click=alert("Success!"),
    on_mouseover=log("mouseOver click me"))
)

# Works with dScript objects
button_state.update(on_click=log("Clicked!"))

Implementation:

  • Automatic detection of on_* properties
  • Extracts .code from dScript objects
  • Handles arrays of event handlers
  • Gracefully skips non-serializable values

Dual State System Documentation

Documentation now presents two coexisting state management systems:

State V2 (Dynamic)

  • Auto-increment/decrement built-in
  • Best for: counters, timers, simple updates

dState/cState (Indexed)

  • Full state machine support
  • Immutable state 0
  • Cross-state calls with Mod.call()
  • Best for: workflows, complex UI transitions

Comprehensive comparison table and use case guidance added to state management documentation.

Bug Fixes

  • Fixed: State V2 can now handle dScript event handlers without errors
  • Fixed: _generate_change_call() properly handles non-JSON-serializable values

Documentation

  • Complete restructure of State Management docs to include both systems
  • Restored all original dState/cState documentation