Skip to content

v0.4.3

Compare
Choose a tag to compare
@masenf masenf released this 04 Mar 22:52
c314d7f

New Features

Set initial_value for rx.var and rx.cached_var

Provide a placeholder to avoid evaluating computed vars during compile time, for example, if they would perform database queries or other expensive operations.

class MyState(rx.State):
    @rx.var(initial_value=42)
    def answer(self):
        with rx.session() as session:
            session.exec(...)

State.get_state allows access to arbitrary substates from within an event handler

class MyState(rx.State):
    answer: int = 42

class OtherState(rx.State):
    async def get_answer(self):
        my_state = await self.get_state(MyState)
        print(f"The answer is {my_state}.answer")

Note that get_state is an async function and must be await'ed

  • [REF-1988] API to Get instance of Arbitrary State class by @masenf in #2678

CLI for Creating and Publishing 3rd Party Components

Improvements

Allow accent as a valid choice in rx.color

Chakra no longer used when rendering Markdown

Sidebar template uses all Radix components

Disallow invalid /api prefix for frontend page routes

These routes conflict with what NextJS considers special "API routes" and thus do not work for reflex pages.

  • [REF-1741] Disallow routes with /api prefix by @masenf in #2711

rx.plotly now accepts arbitrary config prop

Computed Backend-only Vars

Connection Pulser While Websocket is Disconnected

Only show the "Connection Error" banner after a few failed reconnection attempts.

  • add pulser for connection + adjust condition for connnection_modal by @Lendemor in #2676

Reconnect Websocket in Stale Tabs

When a browser tab regains focus, automatically reconnect the websocket if it is disconnected.

Bug Fixes

Other Changes

New Contributors

Full Changelog: v0.4.2...v0.4.3