v0.6.3
New Features
Correct handling of aria
and data
props
Any props passed to a component with aria_
or data_
prefix will be applied directly to the component (previously, these were misinterpreted as style props).
Reflex Code
rx.icon_button("save", aria_label="Save Changes", data_test="arbitrary data")
Generated Output
<button ... aria-label="Save Changes" data-test="arbitrary data"><svg>...</svg></button>
Improvements
Static typing of events and vars
New (optional) rx.Field
, rx.field
and @rx.event
decorators allow pyright and other static type checkers to better understand how event handlers and state vars are handled in reflex, allowing most static type checking to pass without # type: ignore
comments.
import reflex as rx
class MyState(rx.State):
v: rx.Field[int] = rx.field(42)
@rx.event
def set_v(self, v: str):
try:
self.v = int(v)
except ValueError:
pass
def index() -> rx.Component:
return rx.vstack(
rx.heading(MyState.v),
rx.input(
value=MyState.v,
on_change=MyState.set_v,
type="number",
),
)
app = rx.App()
app.add_page(index)
- [ENG-3749] type safe vars by @adhami3310 in #4066
- add type hinting to events by @adhami3310 in #4145
Other Improvements
- Optimize StateManagerDisk by @masenf in #4056
- Reduce pickle size by @masenf in #4063
- fail safely when pickling by @adhami3310 in #4085
- First use environment variable as npm registry by @ruhz3 in #4082
- let users pick state manager mode by @Lendemor in #4041
- Allow setting a different invocation function for EventChain by @masenf in #4160
Bug Fixes
- convert literal type to its variants by @adhami3310 in #4062
- catch CancelledError in lifespan hack for windows by @Lendemor in #4083
- Get default for backend var defined in mixin by @masenf in #4060
- [ENG-3903] bundle next link in window by @adhami3310 in #4064
- misc var improvements by @adhami3310 in #4068
- [ENG-2287] Avoid fetching same state from redis multiple times by @masenf in #4055
- reset backend vars in state.reset() by @adhami3310 in #4087
- fix custom component init by @Lendemor in #4123
- use system npm when REFLEX_USE_SYSTEM_NODE is passed by @adhami3310 in #4133
- Remove wrong event handlers by @adhami3310 in #4136
- fix: Determine str type from value. by @abulvenz in #4143
- remove dictify from state dict by @adhami3310 in #4141
- catch ValueError("I/O operation on closed file.") if frontend crashes by @benedikt-bartscher in #4150
- fix union types for vars by @adhami3310 in #4152
- Change bun link by @adhami3310 in #4162
- change bun install link to main by @adhami3310 in #4164
- only load json if it's not empty by @adhami3310 in #4165
- Handle rx.State subclasses defined in function by @masenf in #4129
- Do not auto-determine generic args if already supplied by @benedikt-bartscher in #4148
- unionize base var fields types by @adhami3310 in #4153
- [ENG-3954] Treat ArrayVar.foreach index as int (#4193)
- LiteralEventChainVar becomes an ArgsFunctionOperation (#4174)
- only treat dict object vars as key value mapping (#4177)
Version Bumps
- add workflow to check dependencies on release branch by @Lendemor in #4050
- upgrade default node to current lts by @adhami3310 in #4086
- update ruff to latest version by @Lendemor in #4081
- Revert Markdown-related frontend dep bumps by @masenf in #4088
- pin AppHarness tests to ubuntu-22.04 runner (#4173)
Documentation
- default props comment for CartesianAxis by @carlosabadia in #4127
- default props comment for CartesianGrid by @carlosabadia in #4126
- default props comment for ReferenceLine by @carlosabadia in #4122
- default props comment for ReferenceArea by @carlosabadia in #4124
- default props comment for Scatter by @carlosabadia in #4118
- default props comment for Area by @carlosabadia in #4115
- default props comment for Line by @carlosabadia in #4117
- default props comment for Bar by @carlosabadia in #4116
- default props comment for Brush by @carlosabadia in #4113
- default props comment for ZAxis by @carlosabadia in #4112
- default props comment for YAxis by @carlosabadia in #4111
- default props comment for XAxis by @carlosabadia in #4110
- default props comment for Legend by @carlosabadia in #4100
- default props comment for PolarAngleAxis by @carlosabadia in #4106
- default props comment for LabelList by @carlosabadia in #4102
- default props comment for treemap by @carlosabadia in #4098
- default props comment for ResponsiveContainer by @carlosabadia in #4099
- default props comment for scatterchart by @carlosabadia in #4096
- default props comment for radarchart by @carlosabadia in #4094
- default props comment for radialbarchart by @carlosabadia in #4095
- default props comment for barchart by @carlosabadia in #4092
- default props comment for composedchart by @carlosabadia in #4093
- areachart default value for base_value by @carlosabadia in #4090
- default props comment for categoricalchartbase by @carlosabadia in #4091
- default props comment for PolarGrid by @carlosabadia in #4107
- default props comment for Reference by @carlosabadia in #4121
- default props comment for funnelchart by @carlosabadia in #4097
- default props comment for Radar by @carlosabadia in #4104
- Add Vietnamese README docs by @nguyenmphu in #4138
- fix docstring by @benedikt-bartscher in #4140
- default props comment for Grid by @carlosabadia in #4125
- default props comment for Funnel by @carlosabadia in #4119
- default props comment for ErrorBar by @carlosabadia in #4120
- default props comment for Cartesian by @carlosabadia in #4114
- default props comment for RadialBar by @carlosabadia in #4105
- default props comment for PolarRadiusAxis by @carlosabadia in #4108
- default props comment for Pie by @carlosabadia in #4103
- default props comment for Axis by @carlosabadia in #4109
Other Changes
- test_dynamic_routes: log on_loads and poll for 60 seconds on order by @masenf in #4089
- only run macOS job on merge by @Lendemor in #4139
- Change the defalut direction of radio group by @Manojvbhat in #4146
New Contributors
- @nguyenmphu made their first contribution in #4138
- @ruhz3 made their first contribution in #4082
- @Manojvbhat made their first contribution in #4146
Full Changelog: v0.6.2...v0.6.3