Skip to content

Upgrade from 0.13 to 0.14

Zrzka edited this page Nov 15, 2019 · 19 revisions

Feature Flags

  • Removed cursor, style, terminal and screen feature flags
    • All the functionality is included by default and there's no way how to disable it
  • Removed input feature flag
    • Replaced with the event feature flag, more on this below
  • New feature flag event
    • Enables event module and allows you to handle events like key input, mouse input and terminal resize
  • New feature flag async-event
    • Auto enables event feature and provides EventStream (futures::Stream) on top of the event module

Motivation

We believe that there are two main use cases:

  • you want to style your output only (default features) or
  • you want to style your output and handle events (event feature).

Default features includes all the styling functions and it simplifies the crate usage for you (no need to specify features). Separate event feature allows you to add support for event handling. It's provided as a separate feature because it brings additional dependencies like bitflags, parking_lot and mio. If you do not want to use event handling, there's no reason to fetch & compile them for you.

But why the async-event feature? Not everyone wants to use async stuff and it also brings additional features crate dependency. Basically same reasons as for the event feature.

Modules

Module input

This whole module was removed. To be more precise, replace with the brand new event module.

Module event

TODO

  • Change of Event enums to Structs
  • Support for modifiers, bitwise, bitflag
  • Supported for more events
  • Rename of certain events
  • poll/read api
  • Async Support
  • links to places for help, examples, discord.