Deprecations
app.add_custom_404_page
is deprecated -- useapp.add_page(..., route="/404")
instead.external
prop ofrx.redirect
is renamed tois_external
for consistency.- Unify
is_external
prop inrx.redirect
andrx.link
by @ElijahAhianyo in #4389
- Unify
New Features
async_db_url
and rx.asession
Builtin support for async database operations using sqlmodel. Proper usage requires the following:
- Install
greenlet
for sqlalchemy to use async operations. - Install an appropriate async-capable database driver (aiosqlite, pyscopg)
- Set
ASYNC_DB_URL
in the environment that references the async db driver. This should point to the same database as specified inDB_URL
, which should still be set for handling alembic migrations and for use in computed vars, etc. - Use
async with rx.asession() as asession
-- await most operations on the asession.
Async DB operations are preferred in event handlers to avoid blocking other users on the server.
Var Operations for datetime
values
[Wrapping React] new deps
and position
fields in VarData
This allows for customization and control of where hooks are rendered relative to other hooks and memoized event handlers. Deps allows for specification of vars that memoized event handlers depend on.
Improvements
More Efficient Database Connection Pooling
Each time rx.session
was used, it was creating a new pool and not reusing connections.
Linting
- enable RUF rules by @Lendemor in #4465
- enable FURB rules by @Lendemor in #4466
- add ERA rules to detect commented out code by @Lendemor in #4472
- enable C4 rule by @Lendemor in #4536
- enable PTH rule by @Lendemor in #4476
- enable PERF rules by @Lendemor in #4469
- style: prefer type() over class by @benedikt-bartscher in #4512
Performance
- minor pickle improvement by @benedikt-bartscher in #4499
- Avoid double JSON encode/decode for socket.io by @masenf in #4449
- simplify redis code, less redis calls by @benedikt-bartscher in #4456
Miscellaneous
- Avoid
set_log_level
foot gun by @masenf in #4422 - [HOS-333] Send a "reload" message to the frontend after state expiry by @masenf in #4442
- enable css props via wrapperStyle for recharts components by @Lendemor in #4447
- add default value for text area by @Lendemor in #4462
- add
__repr__
method to MutableProxy by @benedikt-bartscher in #4506 - [ENG-4135]Default
rx.link
href to#
sounderline
prop works by @ElijahAhianyo in #4509 - raise StateSerializationError if the state cannot be serialized by @benedikt-bartscher in #4453
- disable polling by @benedikt-bartscher in #4441
- deprecate add_custom_404_page by @Lendemor in #4505
- [ENG-4100]Throw warnings when Redis lock is held for more than the allowed threshold by @ElijahAhianyo in #4522
- Wrap Checkbox component in Context Menu (partial fix for #4262) by @vydpnguyen in #4479
- Include step attribute in input by @Joodith in #4073
- improve StateManagerRedis error message by @benedikt-bartscher in #4444
Bug Fixes
- [ENG-4137] Handle generic alias passing inspect.isclass check by @masenf in #4427
- fix mutable default in EventNamespace by @Lendemor in #4420
- fix: state size was not checked for dill by @benedikt-bartscher in #4431
- allow for 'go.Figure | None' annotation in State by @Lendemor in #4426
- rx.upload must include _var_data from props by @masenf in #4463
- fix: multiple mismatched-type-assignment fixes by @benedikt-bartscher in #4482
- fix: migrate is_backend_only (deprecated) to EnvironmentVariables by @benedikt-bartscher in #4495
- Fix REFLEX_COMPILE_PROCESSES=0 by @masenf in #4523
- client_state: create Var from value when pushing from backend by @masenf in #4474
- fix: handle default_factory in get_attribute_access_type by @benedikt-bartscher in #4517
- [ENG-4165] Consider default and default_factory for state vars by @masenf in #4510
- Fix upload cancellation by @masenf in #4527
- [ENG-4153]Use empty string for None values in
rx.input
andrx.el.input
by @ElijahAhianyo in #4521 - [ENG-3583] Respect cors_allowed_origins for backend HTTP requests by @masenf in #4533
Documentation
- Add production-one-port example by @masenf in #4489
- add issues templates by @Lendemor in #4455
- [HOS-466]Fix deploy help text by @ElijahAhianyo in #4508
Version Bumps
Other Changes
- Remove invitation code logic from reflex logoutv2 by @ElijahAhianyo in #4433
- test dynamic route flakiness (can't reproduce locally) by @benedikt-bartscher in #4496
- add test for color mode (initial and toggle) by @Lendemor in #4467
- Support python 3.13 by @Lendemor in #4206
- bump CI runners to
macos-latest
by @masenf in #4526 - raise_console_error during integration tests by @masenf in #4535
New Contributors
- @vydpnguyen made their first contribution in #4479
- @Joodith made their first contribution in #4073
Full Changelog: v0.6.6.post3...v0.6.7