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.
- remove pydantic as base class of component by @adhami3310 in #5289
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()
.
- add length var operation for objects by @adhami3310 in #5318
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.
- allow rendering vars in foreach by @adhami3310 in #5271
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.
- add type checking for partially filled events by @adhami3310 in #5288
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.
- ignore certain file formats from granian hot reload by @adhami3310 in #5326
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()
.
- move tailwind to its own module by @adhami3310 in #5169
- make sure the progress count is correct with plugins by @adhami3310 in #5327
- add config to tailwind v4 plugin by @adhami3310 in #5331
Bugfixes
- do not add auto setters on reflex states by @adhami3310 in #5314
- do not broadcast event to all clients if modify state is misused by @adhami3310 in #5322
- send empty files list by @adhami3310 in #5323
- do not delete the .web dir when init-ing by @adhami3310 in #5319
- fix typeddict as annotation by @Lendemor in #5324
Chores
- bump deps 0713 by @adhami3310 in #5309
- crack down on sets for uniqueness by @adhami3310 in #5316
- Use patch to precommit by @adhami3310 in #5279
- update radix deps to 0713 by @adhami3310 in #5335
Full Changelog: v0.7.12...v0.7.13