Skip to content

Releases: reflex-dev/reflex

v0.8.26

20 Jan 22:54

Choose a tag to compare

Release Notes

Upgrade react-markdown to 10.1.0

Behavior Change: functions in component_map will now be passed either a bare string or a list of strings mixed with react element objects. This should only be noticeable if your component map function is attempting to manipulate the children in some way, which is not recommended. For best results, pass all args received by the component function directly to the primary rendered component.

Bugfixes

  • ENG-8664: MutableProxy.wrap_recursive fully rebinds existing proxy values by @masenf in #6083

Chores

Full Changelog: v0.8.25...v0.8.26

v0.8.25

12 Jan 22:28

Choose a tag to compare

Release Notes

Setting "sitemap" to None disables sitemap generation for the page

app.add_page(index, context={"sitemap": None})

Bugfixes

  • Split REFLEX_CORS_ALLOWED_ORIGINS by comma by @masenf in #6067
  • remove --theme from __reflex_style_reset.css by @masenf in #6076

Improvements

Chores

Full Changelog: v0.8.24...v0.8.25

v0.8.24

22 Dec 20:27

Choose a tag to compare

Release Notes

Dataeditor Improvements

Typing

Performance Improvements

Bugfixes

  • Skip non-BaseState classes for dep tracking by @masenf in #6052
  • ENG-8507: rebind MutableProxy when it is linked to an old _self_state reference by @masenf in #6048
  • ENG-8540: avoid dataclasses.asdict in Lost+Found path by @masenf in #6057
  • DependencyTracker: only handle STORE_FAST for the GETTING_IMPORT status by @masenf in #6058

Chores

Full Changelog: v0.8.23...v0.8.24

v0.8.23

15 Dec 23:25

Choose a tag to compare

Release Notes

Shared/Linked State

You can use rx.SharedState to define state that is shared among multiple frontends.

import reflex as rx


class MySharedThing(rx.SharedState):
    my_counter: int = 0

    @rx.event
    async def toggle_link(self):
        if not self._linked_to:
            await self._link_to(await self.get_var_value(State.shared_token))
        else:
            return await self._unlink()

    @rx.event
    def increment(self):
        self.my_counter += 1

    @rx.event
    def decrement(self):
        self.my_counter -= 1

    @rx.var
    def linked_to(self) -> str:
        return self._linked_to or "not linked"

    @rx.var
    def linked_from(self) -> str:
        return ", ".join(self._linked_from) or "no links"

    @rx.event(background=True)
    async def delayed_multi_increment(self, amount: int):
        import asyncio

        for _ in range(amount):
            await asyncio.sleep(1)
            async with self:
                self.my_counter += 1


class State(rx.State):
    @rx.var
    def shared_token(self) -> str:
        return (self.room or "shared_global").replace("_", "-")

    @rx.var
    async def current_count(self) -> int:
        shared_state = await self.get_state(MySharedThing)
        return shared_state.my_counter

    @rx.event
    async def print_current_count(self):
        shared_state = await self.get_state(MySharedThing)
        print(f"Current count is: {shared_state.my_counter}")


def index() -> rx.Component:
    return rx.container(
        rx.color_mode.button(position="top-right"),
        rx.vstack(
            rx.text(f"Shared token: {State.shared_token}"),
            rx.button(f"Linked To: {MySharedThing.linked_to}", on_click=MySharedThing.toggle_link),
            rx.text(f"Linked From: {MySharedThing.linked_from}"),
            rx.heading(State.current_count),
            rx.button(
                "Increment",
                on_click=MySharedThing.increment,
            ),
            rx.button(
                "Increment 5 times with 1s delay",
                on_click=MySharedThing.delayed_multi_increment(5),
            ),
            rx.button(
                "Decrement",
                on_click=MySharedThing.decrement,
            ),
            rx.button(
                "Print Current Count to Console",
                on_click=State.print_current_count,
            ),
        ),
    )


app = rx.App()
app.add_page(index, route="/[room]")
app.add_page(index)
  • ENG-8258: API for linking and sharing states by @masenf in #6024

Add ALEMBIC_INCLUDE_SCHEMAS=1/0 to control include_schema migrations

Bugfixes

Error Improvements

Chores

New Contributors

Full Changelog: v0.8.22...v0.8.23

v0.8.22

09 Dec 21:13

Choose a tag to compare

Release Notes

Bugfixes

Improvements

Chores

New Contributors

Full Changelog: v0.8.21...v0.8.22

v0.8.21

24 Nov 21:04
cb262b6

Choose a tag to compare

Release Notes

Bugfixes

  • Don't wrap return values of MutableProxy methods by @masenf in #5986
  • ENG-8388: refetch cached state when missing substates by @masenf in #5991

UI

Chores

Full Changelog: v0.8.20...v0.8.21

v0.8.20

17 Nov 19:50
4ee713f

Choose a tag to compare

Release Notes

Reconnection Logic Improvements

  • Send a "reconnect" hydrate whenever the socket reconnects by @masenf in #5969
  • Make oplock_hold_time_ms configurable by @masenf in #5975
  • Do a full re-hydrate on reconnect by @masenf in #5980
  • Revive token socket_record after expiration by @masenf in #5977

Bugfixes

  • check against hooks inside of root component by @adhami3310 in #5971
  • MutableProxy: wrap dataclass and BaseModel methods by @masenf in #5979

Misc

Chores

Full Changelog: v0.8.19...v0.8.20

v0.8.19

10 Nov 20:02

Choose a tag to compare

Release Notes

Reusing of state locks in redis to reduce serializing/de-serializing overhead

Set REFLEX_OPLOCK_ENABLED=1 in the environment to use this mode -- will become the default after further testing.

Add mime_type to rx.download

Add transport="polling" for enterprise

Misc

Bugfixes

  • ENG-8227: always _clean() after app.modify_state by @masenf in #5949
  • ENG-8049: pass correct parameters to queueEvents by @masenf in #5962

Chores

Full Changelog: v0.8.18...v0.8.19

v0.8.18

03 Nov 23:32

Choose a tag to compare

Release Notes

Improve re-connection logic when running multiple workers

  • ENG-8089: Implement Lost+Found with RedisTokenManager by @masenf in #5927

Override async with self to just return self in non background events

Bugfixes

Chores

Full Changelog: v0.8.17...v0.8.18

v0.8.17

27 Oct 17:49

Choose a tag to compare

Release Notes

Pass event name for lock expiry messages

Expose Sourcemap generation via VITE_SOURCEMAP, and rolldown experimental HMR via VITE_EXPERIMENTAL_HMR

Misc

Bugfixes

  • ENG-8034: fix window events inside of memoization leaf by @adhami3310 in #5899
  • fix: properly initialize rx.Field annotated backend vars in mixin states by @benedikt-bartscher in #5909
  • ENG-8113: handle_frontend_exception triggers auto reload by @masenf in #5922
  • ENG-8050: background event updates set final=None by @masenf in #5898

Chores

New Contributors

Full Changelog: v0.8.16...v0.8.17