Breaking Changes
Python 3.9 support is no longer supported.
Computed Vars are now cache=True
by default
Explicitly set cache=False
on Computed Vars that should be updated after every
event, which was the previous default behavior.
The dependency tracking analysis for Computed Vars has been improved to support
async Computed Vars, so there is a possibility for unanticipated behavior change
around tracking dependencies. Please report any bugs encountered in this area.
Previously "CallableVar" shims need to be explicitly called
rx.upload_file
->rx.upload_file()
rx.selected_files
->rx.selected_files()
rx.clear_selected_files
->rx.clear_selected_files()
rx.set_color_mode
->rx.set_color_mode()
Deprecation Removals
Usage of these features prior to 0.7.0 printed a deprecation warning, now they will result in an error.
-
rx.chakra
is removed, useimport reflex_chakra as rc
instead. -
rx.background
is removed, userx.event(background=True)
instead. -
rx.Component._create_event_chain
is removed, userx.EventChain.create
instead. -
external
prop forrx.redirect
is removed. -
Unannotated event handler arguments will now raise
MissingAnnotationError
. -
Many internal exceptions were renamed to add a trailing
Error
suffix if that was missing. -
rx._x.asset
is removed, userx.asset
instead. -
Passing a
str
argument torx.utils.console.set_log_level
will now raiseTypeError
. -
Removals from
rx.utils.exec
:is_frontend_only
->rx.config.environment.REFLEX_FRONTEND_ONLY.get()
is_backend_only
->rx.config.environment.REFLEX_BACKEND_ONLY.get()
should_skip_compile
->rx.config.environment.REFLEX_SKIP_COMPILE.get()
-
rx.utils.format.format_event_chain
is removed, usestr(rx.Var.create(chain))
instead. -
_var_is_local
and_var_is_string
removed fromrx.Var.create
. -
Computed Vars without a return type annotation will raise
UntypedComputedVarError
. -
removing deprecated features for 0.7.0 and removing py3.9 support by @Lendemor in #4586
rx.App
fields for internal use now have a _
prefix
New Features
reflex rename
A new command to rename an app.
- [ENG-1796]
reflex rename
- B by @ElijahAhianyo in #4668
rx.var
now supports async
functions
An rx.var
computed var can now wrap an async function, which can access
arbitrary state via get_state
and var values via get_var_value
.
Dependency tracking across states is supported, but there may be edge cases in
the new implementation that prevent depedencies from being automatically
identified. You can pass explicit dependencies to the deps
argument, and can
add dependencies at runtime via cls.computed_vars[var_name].add_dependency
.
For best results, pass a globally imported state class to get_state
and assign
the return value to a local variable in the function.
"Built with Reflex" badge
To raise awareness of Reflex, a sticky "Built with Reflex" badge is added to the
lower right corner of each page.
For subscribers of Reflex Cloud, this badge can be disabled by setting
show_built_with_reflex=False
in rxconfig.py
or SHOW_BUILT_WITH_REFLEX=0
in
the environment.
For more information see: https://reflex.dev/docs/hosting/reflex-branding/
- Add a sticky Built with Reflex badge by @Lendemor in #4584
- Sticky tweaks: only show in prod mode by @masenf in #4789
Improvements
Support For Dynamic Icon name
Previously the recommendation was to use rx.match
to map icons, because the
icon name itself could not be a Var.
With rx.dynamic_icon
, the name can now be a Var, but performance may be
affected by dynamic loading.
Support for Specifying Custom App Module
A new config knob is added to rxconfig.py
, to load the app from a module other than the default.
config = rx.Config(
app_name="my_app",
app_module_import="some_package.my_actual_app_module",
)
The app module should be importable by name with the current PYTHONPATH
/ sys.path
, and contain an app
attribute.
- [ENG-4134]Allow specifying custom app module in rxconfig by @ElijahAhianyo in #4556
Display Warning for Frontend/Backend Version Mismatch
When the frontend and backend versions do not match, a warning is displayed in the console.
- check frontend version on connect by @adhami3310 in #4611
- return websocket protocol when asked by @adhami3310 in #4683
- fix subprotocol for granian by @adhami3310 in #4698
Typing
- improve type support for .get_state by @adhami3310 in #4623
- cast return_expr to Var all the time by @adhami3310 in #4649
- make object var handle all mapping instead of just dict by @adhami3310 in #4602
- add more type annotations through the code by @Lendemor in #4401
- improve var create typing by @adhami3310 in #4701
- improve var base typing by @adhami3310 in #4718
- improve rx.Field ObjectVar typing for sqlalchemy and dataclasses by @benedikt-bartscher in #4728
- Add ComputedVar overloads for BASE_TYPE, SQLA_TYPE, and DATACLASS_TYPE by @masenf in #4777
- Ensure EventCallback exposes EventActionsMixin properties by @masenf in #4772
- make computed var generic over mapping by @adhami3310 in #4762
- remove base_state from event types by @adhami3310 in #4740
Recharts
- [ENG-4406] cell component wrapper by @LineIndent in #4670
- Fix recharts min width/height by @adhami3310 in #4672
- pie chart type annotation fix by @LineIndent in #4681
Avoid Leaked Websocket connections
- disable react strict mode for event loop by @adhami3310 in #4720
Miscellaneous
- make that one line better by @adhami3310 in #4610
- EventChain.create accepts arbitrary kwargs by @masenf in #4609
- Skip saving page components when skipping compile output by @masenf in #4653
- Allow deploy with project name and app id by @ElijahAhianyo in #4550
- Remove token check in reflex deploy by @ElijahAhianyo in #4640
- [ENG-4444] move states out of .web by @adhami3310 in #4689
- improve error message for failed compile_state by @adhami3310 in #4702
- assert that .render returns jsonable values by @adhami3310 in #4708
- fix tag render to be recursive by @adhami3310 in #4714
- Handle python
range
passed to rx.Var.create by @masenf in #4716 - var_data fixes with hooks values by @adhami3310 in #4717
- implement a global var cache by @adhami3310 in #4691
- add evaluate time to the progress counter by @adhami3310 in #4722
- better computed var static deps by @benedikt-bartscher in #4729
- provide plotly subpackages by @adhami3310 in #4776
- Copy/update assets on compile by @masenf in #4765
- use getattr when given str in getitem by @adhami3310 in #4761
- Resolve custom component version dynamically by @masenf in #4759
setuptools-scm
support for custom component publishing
- throw error if computed var has args by @Lendemor in #4753
- move id to trigger instead of root by @adhami3310 in #4752
Bug Fixes
- [ENG-4351] Add mapping for lucide icons by @masenf in #4622
- small fix for color_mode_button by @Lendemor in #4634
- [ENG-4383] Handle special float values on frontend by @masenf in #4638
- put import at the top of dynamic component evaluation by @adhami3310 in #4632
- fix boolean to boolen comparisons by @adhami3310 in #4620
- don't need node when --backend_only is used by @Lendemor in #4641
- check for dict passed as children for component by @Lendemor in #4656
- attempt to fix usage when volta is installing node by @Lendemor in #4664
- reflex export environment should default to prod by @adhami3310 in #4673
- refactor client state to restore prior API by @adhami3310 in #4674
- Fix setting default color mode in dev mode by @masenf in #4616
- fix stuff with bun_path by @Lendemor in #4688
- import vars are not sortable by @adhami3310 in #4700
- merging two style instance should give a style instance by @Lendemor in #4706
- fix padding style in textarea by @Lendemor in #4696
- only allow item inside root by @Lendemor in #4697
- allow functools partial with foreach by @adhami3310 in #4709
- make all triggers disable recurisve memoization by @adhami3310 in #4719
- don't memoize tooltip or skeleton children by @adhami3310 in #4744
- include dynamic imports for custom components by @adhami3310 in #4725
- fix: allow replacing of _var_type in ComputedVar by @benedikt-bartscher in #4730
- [ENG-4570] Fix rx.foreach over dict by @masenf in #4743
- Allow template with unspecified demo_url by @masenf in #4741
Version Bumps
- bump nextJS to v15 by @Lendemor in #4630
- Bump frontend and backend deps by @masenf in #4667
- update bun to 1.2.0 by @adhami3310 in #4678
Linting / Code Quality
- add some of the TRY rules by @Lendemor in #4651
- add defensive checks against data being funny by @adhami3310 in #4633
- enable N rules for naming conventions by @Lendemor in #4666
- fix version in pyproject and ruff version check by @Lendemor in #4690
- enable PGH, bump pyright and fix all #type: ignore by @Lendemor in #4699
- bump ruff version to 0.9.3 by @Lendemor in #4705
Other Changes
- pyproject.toml: bump to 0.7.0dev1 for further development by @masenf in #4604
- Show file and line number in deprecation warnings by @masenf in #4631
- retry failed tests by @adhami3310 in #4675
- remove integration screenshots by @adhami3310 in #4677
- Do not track compile in posthog metrics by @masenf in #4669
- attempt to upgrade windows latest python version by @adhami3310 in #4679
- use older version of python for windows simple benchmarks by @adhami3310 in #4680
- add codspeed by @adhami3310 in #4707
- add backend disabled dialog by @adhami3310 in #4715
- Update disabled backend component by @carlosabadia in #4747
- Remove upper pin by @Alek99 in #4684
- fix optional wrapping of static call methods in pyi by @adhami3310 in #4727
New Contributors
- @LineIndent made their first contribution in #4670
Full Changelog: v0.6.8...v0.7.0