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.
* computed var default to cache=True by Lendemor in https://github.com/reflex-dev/reflex/pull/4194
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, use `import reflex_chakra as rc` instead.
* `rx.background` is removed, use `rx.event(background=True)` instead.
* `rx.Component._create_event_chain` is removed, use `rx.EventChain.create` instead.
* `external` prop for `rx.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, use `rx.asset` instead.
* Passing a `str` argument to `rx.utils.console.set_log_level` will now raise `TypeError`.
* 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, use `str(rx.Var.create(chain))` instead.
* `_var_is_local` and `_var_is_string` removed from `rx.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 https://github.com/reflex-dev/reflex/pull/4586
`rx.App` fields for internal use now have a `_` prefix
* rename private fields with leading underscore in App by Lendemor in https://github.com/reflex-dev/reflex/pull/4642
New Features
`reflex rename`
A new command to rename an app.
* [ENG-1796]`reflex rename`- B by ElijahAhianyo in https://github.com/reflex-dev/reflex/pull/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.
* [ENG-4326] Async ComputedVar by masenf in https://github.com/reflex-dev/reflex/pull/4711
"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 https://github.com/reflex-dev/reflex/pull/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.
* allow dynamic icons name by Lendemor in https://github.com/reflex-dev/reflex/pull/4636
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.
python
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 https://github.com/reflex-dev/reflex/pull/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 https://github.com/reflex-dev/reflex/pull/4611
* return websocket protocol when asked by adhami3310 in https://github.com/reflex-dev/reflex/pull/4683
* fix subprotocol for granian by adhami3310 in https://github.com/reflex-dev/reflex/pull/4698
Typing
* improve type support for .get_state by adhami3310 in https://github.com/reflex-dev/reflex/pull/4623
* cast return_expr to Var all the time by adhami3310 in https://github.com/reflex-dev/reflex/pull/4649
* make object var handle all mapping instead of just dict by adhami3310 in https://github.com/reflex-dev/reflex/pull/4602
* add more type annotations through the code by Lendemor in https://github.com/reflex-dev/reflex/pull/4401
* improve var create typing by adhami3310 in https://github.com/reflex-dev/reflex/pull/4701
* improve var base typing by adhami3310 in https://github.com/reflex-dev/reflex/pull/4718
* improve rx.Field ObjectVar typing for sqlalchemy and dataclasses by benedikt-bartscher in https://github.com/reflex-dev/reflex/pull/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 https://github.com/reflex-dev/reflex/pull/4670
* Fix recharts min width/height by adhami3310 in https://github.com/reflex-dev/reflex/pull/4672
* pie chart type annotation fix by LineIndent in https://github.com/reflex-dev/reflex/pull/4681
Avoid Leaked Websocket connections
* disable react strict mode for event loop by adhami3310 in https://github.com/reflex-dev/reflex/pull/4720
Miscellaneous
* make that one line better by adhami3310 in https://github.com/reflex-dev/reflex/pull/4610
* EventChain.create accepts arbitrary kwargs by masenf in https://github.com/reflex-dev/reflex/pull/4609
* Skip saving page components when skipping compile output by masenf in https://github.com/reflex-dev/reflex/pull/4653
* Allow deploy with project name and app id by ElijahAhianyo in https://github.com/reflex-dev/reflex/pull/4550
* Remove token check in reflex deploy by ElijahAhianyo in https://github.com/reflex-dev/reflex/pull/4640
* [ENG-4444] move states out of .web by adhami3310 in https://github.com/reflex-dev/reflex/pull/4689
* improve error message for failed compile_state by adhami3310 in https://github.com/reflex-dev/reflex/pull/4702
* assert that .render returns jsonable values by adhami3310 in https://github.com/reflex-dev/reflex/pull/4708
* fix tag render to be recursive by adhami3310 in https://github.com/reflex-dev/reflex/pull/4714
* Handle python `range` passed to rx.Var.create by masenf in https://github.com/reflex-dev/reflex/pull/4716
* var_data fixes with hooks values by adhami3310 in https://github.com/reflex-dev/reflex/pull/4717
* implement a global var cache by adhami3310 in https://github.com/reflex-dev/reflex/pull/4691
* add evaluate time to the progress counter by adhami3310 in https://github.com/reflex-dev/reflex/pull/4722
* better computed var static deps by benedikt-bartscher in https://github.com/reflex-dev/reflex/pull/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 https://github.com/reflex-dev/reflex/pull/4622
* small fix for color_mode_button by Lendemor in https://github.com/reflex-dev/reflex/pull/4634
* [ENG-4383] Handle special float values on frontend by masenf in https://github.com/reflex-dev/reflex/pull/4638
* put import at the top of dynamic component evaluation by adhami3310 in https://github.com/reflex-dev/reflex/pull/4632
* fix boolean to boolen comparisons by adhami3310 in https://github.com/reflex-dev/reflex/pull/4620
* don't need node when --backend_only is used by Lendemor in https://github.com/reflex-dev/reflex/pull/4641
* check for dict passed as children for component by Lendemor in https://github.com/reflex-dev/reflex/pull/4656
* attempt to fix usage when volta is installing node by Lendemor in https://github.com/reflex-dev/reflex/pull/4664
* reflex export environment should default to prod by adhami3310 in https://github.com/reflex-dev/reflex/pull/4673
* refactor client state to restore prior API by adhami3310 in https://github.com/reflex-dev/reflex/pull/4674
* Fix setting default color mode in dev mode by masenf in https://github.com/reflex-dev/reflex/pull/4616
* fix stuff with bun_path by Lendemor in https://github.com/reflex-dev/reflex/pull/4688
* fix bun path handling and add a test (4785)
* fix bun message (4739)
* import vars are not sortable by adhami3310 in https://github.com/reflex-dev/reflex/pull/4700
* merging two style instance should give a style instance by Lendemor in https://github.com/reflex-dev/reflex/pull/4706
* followup for merge style by Lendemor in https://github.com/reflex-dev/reflex/pull/4721
* fix padding style in textarea by Lendemor in https://github.com/reflex-dev/reflex/pull/4696
* only allow item inside root by Lendemor in https://github.com/reflex-dev/reflex/pull/4697
* allow functools partial with foreach by adhami3310 in https://github.com/reflex-dev/reflex/pull/4709
* make all triggers disable recurisve memoization by adhami3310 in https://github.com/reflex-dev/reflex/pull/4719
* don't memoize tooltip or skeleton children by adhami3310 in 4744
* include dynamic imports for custom components by adhami3310 in https://github.com/reflex-dev/reflex/pull/4725
* fix: allow replacing of _var_type in ComputedVar by benedikt-bartscher in https://github.com/reflex-dev/reflex/pull/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 https://github.com/reflex-dev/reflex/pull/4630
* Bump frontend and backend deps by masenf in https://github.com/reflex-dev/reflex/pull/4667
* update bun to 1.2.0 by adhami3310 in https://github.com/reflex-dev/reflex/pull/4678
Linting / Code Quality
* add some of the TRY rules by Lendemor in https://github.com/reflex-dev/reflex/pull/4651
* add defensive checks against data being funny by adhami3310 in https://github.com/reflex-dev/reflex/pull/4633
* enable N rules for naming conventions by Lendemor in https://github.com/reflex-dev/reflex/pull/4666
* fix version in pyproject and ruff version check by Lendemor in https://github.com/reflex-dev/reflex/pull/4690
* enable PGH, bump pyright and fix all type: ignore by Lendemor in https://github.com/reflex-dev/reflex/pull/4699
* bump ruff version to 0.9.3 by Lendemor in https://github.com/reflex-dev/reflex/pull/4705
Other Changes
* pyproject.toml: bump to 0.7.0dev1 for further development by masenf in https://github.com/reflex-dev/reflex/pull/4604
* Show file and line number in deprecation warnings by masenf in https://github.com/reflex-dev/reflex/pull/4631
* retry failed tests by adhami3310 in https://github.com/reflex-dev/reflex/pull/4675
* remove integration screenshots by adhami3310 in https://github.com/reflex-dev/reflex/pull/4677
* Do not track compile in posthog metrics by masenf in https://github.com/reflex-dev/reflex/pull/4669
* attempt to upgrade windows latest python version by adhami3310 in https://github.com/reflex-dev/reflex/pull/4679
* use older version of python for windows simple benchmarks by adhami3310 in https://github.com/reflex-dev/reflex/pull/4680
* add codspeed by adhami3310 in https://github.com/reflex-dev/reflex/pull/4707
* add backend disabled dialog by adhami3310 in https://github.com/reflex-dev/reflex/pull/4715
* Update disabled backend component by carlosabadia in 4747
* Remove upper pin by Alek99 in https://github.com/reflex-dev/reflex/pull/4684
* fix optional wrapping of static call methods in pyi by adhami3310 in https://github.com/reflex-dev/reflex/pull/4727
New Contributors
* LineIndent made their first contribution in https://github.com/reflex-dev/reflex/pull/4670
**Full Changelog**: https://github.com/reflex-dev/reflex/compare/v0.6.8...v0.7.0