Skip to content

v0.9.7

Latest

Choose a tag to compare

@github-actions github-actions released this 15 Jul 23:41
127e4d8

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

  • ArrayVar gained map, filter, reduce, and flat_map for transforming array vars directly on the frontend. (#6701)
  • rx.Config gained default_color_mode ("system", "light", or "dark", also settable via REFLEX_DEFAULT_COLOR_MODE), letting apps set the initial color mode — and use the built-in color-mode switcher and rx.color_mode_cond — without pulling in the large Radix themes CSS. It drives both the compiled ThemeProvider default and the pre-hydration preload script, so there's no flash of the wrong theme on first paint; an explicit rx.theme(appearance=...) still takes precedence. (#6716)
  • rx.Config gained frozen_lockfile (default True, also settable via REFLEX_FROZEN_LOCKFILE). When enabled, bun's initial install runs with --frozen-lockfile so a lockfile out of sync with package.json fails fast; set it to False to let the lockfile update in place. (npm has no equivalent install flag, so it's a no-op there.) (#6763)
  • @rx.memo accepts a wrapper= argument controlling the JS function that wraps the compiled component: React's memo (the default), a custom function Var whose imports ride along into the generated module, or wrapper=None to 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 ComponentState classes and broke frontend hydration (TypeError: d is not a function). (#6710)
  • Custom attributes are now preserved in more places — on a Field when 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).
  • RedisTokenManager now 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_internal mutating 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-docgen no longer misinterprets meta_description/description frontmatter 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-bound MutableProxy subtrees are copied, making proxy-free payloads ~5x faster to chain. (#6739)
  • Var.to() and Var.guess_type() use cached registry lookups instead of scanning the full registry with safe_issubclass on every call (~70% of the cost of constructing a var operation). (#6742)
  • console.deprecate caches framework-path checks in its call-stack walk, making repeat calls ~150x faster — deprecated attributes on hot paths (like RouterData.page) no longer cost milliseconds per access. (#6736)

Deprecations

  • ArrayVar.foreach is deprecated in favor of ArrayVar.map. (#6701)

Full Changelog: v0.9.6...v0.9.7