Releases: reflex-dev/reflex
v0.5.9
Bug Fixes
- fix silly bug when style is set directly to breakpoints by @adhami3310 in #3719
- Fix event actions like
stop_propagation
for recharts event triggers - fix initial_value for computed_var by @benedikt-bartscher in #3726
- add test for initial state dict by @benedikt-bartscher in #3727
- Improve Client-Side Routing on Page Not Found by @Manas1820 in #3723
- Use the new state name when setting
is_hydrated
to false by @masenf in #3738 - Use
._is_mutable()
to account for parent state proxy by @masenf in #3739
Doc Updates
Var Refactor
This release includes some new experimental features being developed incrementally in reflex._x.vars.
- [REF-3328] Implement getitem for ArrayVar by @adhami3310 in #3705
- add type hinting to existing types by @adhami3310 in #3729
Full Changelog: v0.5.8...v0.5.9
v0.5.8
New Features
Improvements
- Recharts Improvements
- [REF-3273]Add SVG circle, polygon and rect components by @ElijahAhianyo in #3684
- notifying frontend about backend error looks better by @Lendemor in #3491
Bug Fixes
- debounce: pass through key and special_props by @masenf in #3655
- [REF-3135]Radix Primitive components should not ignore provided
class_name
prop by @ElijahAhianyo in #3676 - [REF-3101]
rx.list
Dont set/hardcodelist_style_position
css prop by @ElijahAhianyo in #3695 - [REF-3184] [REF-3339] Background task locking improvements by @masenf in #3696
- [REF-3375] useMemo on generateUUID props to maintain consistent value by @masenf in #3708
- Define BaseVar fields on ComputedVar by @paoloemilioserra in #3659
Var Refactor
This release includes some new experimental features being developed incrementally in reflex._x.vars.
- [REF-3222] define new JS-type var classes by @adhami3310 in #3668
- [REF-3228] implement LiteralStringVar and format/retrieval mechanism by @adhami3310 in #3669
- [REF-3227] implement more literal vars by @adhami3310 in #3687
- [REF-3321] implement var operation decorator by @adhami3310 in #3698
Other Changes
- cleanup unused useReducer import by @benedikt-bartscher in #3667
- feat: Improve documentation in Japanese README.md file by @l-melon in #3650
- Benchmarking Updates by @Alek99 in #3680
- add Persian translation and update the language links in the README.m… by @BenyaminZojaji in #3666
- fix var warning by @Lendemor in #3704
New Contributors
- @Manas1820 made their first contribution in #3662
- @l-melon made their first contribution in #3650
- @BenyaminZojaji made their first contribution in #3666
- @paoloemilioserra made their first contribution in #3659
Full Changelog: v0.5.7...reflex-0.5.8
v0.5.7
New Features
- Catch unhandled errors on both frontend and backend by @maximvlah in #3572
rx.App
now supportsfrontend_exception_handler
andbackend_exception_handler
which are called when unhandled exceptions occur.- Fix the error boundary by @maximvlah in #3637
- Bare SQLAlchemy mutation tracking by @benedikt-bartscher in #3628
- feat: Adding an event to go back just as the user would. by @abulvenz in #3636
return rx.event.back()
Improvements
- Recharts Improvements
- minor chart clean up by @Alek99 in #3551
- update graphing by @tgberkeley in #3606
- Tom/recharts missing props by @tgberkeley in #3645
- add warning when using css props on recharts by @Lendemor in #3651
- Make domain props work for
y_axis
by @Lendemor in #3652
- dedupe config overrides by @benedikt-bartscher in #3600
- gitignore external assets by default by @benedikt-bartscher in #3621
- only write .gitignore if needed by @benedikt-bartscher in #3618
- [REF-3160] fix rx.Var._replace raise TypeError on invalid kwargs by @Jishnu-Nandhiath in #3625
- add module prefix to generated state names by @benedikt-bartscher in #3214
- Allow DebounceInput as child of FormControl Component by @ElijahAhianyo in #3660
Bug Fixes
- fix sqla python_type issues, add tests by @benedikt-bartscher in #3613
- Fix 404 on dynamic routes during hot reload
- Avoid model metaclass error with pydantic < 1.10.15
- Fix warnings
- fix unclosed file by @benedikt-bartscher in #3639
- migrate deprecated connections to net_connections by @benedikt-bartscher in #3641
- Pkg resources deprecation by @benedikt-bartscher in #3646
- fix Var.contains pyi by @benedikt-bartscher in #3663
Documentation
- [Graphing Docs] small update by @tgberkeley in #3612
Var Refactor
This release includes some new experimental features being developed incrementally in reflex._x.vars.
- add immutable var class by @adhami3310 in #3607
- [REF-3225] implement format for immutable vars by @adhami3310 in #3617
Other Changes
- pyproject.toml: bump to 0.5.6 by @masenf in #3635
- benchmarks.yml: use node 18.x with reflex-web@main by @masenf in #3657
New Contributors
- @maximvlah made their first contribution in #3572
Full Changelog: v0.5.6...v0.5.7
v0.5.6
New Features
rx.clipboard
Handle global and component-scoped on_paste
with multi-type data
rx.breakpoints
- Set breakpoints by name
- introduce customizable breakpoints by @adhami3310 in #3568
- add responsive props to radix components by @adhami3310 in #3583
Computed Backend Vars
- add computed backend vars by @benedikt-bartscher in #3573
- improve backend var determination by @benedikt-bartscher in #3587
Improvements
- [REF-3056]Config knob for redis StateManager expiration times by @ElijahAhianyo in #3523
- [Perf] Ensure rx.match gets memoized to avoid excessive re-rendering by @masenf in #3552
- bare sqlalchemy session + tests by @benedikt-bartscher in #3522
- Remove chakra from codeblock by @abulvenz in #3570
- add compilation timestamp in log by @Lendemor in #3563
- [REF-3148] add props for tabs by @Lendemor in #3560
- show the value causing problem in deprecation warning by @Lendemor in #3558
- Better support for Github Codespaces
- Better hot reload times on Windows with python 3.12 and uvicorn > 0.20
rx.theme
appearance is reset in dev mode- [REF-2588]Clear color mode local storage for dev mode by @ElijahAhianyo in #3548
Bug Fixes
- Fix radix radio cards component by @emmakodes in #3545
- fix small typing issue by @Lendemor in #3562
- [REF-3185][REF-3180]Dont escape backticks in JS string interpolation by @ElijahAhianyo in #3566
- classvars should not be backend vars by @benedikt-bartscher in #3578
- ComponentState and State mixins now work with backend vars
- copy backend vars from mixins by @benedikt-bartscher in #3580
- fix var dependency over properties by @benedikt-bartscher in #3588
- [REF-3157] Avoid SQLModel metaclass conflict (#3610)
- [REF-3220] Fix rx.cancel_upload EventSpec (#3608)
- do not get_config in global scope (#3597)
Other Changes
- Validate ComputedVar dependencies, add tests by @benedikt-bartscher in #3527
- do not validate non-cached var deps by @benedikt-bartscher in #3576
- Radio group fix deprecation warning for creating vars with strings by @ElijahAhianyo in #3567
- update dependencies pinning by @Lendemor in #3556
- fix formatting by @benedikt-bartscher in #3574
- order type annotations in pyi_generator by @benedikt-bartscher in #3585
- Deprecate cached var by @benedikt-bartscher in #3582
- Change Strategy Prop to Literal by @Alek99 in #3575
- pyi_generator cleanup: ruff, remove fully qualified reflex. names by @masenf in #3591
- cleanup unused check by @benedikt-bartscher in #3590
- split lifespan and middleware logic in separate mixin files by @Lendemor in #3557
- Update links to /docs/library/dynamic-rendering/foreach/ (#3609)
New Contributors
Welcome Khaleel to the Core Team
- @adhami3310 made their first contribution in #3568
Full Changelog: v0.5.5...v0.5.6
v0.5.5
New Features
- Feat: Add Session storage to store data on client storage by @TG199 in #3420
- add in rx.el.style by @tgberkeley in #3511
Improvements
- [REF-3012] Add defs, lineargradient and stop html elements by @carlosabadia in #3467
- More recharts improvements
- Hanson recharts batch #2 by @HongyuHansonYao in #3472
- (WIP) recharts fixes batch #3 by @HongyuHansonYao in #3496
- Hanson/tooltip-improvement/props by @HongyuHansonYao in #3525
- Hanson/radial bar chart by @HongyuHansonYao in #3532
- add event triggers for rx.video by @Lendemor in #2700
- allow return from run_in_thread by @Lendemor in #3477
- update launch message by @Lendemor in #3453
- [REF-2830] server side events and stateless components should not require not require a backend by @ElijahAhianyo in #3475
- Make
.web
configurable with REFLEX_WEB_WORKDIR by @Lendemor in #3462 - Improve ClientState compatibility with rx.input by @masenf in #3490
- add allow_system prop to colormode iconbutton, and clean up logic by @Lendemor in #3507
Bug Fixes
- [REF-3016]Allow special characters in upload ID by @ElijahAhianyo in #3449
- Protect StateProxy with an asyncio.Lock by @masenf in #3508
- fix segmented_control by @Lendemor in #3516
- Updated radio group component by @sagarhedaoo in #3474
- fix checkbox_group component by @emmakodes in #3454
- Always treat the call_script callback as a string of JS code by @masenf in #3521
- [REF-3079] state.js: disconnect websocket for window "pagehide" event by @masenf in #3540
- fix hydration error by @Lendemor in #3542
Other Changes
- use add_imports everywhere by @Lendemor in #3448
- swap all use of get_event_triggers to rx.EventHandler props by @Lendemor in #3458
- fix missing event triggers from docs by @Lendemor in #3495
- upgrade to latest ruff by @Lendemor in #3497
- pass validation of valid_parent if inheriting from valid class by @Lendemor in #3519
- Abstract color_mode related Var creation by @masenf in #3533
- [REF-3149] Bring back py3.12 hot reload warning by @masenf in #3537
- German README.md by @unfortunatelyalex in #3547
New Contributors
- @unfortunatelyalex made their first contribution in #3547
Full Changelog: v0.5.4...v0.5.5
v0.5.4
Improvements
- [REF-2956]Fail When Backend port or frontend port is explicitly provided and the port is in use by @ElijahAhianyo in #3432
- promote toast to main namespace by @Lendemor in #3422
- [REF-2977] [REF-2982] Plotly: Merge layout prop and automatic darkmode by @masenf in #3442
- Recharts supporting radix color, add event triggers by @HongyuHansonYao in #3430
- [REF-3009] type transforming serializers by @benedikt-bartscher in #3227
- default color_mode is now system color by @Lendemor in #3457
- Refactor: make better/less use of dict.keys() calls by @alexandermorgan in #3455
Bug Fixes
- [REF-2602]Do not suppress import errors in rxconfig by @ElijahAhianyo in #3434
- [REF-3006] Inline code rendered in rx.markdown has extra trailing space by @masenf in #3426
- Address an issue with pydantic v2 models as Vars by @kroo in #3396
- state.js: set event_processing = false when websocket connects by @masenf in #3443
- [REF-2879] Make client_state work without global refs (local only) by @masenf in #3379
Other Changes
- PR zh/zh_tw readme update for relex 0.5.2 by @milochen0418 in #3415
- fix: correct zh_tw and zh_cn README for hyperlink issues by @milochen0418 in #3440
- clean up hooks and update component to use add_hooks by @Lendemor in #3439
- fix warning about props by @Lendemor in #3451
- Webdriver ArgOptions improvements by @benedikt-bartscher in #3429
- [bug] Avoid deleting endpoint port when running on Replit by @blast-hardcheese in #3447
- [REF-3013] Only run
pyi_generator
on files in reflex/components or reflex/init.py by @masenf in #3452 - Pass _var_is_string parameter to Var.create by @masenf in #3470
- Override _var_is_string when handling str literals by @masenf in #3473
- compat: do not patch pydantic if the installed version starts with "1." by @masenf in #3482
New Contributors
- @blast-hardcheese made their first contribution in #3447
- @kroo made their first contribution in #3396
- @alexandermorgan made their first contribution in #3455
Full Changelog: v0.5.3...v0.5.4
v0.5.3
New Features
- External assets by @abulvenz in #3220
- add mapping between client_token and socket id by @Lendemor in #3388
- add config knob for react_strict_mode by @Lendemor in #3389
- [REF-2202] Implement event handlers for Plotly by @masenf in #3397
Improvements
- Radix Themes + Tailwind Harmony by @masenf in #3355
- Explicit deps and interval for computed vars by @benedikt-bartscher in #3231
- Add domain prop for the PolarRadiusAxis component by @TG199 in #3349
- [REF-2710]Recommend Running with
REFLEX_USE_NPM=1
if npm run fails after installing packages with bun. by @ElijahAhianyo in #3399 - refactor: radix section default size by @Jishnu-Nandhiath in #3406
- [REF-2978] Ignore Redis config_set for AWS ElastiCache by @masenf in #3401
- [REF-1356] Track changes applied to
Base
subclass via helper method. by @masenf in #2242 - include resize and radius props to the text area component by @carlosabadia in #3383
Each component import is now independently lazy
Save time by avoiding imports for components which are not used in the app.
- [REF-2821]Improve Dynamic Imports by @ElijahAhianyo in #3345
Bug Fixes
- Layout property not pushed through on rx.plotly by @HongyuHansonYao in #3394
Other Changes
- [REF-2895]Benchmarks getting skipped on merge by @ElijahAhianyo in #3369
- Updated in/readme.md with current readme by @sagarhedaoo in #3333
- update image for readme by @tgberkeley in #3395
New Contributors
- @sagarhedaoo made their first contribution in #3333
- @TG199 made their first contribution in #3349
- @HongyuHansonYao made their first contribution in #3394
- @carlosabadia made their first contribution in #3383
Full Changelog: v0.5.2...v0.5.3
v0.5.2
New Features
Lifespan Tasks
A lifespan task is either a coroutine which runs while the backend server is running and is cancelled when the server stops, or it can be an asynccontextmanager
in which case it will run at server startup until yield
is called, then it will resume as the server is shutting down. In either case, the task is started and stopped during hot reload.
Any keyword arguments passed to app.register_lifespan_task
will be passed to the coroutine/contextmanager. If the coroutine takes a parameter called app
, this will be an instance of the underlying FastAPI object.
import asyncio
from contextlib import asynccontextmanager
def fake_answer_to_everything_ml_model(x: float):
return x * 42
ml_models = {}
@asynccontextmanager
async def setup_model(app: FastAPI):
# Load the ML model
ml_models["answer_to_everything"] = fake_answer_to_everything_ml_model
yield
# Clean up the ML models and release the resources
ml_models.clear()
async def long_running_task(foo, bar):
print(f"Starting {foo} {bar} task")
some_api = SomeApi(foo)
try:
while True:
updates = some_api.poll_for_updates()
other_api.push_changes(updates, bar)
await asyncio.sleep(5) # add some polling delay to avoid running too often
except asyncio.CancelledError:
some_api.close() # clean up the API if needed
print("Task was stopped")
app = rx.App()
app.register_lifespan_task(setup_model)
app.register_lifespan_task(long_running_task, foo=42, bar=os.environ["BAR_PARAM"])
Improvements
- Catch more errors in frontend/backend by @picklelo in #3346
- Use twine environment variables if set by @ericwb in #3353
- add style for orientation=vertical in tabs by @Lendemor in #3332
- Added config for number of gunicorn workers by @Snaipergelka in #3351
- feat: Optionally comparing fields in Var.contains, e.g. on rx.Base based types. by @abulvenz in #3375
Bug Fixes
- fix rx.cond with ComputedVars and use union type by @benedikt-bartscher in #3336
- do not check attribute type for var internals by @benedikt-bartscher in #3357
- [REF-2915] ComponentState subclasses are always treated as mixin by @masenf in #3372
- Fix regression when subclassing a ComponentState subclass.
- set config.deploy_url during AppHarness tests by @benedikt-bartscher in #3359
- [REF-2878] Map fontFamily to fontFamily and --default-font-family by @masenf in #3380
- url quote the str data passed to rx.download by @masenf in #3381
Readme Updates
- update README to use 0.5.0 by @Lendemor in #3313
- #3321: Update Chinese README.md by @seewindcn in #3350
- Update Spanish README.md by @boterop in #3330
- Update Korean README.md by @owlur in #3337
Other Changes
- Add some minimal validation of pyproject.toml by @ericwb in #3339
- Suppress runtime warnings by @picklelo in #3354
New Contributors
Full Changelog: https://github.com/reflex-dev/reflex/compare/v0.5.1..v0.5.2
v0.5.1
New Features
- Connection Error modal is now a dismissable toast by @Lendemor in #3242
- rx._x.client_state: react useState Var integration for frontend and backend by @masenf in #3269
- Work in progress, API subject to change
- Support replacing route on redirect by @masenf in #3072
Improvements
- rx.accordion customizability overhaul by @masenf in #3266
- #3185 fix tailwind.config.js: support corePlugins, important, prefix,… by @seewindcn in #3260
- FIX - Error: img is a self-closing tag and must neither have children nor use dangerouslySetInnerHTML. by @Yummy-Yums in #3307
- Get
action
,cancel
,on_dismiss
andon_auto_close
working for rx._x.toast by @masenf in #3216 - typed mixins and ComponentState by @benedikt-bartscher in #3196
- [REF-2787] add_hooks supports Var-wrapped hooks by @masenf in #3248
- Add end line in .gitignore when
reflex init
by @boterop in #3309 - allow passing kwargs and options to selenium webdriver by @benedikt-bartscher in #2894
Bugfixes
- Only import PyiGenerator when needed by @masenf in #3291
- Typo in contact email address by @ericwb in #3292
- properly replace ComputedVars by @benedikt-bartscher in #3254
- throw error for componentstate in foreach by @Lendemor in #3243
Dependencies
- Bump Bun version by @ElijahAhianyo in #3281
Other Changes
- [REF-2776] enable telemetry for frontend package download subprocess by @martinxu9 in #3270
- [REF-2774] Add ReflexError and subclasses, send in telemetry by @martinxu9 in #3271
- [REF-2774] Send runtime error in telemetry by @martinxu9 in #3276
- Automatically label bug report issues with bug tag by @ericwb in #3288
- [REF-2803]Add imports benchmarks by @ElijahAhianyo in #3272
- Mirgrate from pip to uv by @ericwb in #3285
- Adds dependency review action to verify allowed licensed dependencies by @ericwb in #3306
New Contributors
- @seewindcn made their first contribution in #3260
- @ericwb made their first contribution in #3288
- @boterop made their first contribution in #3309
Full Changelog: v0.5.0.post1...v0.5.1
v0.5.0.post1
Escape Hatch to avoid Bun on Windows
These exceptions only apply to Windows native platform (not WSL)
- [REF-2814]Throw Warning for Projects Created in OneDrive on Windows (#3304)
- Skip bun when project path contains "onedrive"
- Skip bun when
REFLEX_USE_NPM=1
(environment variable)
Full Changelog: v0.5.0...v0.5.0.post1