github reflex-dev/reflex v0.7.13

latest releases: v0.8.9, v0.8.8, v0.8.7...
3 months ago

Release Notes

Remove Pydantic as a base class of Component

rx.Component used to inherit from BaseModel, but that's no longer the case. We opted to write our own Metaclass to handle the specific needs of Components better.

This has great improvements for hot reload time for small apps as Pydantic spent around 75% of import time just deep copying fields. On my own machine, a hot reload of a simple app went down from ~1.2sec to just around 200ms!

While this is not intended to be a breaking change, it's likely that a very introspective code could behave differently with this one. So please test it and report to us so we can preserve behavior as best as possible.

length() for dicts

If you are using object vars (State fields of type dict or Base/dataclasses), you can now call .length() on them. This is a simple wrapper over .keys().length().

Allow Vars to be the result of the render function of Foreach

This relaxes the requirement from being a component. Vars are wrapped in a Fragment.

Prefix Config Vars with REFLEX_

The environment variables defined in Config will now be read with REFLEX_ as a prefix. Previous not prefixed names are still names but are deprecated.

Stronger type checking against partially filled variables

If you were unlucky enough, you might have written some code where you capture some arguments but reflex decides that it wants to give your event handler even more arguments. In these cases, we weren't checking the types of such arguments against the event callback. This now triggers a compilation error.

Ignore certain file formats from hot reload

Granian was reloading on more file formats than necessary, so we manually exclude a set of file formats that are unlikely to be a cause of hot reload. If you still notice weird hot reloads on file changes that are irrelevant to your application, we can append that list with more values.

Tailwind V3 is now contained in a module (and rudimentary Reflex Plugin System)

We now have a basic plugins system with a few hooks. It's not very documented, but you can basically provide a list of plugins to the plugins argument in rx.Config. You can add compile time hooks to create files, modify files, define stylesheets, define javascript dependencies, and more.

We moved our tailwind v3 code to use such plugin system. You should either set tailwind=None inside of your rx.Config or set plugins to [rx.plugins.TailwindV3Plugin()]. Automatic assumption of tailwind is deprecated.

We're also starting our work on Tailwind V4. You can try it by setting plugnis to rx.plugins.TailwindV4Plugin().

Bugfixes

Chores

Full Changelog: v0.7.12...v0.7.13

Don't miss a new reflex release

NewReleases is sending notifications on new releases.