Releases: reflex-dev/reflex
v0.8.22
Release Notes
Bugfixes
- RedisStateManager.get_state: return the correct state class by @masenf in #6001
- fix test lifespan on prod by @adhami3310 in #6027
Improvements
- feat: list valid triggers in error message for invalid event triggers by @veerababu1729 in #6015
- fixed types annotations for meta in add_page() to accept components by @dennisbakhuis in #6012
- optimize frozen dict get item by @adhami3310 in #6021
Chores
- 0822dev by @adhami3310 in #6005
- prettier 3.7.x update by @masenf in #6017
- upgrade deps again for 0822 by @adhami3310 in #6022
- update export checkpoints to new vite by @adhami3310 in #6026
New Contributors
- @veerababu1729 made their first contribution in #6015
- @dennisbakhuis made their first contribution in #6012
Full Changelog: v0.8.21...v0.8.22
v0.8.21
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
- wrap error text by @adhami3310 in #5992
Chores
- 0821dev by @adhami3310 in #5993
Full Changelog: v0.8.20...v0.8.21
v0.8.20
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
- disable highlighter rich by @adhami3310 in #5972
- Allow
transport="polling"option for all users by @masenf in #5982
Chores
- 0820dev by @adhami3310 in #5967
- Flaky test test_ensure_task_limit_window_passed by @masenf in #5959
- Trying to fix codeql analysis by @masenf in #5981
Full Changelog: v0.8.19...v0.8.20
v0.8.19
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 mime_type to download by @adhami3310 in #5957
Add transport="polling" for enterprise
- add polling transport option by @adhami3310 in #5955
Misc
- add more rules for dialog parents and children by @adhami3310 in #5945
- cache path cwd by @adhami3310 in #5948
- check against classvar for fast case by @adhami3310 in #5947
- optimize _expired_computed_vars to one use of getattribute by @adhami3310 in #5946
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
- 0819dev by @adhami3310 in #5944
Full Changelog: v0.8.18...v0.8.19
v0.8.18
Release Notes
Improve re-connection logic when running multiple workers
Override async with self to just return self in non background events
- allow state mutation with contextmanager from normal (non-background) events by @benedikt-bartscher in #5938
Bugfixes
- fix problems with does_obj_satisfy_typed_dict by @adhami3310 in #5936
Chores
- 0818dev by @adhami3310 in #5933
Full Changelog: v0.8.17...v0.8.18
v0.8.17
Release Notes
Pass event name for lock expiry messages
- add context for lock expiry by @adhami3310 in #5918
Expose Sourcemap generation via VITE_SOURCEMAP, and rolldown experimental HMR via VITE_EXPERIMENTAL_HMR
- expose exp hmr and sourcemap by @adhami3310 in #5906
Misc
- make error boundary look nicer by @adhami3310 in #5926
- more auto_reload_on_error patterns by @masenf in #5925
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=Noneby @masenf in #5898
Chores
- Add virtual environment setup instructions to README by @ChloeAnn08 in #5913
- 0817dev by @adhami3310 in #5916
- avoid racey flakes in test_client_storage by @masenf in #5920
New Contributors
- @ChloeAnn08 made their first contribution in #5913
Full Changelog: v0.8.16...v0.8.17
v0.8.16
Release Notes
StateManagerDisk with throttled write
To improve performance on IO-bound devices, disk manager only commits its memory every two seconds or so. Configurable through the environment variable: REFLEX_STATE_MANAGER_DISK_DEBOUNCE_SECONDS
Dialog Trigger must be child of Dialog Root
In technicality, dialog trigger can be anywhere in the nested children of a dialog root. However, this is a useful proxy for now.
- dialog trigger must have dialog root as its parent by @adhami3310 in #5896
Chores
- Change vulnerability reporting email to GitHub link by @adhami3310 in #5890
- 0816dev by @adhami3310 in #5891
- bump codspeed action to v4 by @adhami3310 in #5892
Full Changelog: v0.8.15...v0.8.16
v0.8.15
Release Notes
Deprecations
rx.Base is deprecated.
Now that pydantic is an optional dependency, Reflex will no longer maintain a custom wrapper over BaseModel. You have a few options for replacing your rx.Base subclasses:
- Continue to use
pydantic-- minimal code/behavior changes- Ensure
pydanticis part of your app dependency list - Extend from
pydantic.BaseModelinstead ofrx.Base
- Ensure
- Move to
dataclasses.dataclass-- use the python stdlib - Move to
typing.TypedDict-- uses a plaindict, but has extra type hints to make Var Operations work correctly
sqlmodel.SQLModel is now recommended over rx.Model.
- Change your db models to inherit from
sqlmodel.SQLModelinstead ofrx.Model. - Ensure the model has an explicit primary_key column. The default previously used to be:
id: int | None = sqlmodel.Field(default=None, primary_key=True)
- Use
sqlmodel.select(MyModel)instead ofMyModel.select().
Python 3.14 is now supported! Python 3.10 deprecated D:
Python 3.14 got release on 10/07 and now Reflex supports it! It gives us very considerable performance improvements just by bumping.
In theory, you can use reflex with python free threaded, although we don't officially support it just yet. If you do run into issues with it, do report it!
- python3.14 compat by @masenf in #5859
- deprecate python 3.10 by @adhami3310 in #5868
Make pydantic, sqlmodel, and alembic optional
We will still install them by default until 0.9. You can ease into the transition by setting your reflex dependency to reflex[db]. You can uninstall them and reflex will continue to work assuming you don't use those in your app.
- move pydantic, sqlmodel, alembic to optional dependencies by @adhami3310 in #5438
- only deprecate base at subclass by @adhami3310 in #5863
- output what class is subclassing rx.Base by @adhami3310 in #5864
Upcast enum values to their enum type on event handlers
Performance Improvements
- optimize various var functions by @adhami3310 in #5865
Bugfixes
- make on load lambda work by @adhami3310 in #5856
- Apply attribute access rules for Model or SQLModel by @masenf in #5875
- Munge router_data["pathname"] consistently in event processing path by @masenf in #5873
- ENG-7948: Fix hanging frontend and other reconnection woes by @masenf in #5884
- check domain before redirecting in codespaces by @adhami3310 in #5886
Chores
- 0815dev by @adhami3310 in #5853
- make _no_chain_background_task take state instance by @adhami3310 in #5857
- split manager by @adhami3310 in #5852
- Bring back accidentally removed pool params by @masenf in #5861
- ENG-7927: make builder first option in reflex init cli by @adhami3310 in #5862
- Use pytest-rerunfailures to avoid tmp_path stashkey issues by @masenf in #5869
- rolldown vite 7.1.16 by @adhami3310 in #5858
Full Changelog: v0.8.14...v0.8.15
v0.8.14
Release Notes
Revert ColorVar having .color .alpha .shade
ColorVar being a non primitive string (new String) has proven more problematic than it is useful.
- call to_string on colors coming into style by @adhami3310 in #5836
- revert color handling by @adhami3310 in #5844
Add --single-port option to reflex run --env prod
Since the app is compiled, there is no need for using a node server to run the frontend and have two ports. You can simply use reflex run --env prod --single-port to host the frontend and backend on the same port.
It's still recommended to serve your frontend on a CDN if possible. Although if you're going for really simple deployments, one port will suffice!
- single port prod by @adhami3310 in #5839
Treat on_drop=State.handle_upload, as on_drop=State.handle_upload(rx.upload_files(upload_id))
the following:
rx.upload(
id="upload",
on_drop =State.on_upload,
)would be converted to
rx.upload(
id="upload",
on_drop =State.on_upload(rx.upload_files("upload")),
)- improve upload state handlers ergonomics by @adhami3310 in #5843
Add primitive radix dialog
It's unstyled, but it makes it easier to use with tailwind and such if you aren't interested in radix themes.
def dialog():
return rx.radix.primitives.dialog.root(
rx.radix.primitives.dialog.trigger(...),
rx.radix.primitives.dialog.portal(
rx.radix.primitives.dialog.overlay(...),
rx.radix.primitives.dialog.content(
rx.radix.primitives.dialog.title(...),
rx.radix.primitives.dialog.description(...),
...,
rx.radix.primitives.dialog.close(...)
)
)
)The interface looks almost identical to rx.dialog.
- Add primitive radix dialog by @adhami3310 in #5848
Bugfixes
- replace click exit with system exit by @adhami3310 in #5841
- correctly handle backend rx.Field default values by @adhami3310 in #5833
- update slider event spec by @adhami3310 in #5828
- remove toaster outside of radix by @adhami3310 in #5827
- check return code before parsing version by @adhami3310 in #5845
- make indexing more null friendly by @adhami3310 in #5849
- handle upload id being a var in as event spec by @adhami3310 in #5850
Chores
- Remove raciness from test_is_process_on_port_concurrent_access by @masenf in #5826
- 0814dev by @adhami3310 in #5834
- suppress eval warnings by @adhami3310 in #5847
Full Changelog: v0.8.13...v0.8.14
v0.8.13
Release Notes
Rework ColorVar to support its subfields
class State(rx.State):
theme: rx.Color = rx.color("red", 2)
# All of those are valid:
State.theme
State.theme.color
State.theme.shade
State.theme.alpha- rework transformers and serialize subfields of color vars by @adhami3310 in #5819
Upgrade react-player (rx.video) to v3
There are some providers that got removed in the update and the API changed. We added a mapping to maintain them as close as possible. If you get any deprecation warnings related to rx.video that's why.
Automatically convert time and date from str if event handler function is typed as such
If you have an event handler:
import datetime
class State(rx.State):
@event
def receive_datetime(self, t: datetime.datetime):
...Then you can do:
State.receive_datetime(datetime.datetime.now())That used to fail, since we go to the frontend and back, which would serialize the datetime into a string to be stored in JSON. Now we attempt to convert the str into the typed parameter if possible for datetime objects.
- add deser for date and time by @adhami3310 in #5822
Add option to disable server-side rendering for reflex export and reflex deploy
You can pass --no-ssr to the commands to disable react router per-rendering routes. Note that might hurt your SEO performance. You can also configure that with REFLEX_SSR=1/0.
- add an option to disable ssr for export and deploy by @adhami3310 in #5821
Bugfixes
- bring back manual exception printing by @adhami3310 in #5823
Chores
- 0813dev by @adhami3310 in #5816
- Refactor
test_evnt_actions_throttle_debounceto be more forgiving by @masenf in #5824
Full Changelog: v0.8.12...v0.8.13