reflex v0.9.7 ships alongside reflex-base 0.9.7, reflex-components-core 0.9.7, reflex-components-radix 0.9.6, and reflex-docgen 0.9.3.
Features
ArrayVargainedmap,filter,reduce, andflat_mapfor transforming array vars directly on the frontend. (#6701)rx.Configgaineddefault_color_mode("system","light", or"dark", also settable viaREFLEX_DEFAULT_COLOR_MODE), letting apps set the initial color mode — and use the built-in color-mode switcher andrx.color_mode_cond— without pulling in the large Radix themes CSS. It drives both the compiledThemeProviderdefault and the pre-hydration preload script, so there's no flash of the wrong theme on first paint; an explicitrx.theme(appearance=...)still takes precedence. (#6716)rx.Configgainedfrozen_lockfile(defaultTrue, also settable viaREFLEX_FROZEN_LOCKFILE). When enabled, bun's initial install runs with--frozen-lockfileso a lockfile out of sync withpackage.jsonfails fast; set it toFalseto let the lockfile update in place. (npm has no equivalent install flag, so it's a no-op there.) (#6763)@rx.memoaccepts awrapper=argument controlling the JS function that wraps the compiled component: React'smemo(the default), a custom functionVarwhose imports ride along into the generated module, orwrapper=Noneto emit the bare function component. (#6730)
Bug Fixes
- Fixed stateful pages being evaluated twice in one process (forked production workers, and same-process export+serve), which created duplicate
ComponentStateclasses and broke frontend hydration (TypeError: d is not a function). (#6710) - Custom attributes are now preserved in more places — on a
Fieldwhen the state metaclass rebuilds it (#6726), and on event handlers and computed vars inherited from a state mixin, along with their keyword-only defaults (#6725). RedisTokenManagernow closes its redis client and cancels its pub/sub tasks on shutdown, fixing leaked redis connections (ResourceWarning: unclosed Connection) when the server stops. (#6724)- Fixed
_get_all_hooks_internalmutating each component's cached hooks with its descendants' hooks, which made memo tag hashes order-dependent and duplicated hooks into memo bodies. (#6741) - The disk state manager resets its write-queue task after close. (#6715)
reflex-docgenno longer misinterpretsmeta_description/descriptionfrontmatter keys as component preview lambdas. (#6704)
Performance
- Telemetry now runs on a dedicated background thread instead of inline on the asyncio event loop, so its blocking syscalls, subprocess calls, and synchronous HTTP request no longer stall the loop — notably when reporting backend errors at a high rate. Delivery is best-effort and failures are suppressed, so telemetry can never affect the running app. (#6626)
- Event chaining (
yield OtherState.handler(rows)) no longer deep-copies payload values that aren't attached to any state — only state-boundMutableProxysubtrees are copied, making proxy-free payloads ~5x faster to chain. (#6739) Var.to()andVar.guess_type()use cached registry lookups instead of scanning the full registry withsafe_issubclasson every call (~70% of the cost of constructing a var operation). (#6742)console.deprecatecaches framework-path checks in its call-stack walk, making repeat calls ~150x faster — deprecated attributes on hot paths (likeRouterData.page) no longer cost milliseconds per access. (#6736)
Deprecations
ArrayVar.foreachis deprecated in favor ofArrayVar.map. (#6701)
Full Changelog: v0.9.6...v0.9.7