Skip to content

v0.6.3

Compare
Choose a tag to compare
@masenf masenf released this 18 Oct 16:23
· 2 commits to release/reflex-0.6.3 since this release
addf633

New Features

Correct handling of aria and data props

Any props passed to a component with aria_ or data_ prefix will be applied directly to the component (previously, these were misinterpreted as style props).

Reflex Code

rx.icon_button("save", aria_label="Save Changes", data_test="arbitrary data")

Generated Output

<button ... aria-label="Save Changes" data-test="arbitrary data"><svg>...</svg></button>

Improvements

Static typing of events and vars

New (optional) rx.Field, rx.field and @rx.event decorators allow pyright and other static type checkers to better understand how event handlers and state vars are handled in reflex, allowing most static type checking to pass without # type: ignore comments.

import reflex as rx


class MyState(rx.State):
    v: rx.Field[int] = rx.field(42)

    @rx.event
    def set_v(self, v: str):
        try:
            self.v = int(v)
        except ValueError:
            pass


def index() -> rx.Component:
    return rx.vstack(
        rx.heading(MyState.v),
        rx.input(
            value=MyState.v,
            on_change=MyState.set_v,
            type="number",
        ),
    )


app = rx.App()
app.add_page(index)
  • [ENG-3749] type safe vars by @adhami3310 in #4066
  • add type hinting to events by @adhami3310 in #4145
    • Fix runtime error on python 3.11.0 (#4197)
    • fix pyi for untyped event handlers (#4186)
    • Arbitrary arg access two levels deep for untyped handler (#4180)

Other Improvements

  • Optimize StateManagerDisk by @masenf in #4056
  • Reduce pickle size by @masenf in #4063
  • fail safely when pickling by @adhami3310 in #4085
  • First use environment variable as npm registry by @ruhz3 in #4082
  • let users pick state manager mode by @Lendemor in #4041
    • disk is memory is disk (#4185)
    • When REDIS_URL is set, use redis, regardless of config preference. (#4196)
  • Allow setting a different invocation function for EventChain by @masenf in #4160

Bug Fixes

Version Bumps

Documentation

Other Changes

New Contributors

Full Changelog: v0.6.2...v0.6.3