v0.3.5
Known Issues
Using rx.el.*
namespace tags with State vars is not currently working (#2264)
Breaking Changes
Component._get_app_wrap_components
is now astaticmethod
for performance reasons.
Deprecations
Deprecated features will not be removed until reflex-0.4.0.
- Deprecate event namespace config knob by @ElijahAhianyo in #2218
- update removal version of deprecated features by @Lendemor in #2224
- deprecate state arg in App() by @Lendemor in #2237
Improvements
Performance
This release includes numerous performance improvements during both compile phase and at runtime.
Backend
- [REF-1035] Track ComputedVar dependency per class by @masenf in #2067
- Reduce memory and deserialization time for every app user.
- [REF-201] Separate on_load handler from initial hydration by @masenf in #1847
- Avoid expensive hydration of entire state when navigating between pages (with @ElijahAhianyo)
Frontend
Each substate in an app can now be accessed independently. Components which depend on any state are automatically pulled out of the main page component and defined within separate "memoized" components that only update when the substates they directly depend upon have changed.
This improves re-render time on some reflex-web
pages by 20x 🚀
- [REF-889] useContext per substate by @masenf in #2149
- [REF-144] Add context in each component to prevent rerenders by @masenf in #2198
- Memoize markdown component_map by @masenf in #2219
- Support hooks in custom components (state, addEvents) by @masenf in #2234
- [reflex-web tweaks] Do not memoize children of InputGroup by @masenf in #2230
- [REF-1349] RechartsCharts and ResponsiveContainer must be memo leaf by @masenf in #2240
- Generalize MemoizationLeaf Component mixin (and apply to Cond and NextHead) by @masenf in #2247
- [REF-1352] Markdown component_map hash improvements by @masenf in #2241
Compiler
- _valid_children and _invalid_children accessible from class by @Lendemor in #2192
- Speed up reflex CLI imports by @picklelo in #2185
- Use singleton app provider to speed up compiles by @picklelo in #2172
Allow Multiple Subclasses of rx.State
Any module can now create substates without importing from a base state defined in the App.
Third-party components may define and use their own substates.
(Note: Working event handlers for substates defined within nested functions are still TODO.)
- REF-1052/rx.State as Base State by @ElijahAhianyo in #2146
Improved Basic HTML Elements
The rx.el
namespace provides access to basic HTML tags, such as a
, div
, and p
, which can be used to build the frontend instead of using Chakra components. This can be useful when styling the app via tailwind.
As Reflex moves to using radix-ui
components, this cleans up the API because many radix components directly inherit from basic HTML elements.
- HTML Refactor by @Alek99 in #2164
- [REF-1158] Move chakra-only deps to chakra lib by @masenf in #2171
Allow PIL images to be serialized in alternate formats
Setting the image.format
attribute on a PIL Image.Image
object controls what format the image is serialized as when sending to the frontend via data URI.
Add/Subtract time delta with rx.moment
Dependency Bumps
- pyproject.toml: upgrade httpx to 0.25.0 by @arnomoonens in #2013
- Upgrade to bun 1.0.13 by @picklelo in #2202
- REF-1202: Upgrade bun version if it differs from reflex set version by @ElijahAhianyo in #2206
Other Improvements
Bugfixes
Fix _hover
, _focus
and other leading underscore props
- Fix Prop conversion to camel case by @ElijahAhianyo in #2205
Others
- fix name for import var when is default and add tests by @Lendemor in #2214
- code_block responds to color mode by default by @masenf in #2228
Data Editor
- fix offset of data_editor input when page is scrolled by @Lendemor in #2208
- update column select literals by @tgberkeley in #2150
Internal
- check_generated_pyi: fix diff checking by @masenf in #2029
- keep app id (project hash) the same even after re-init by @tgberkeley in #2195
- Fix pyright errors by @picklelo in #2210
- Separate out the hosting CLI from main repo by @martinxu9 in #2165
- fix: fixes the command used for cloning the repo by @ankur0904 in #2159
New Contributors
- @arnomoonens made their first contribution in #2013
- @ankur0904 made their first contribution in #2159
Full Changelog: v0.3.4...v0.3.5