Skip to content

Deno TUI 1.1.0

Compare
Choose a tag to compare
@Im-Beast Im-Beast released this 10 Sep 15:06
· 329 commits to main since this release
0febf68

Release 1.1.0

BREAKING CHANGES

  • TypedEventTarget and CombinedAsyncIterator has been removed
  • Tui now uses custom implementation of EventEmitter instead of AsyncIterator's and EventTarget
    • Tui.run() now starts application and returns nothing
      • Use Tui.on() to intercept events
    • Tui.render(), Tui.update() and Canvas.render() now return functions that allow to stop them
    • Tui no longer automatically exits after CTRL+C'ing
      • To return to previous behaviour call Tui.dispatch() after creating Tui
      • You can manually call Tui.remove() to stop Tui (doesn't exit deno app)
  • Tui's close has been renamed to dispatch
  • Component's now use stricter typings so Component without specifying literal type doesn't mean Any Component, use Component<EventRecord> instead.

Changelog

  • Added custom EventEmitter and Deffered implementation
  • Switching to custom EventEmitter indirectly caused many things to improve:
    • Changing size of the Tui caused by resizing terminal is now smooth as butter
    • Tui is now way more stable when it's time to unload it (in watch) and on closing
      • There were cases where it could still run in the background after closing, no longer the case
    • updateRate and refreshRate is now way more stable, CombinedAsyncIterator caused it to overshoot previously
      • frametimes are now way more consistent
  • Previously, some small (but existent) CPU spikes were happening, it's no longer the case
  • Component's can now intercept more events, specifically remove, keyPress, multiKeyPress and mousePress
  • Theoritically Tui should now be more memory efficient in the long run, Tui.remove() and Component.remove() "clean" more after themselfs

Tip

  • Take a look at changelog and/or demo diff to see how to adapt to these changes

Full Changelog: 1.0.3...1.1.0