Releases: reflex-dev/reflex
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
v0.8.12
Release Notes
Add on_drop_rejected to handle file type failures
Include assets folder in backend.zip by default, and add --exclude-from-backend CLI option
- ENG-7746: include assets in backend.zip by @adhami3310 in #5814
Improved websocket reliability in disconnection cases
- Reassociate sid and token when connecting websocket by @masenf in #5794
- Remove token/sid associations when server is exiting by @masenf in #5802
- Automatic websocket reconnect and reload handling by @masenf in #5805
.db files are now ignored from hot-reload watchfiles by default
- exclude db from watch files extensions by @adhami3310 in #5800
Bugfixes
Check against using components as styles accidentally
If you do:
rx.el.div(something=rx.icon(...))
The icon would be interpreted as style value. That used to raise a runtime error, now it happens at compile time.
- ENG-7583: check against base component for style by @adhami3310 in #5795
console.error now correctly point to stderr
Previously things like backend exceptions and frontend exceptions wouldn't go to stderr. This is now fixed.
- ENG-7619: make console errors go to stderr by @adhami3310 in #5789
Doing foreach over a null that is mistakenly typed as a list or an object will not result in a runtime error (would be just an empty list)
- avoid runtime errors on iterating over non-array by @adhami3310 in #5796
Env vars properly update from REFLEX_ENV_FILE with Granian
- use _load_dotenv_from_env on reload for granian by @adhami3310 in #5798
Misc
- add Enum to immutable types by @tim-haselhoff in #5808
- Preserve entry.client.js in prod mode by @masenf in #5813
Performance Improvements
- optimize mutable proxy by @adhami3310 in #5815
Chores
- 0812dev by @adhami3310 in #5792
New Contributors
- @tim-haselhoff made their first contribution in #5808
Full Changelog: v0.8.11...v0.8.12
v0.8.11
Release Notes
Support EventHandler in rx.PropsBase
Bugfixes
- preserve prop names to some degree with memo by @adhami3310 in #5777
- handle var for clear selected files by @adhami3310 in #5784
- Fixing
code_tag_propsinrx.code_blockby @riebecj in #5779
Chores
- 0811dev by @adhami3310 in #5775
Full Changelog: v0.8.10...v0.8.11
v0.8.10
Release Notes
rx.redirect now takes popup option.
WARNING: This also made it such that is_external and replace are keyword-only arguments.
You can use popup along with is_external to make a popup screen. Be wary that some browsers might block those (occasionally).
- add popup option for redirect by @adhami3310 in #5764
Pass along SQL Alchemy Pool configuration
You can use the environment variables: SQLALCHEMY_POOL_SIZE, SQLALCHEMY_MAX_OVERFLOW, SQLALCHEMY_POOL_RECYCLE, and SQLALCHEMY_POOL_TIMEOUT to configure their corresponding pool configuration.
- add sqlalchemy client pool configuration options via env vars by @benedikt-bartscher in #5751
Determinism Fixes
The Reflex compiler should ideally be deterministic. We fixed a few spots where it wasn't. This included switching from sets to dicts in a few places and fixing the seed for the random ID for components. This should ideally limit the number of unintended HMR errors.
- improve determinism by @adhami3310 in #5755
Styles Fixes
With --env prod, some CSS styles might appear in the wrong order, causing weird styling. This is now fixed.
- put reflexGlobalStyles before everything and add style to radix theme root by @adhami3310 in #5763
Re-add UploadFile.filename to maintain compatibility with Starlette
We removed that property because it had inconsistent value among browsers. Now it's back, but it should be consistent.
- readd UploadFile.filename for compat with StarletteUploadFile by @adhami3310 in #5772
Specify extra_headers to rx.upload_files
In case you want your upload files post request to have extra headers, you can use the extra_headers keyword argument.
- add extra headers to upload event spec by @adhami3310 in #5771
Chores
- 0810dev by @adhami3310 in #5754
Full Changelog: v0.8.9...v0.8.10
v0.8.9
Release Notes
Deprecate state_auto_setters being defaulted to True.
In 0.9.0 this option will default to False. Set it to True if you want to use set_ pattern, or implement setters explicitly.
- deprecate state_auto_setters=True by @adhami3310 in #5739
Option to disable Vite's Hot-Module-Reload
In case you are getting "No module update found for route", you can force full page reload on updates by setting the environment variable VITE_FORCE_FULL_RELOAD to 1. In case you want to disable the reload completely (so refreshing manually to update the page), you can set VITE_HMR to 0.
- add option to disable hmr by @adhami3310 in #5745
ImportVar(tag="*", is_default=True, alias='Alias) works as expected now
It renders to:
import * as Alias from '...'- handle star imports for alias by @adhami3310 in #5743
Wrap additional SVG elements.
Those include: Polyline, SvgImage, Use, TSpan, TextPath, Pattern, ClipPath, Symbol, Mask, ForeignObject, SvgA, Animate, AnimateMotion, AnimateTransform, Set, MPath, Desc, Title, Metadata, Script, SvgStyle, Switch, View
- add few missing svg elements by @adhami3310 in #5742
Performance optimizations
Some cleanups in particularly offending functions. It doesn't affect most things but it does improve things by a bit.
- optimize various functions by @adhami3310 in #5744
- fix issubclass calls by @adhami3310 in #5753
Serialize Memo components as Vars
You can use memo components as Vars of type=type[Component].
- allow memo components to be passed to props by @adhami3310 in #5178
Chores
- 089dev by @adhami3310 in #5736
- ENG-7548: update rx.Config docstring by @LineIndent in #5752
Full Changelog: v0.8.8...v0.8.9
v0.8.8
Release Notes
Performance Optimizations
We replaced jinja2 with simpler fstring calls. This resulted in approximately 30% faster rendering step. We also optimized the import collections by ~15%.
- Replace jinja with fstrings by @adhami3310 in #5720
Add more information to asyncio Tasks
If a task gets cancelled or such now Reflex will add a bit more information to what task that was.
Bugfixes
- use add_style instead of _get_style for drawer components by @adhami3310 in #5734
- rename Event to ReflexEvent by @adhami3310 in #5735
Chores
- 088dev by @adhami3310 in #5719
- improve literal handling in pyi generator by @adhami3310 in #5725
- fix: upgrade lucide-react to 0.541.0 to resolve security issue by @devin-ai-integration[bot] in #5732
Full Changelog: v0.8.7...v0.8.8