diff --git a/CHANGELOG.md b/CHANGELOG.md index 9f420751589..db90cffbe7e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,25 @@ +## v0.9.7 (2026-07-15) + +### Features + +- Added `default_color_mode` to `rx.Config` (`"system"`, `"light"`, or `"dark"`, also settable via `REFLEX_DEFAULT_COLOR_MODE`), so apps can 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. The value drives both the compiled `ThemeProvider` default and the pre-hydration preload script, so there is no flash of the wrong theme on first paint. An explicit `rx.theme(appearance=...)` still takes precedence. ([#6716](https://github.com/reflex-dev/reflex/issues/6716)) +- `@rx.memo` components now compile with a configurable JS wrapper: React's `memo` remains the default, `wrapper=` swaps in a custom function `Var` whose imports ride along into the generated module, and `wrapper=None` emits the bare function component. ([#6730](https://github.com/reflex-dev/reflex/issues/6730)) +- The new `frozen_lockfile` config option is now honored during frontend package installation: when enabled (the default), bun's initial install runs with `--frozen-lockfile` so a lockfile out of sync with `package.json` fails fast. Set `frozen_lockfile=False` to let the lockfile update in place instead. npm has no equivalent install flag today, so the option is a no-op there. ([#6763](https://github.com/reflex-dev/reflex/issues/6763)) + +### Bug Fixes + +- Fix stateful pages being evaluated twice in one process (forked prod workers and same-process export+serve), which created duplicate `ComponentState` classes and broke frontend hydration (`TypeError: d is not a function`). ([#6710](https://github.com/reflex-dev/reflex/issues/6710)) +- Reset the disk state manager write queue task after close. ([#6715](https://github.com/reflex-dev/reflex/issues/6715)) +- Close the `RedisTokenManager` redis client and cancel its pub/sub background tasks on app shutdown, fixing leaked redis connections (`ResourceWarning: unclosed Connection`) when the server stops. ([#6724](https://github.com/reflex-dev/reflex/issues/6724)) +- Event handlers and computed vars inherited from a state mixin now preserve the source function's custom attributes and keyword-only defaults. ([#6725](https://github.com/reflex-dev/reflex/issues/6725)) + +### Performance + +- Run anonymous telemetry collection and delivery on a dedicated single-worker background thread instead of inline on the asyncio event loop. The blocking syscalls, subprocess calls and synchronous HTTP request used to gather and post an event no longer stall the event loop — notably when reporting backend errors at a high rate. Delivery is best-effort and any failure is suppressed, so telemetry can never affect the running app. ([#6626](https://github.com/reflex-dev/reflex/issues/6626)) +- Event chaining (`yield OtherState.handler(rows)`) no longer deep-copies payload values that are not attached to any state: only state-bound `MutableProxy` subtrees are copied, making proxy-free payloads ~5x faster to chain. ([#6739](https://github.com/reflex-dev/reflex/issues/6739)) +- `Var.to()` and `Var.guess_type()` resolve their target Var subclass through cached registry lookups instead of scanning the full registry with `safe_issubclass` on every call. ([#6742](https://github.com/reflex-dev/reflex/issues/6742)) + + ## v0.9.6 (2026-06-25) ### Features diff --git a/news/6626.performance.md b/news/6626.performance.md deleted file mode 100644 index 978fd041b4d..00000000000 --- a/news/6626.performance.md +++ /dev/null @@ -1 +0,0 @@ -Run anonymous telemetry collection and delivery on a dedicated single-worker background thread instead of inline on the asyncio event loop. The blocking syscalls, subprocess calls and synchronous HTTP request used to gather and post an event no longer stall the event loop — notably when reporting backend errors at a high rate. Delivery is best-effort and any failure is suppressed, so telemetry can never affect the running app. diff --git a/news/6710.bugfix.md b/news/6710.bugfix.md deleted file mode 100644 index f1c61067bac..00000000000 --- a/news/6710.bugfix.md +++ /dev/null @@ -1 +0,0 @@ -Fix stateful pages being evaluated twice in one process (forked prod workers and same-process export+serve), which created duplicate `ComponentState` classes and broke frontend hydration (`TypeError: d is not a function`). diff --git a/news/6715.bugfix.md b/news/6715.bugfix.md deleted file mode 100644 index 37683f71888..00000000000 --- a/news/6715.bugfix.md +++ /dev/null @@ -1 +0,0 @@ -Reset the disk state manager write queue task after close. diff --git a/news/6716.feature.md b/news/6716.feature.md deleted file mode 100644 index dae6f5ebcdb..00000000000 --- a/news/6716.feature.md +++ /dev/null @@ -1 +0,0 @@ -Added `default_color_mode` to `rx.Config` (`"system"`, `"light"`, or `"dark"`, also settable via `REFLEX_DEFAULT_COLOR_MODE`), so apps can 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. The value drives both the compiled `ThemeProvider` default and the pre-hydration preload script, so there is no flash of the wrong theme on first paint. An explicit `rx.theme(appearance=...)` still takes precedence. diff --git a/news/6724.bugfix.md b/news/6724.bugfix.md deleted file mode 100644 index d3500e72256..00000000000 --- a/news/6724.bugfix.md +++ /dev/null @@ -1 +0,0 @@ -Close the `RedisTokenManager` redis client and cancel its pub/sub background tasks on app shutdown, fixing leaked redis connections (`ResourceWarning: unclosed Connection`) when the server stops. diff --git a/news/6725.bugfix.md b/news/6725.bugfix.md deleted file mode 100644 index 68441f4ae38..00000000000 --- a/news/6725.bugfix.md +++ /dev/null @@ -1 +0,0 @@ -Event handlers and computed vars inherited from a state mixin now preserve the source function's custom attributes and keyword-only defaults. diff --git a/news/6730.feature.md b/news/6730.feature.md deleted file mode 100644 index 1c037614d4e..00000000000 --- a/news/6730.feature.md +++ /dev/null @@ -1 +0,0 @@ -`@rx.memo` components now compile with a configurable JS wrapper: React's `memo` remains the default, `wrapper=` swaps in a custom function `Var` whose imports ride along into the generated module, and `wrapper=None` emits the bare function component. diff --git a/news/6739.performance.md b/news/6739.performance.md deleted file mode 100644 index dbc358c13cb..00000000000 --- a/news/6739.performance.md +++ /dev/null @@ -1 +0,0 @@ -Event chaining (`yield OtherState.handler(rows)`) no longer deep-copies payload values that are not attached to any state: only state-bound `MutableProxy` subtrees are copied, making proxy-free payloads ~5x faster to chain. diff --git a/news/6742.performance.md b/news/6742.performance.md deleted file mode 100644 index 9bd09c9be2e..00000000000 --- a/news/6742.performance.md +++ /dev/null @@ -1 +0,0 @@ -`Var.to()` and `Var.guess_type()` resolve their target Var subclass through cached registry lookups instead of scanning the full registry with `safe_issubclass` on every call. diff --git a/news/6763.feature.md b/news/6763.feature.md deleted file mode 100644 index 372ffed449c..00000000000 --- a/news/6763.feature.md +++ /dev/null @@ -1 +0,0 @@ -The new `frozen_lockfile` config option is now honored during frontend package installation: when enabled (the default), bun's initial install runs with `--frozen-lockfile` so a lockfile out of sync with `package.json` fails fast. Set `frozen_lockfile=False` to let the lockfile update in place instead. npm has no equivalent install flag today, so the option is a no-op there. diff --git a/packages/reflex-base/CHANGELOG.md b/packages/reflex-base/CHANGELOG.md index d161c2234ba..a6a2d91e47f 100644 --- a/packages/reflex-base/CHANGELOG.md +++ b/packages/reflex-base/CHANGELOG.md @@ -1,3 +1,28 @@ +## v0.9.7 (2026-07-15) + +### Deprecations + +- `ArrayVar.foreach` is deprecated; use `ArrayVar.map` instead. ([#6701](https://github.com/reflex-dev/reflex/issues/6701)) + +### Features + +- `ArrayVar` gained `map`, `filter`, `reduce`, and `flat_map` operations, and `StringVar.strip` now accepts a `chars` argument alongside new `lstrip`/`rstrip` methods. ([#6701](https://github.com/reflex-dev/reflex/issues/6701)) +- Added `default_color_mode` to `rx.Config` (`"system"`, `"light"`, or `"dark"`, also settable via `REFLEX_DEFAULT_COLOR_MODE`) and moved the shared `LiteralColorMode` type and color-mode string constants into `reflex_base.constants`. This lets apps set the initial color mode without depending on the Radix themes appearance prop. ([#6716](https://github.com/reflex-dev/reflex/issues/6716)) +- `@rx.memo` now accepts a `wrapper=` argument controlling the JS function that wraps the compiled component definition: keep the default React `memo`, pass a custom function `Var` (e.g. an `rx.vars.FunctionStringVar` carrying its own imports), or pass `wrapper=None` to export the bare function component. ([#6730](https://github.com/reflex-dev/reflex/issues/6730)) +- Added `frozen_lockfile` to `rx.Config` (default `True`, also settable via `REFLEX_FROZEN_LOCKFILE`), controlling whether the frontend package manager runs in lockfile-enforcing mode. Reflex still creates, manages, and syncs the lockfile regardless; the option only controls whether a lockfile/`package.json` mismatch is treated as an error. ([#6763](https://github.com/reflex-dev/reflex/issues/6763)) + +### Bug Fixes + +- Custom attributes set on a `Field` are now preserved (deep-copied) when the state metaclass rebuilds fields, instead of being silently discarded. The reserved `annotation` attribute is never carried over so rebuilt fields are not misidentified as pydantic fields. ([#6726](https://github.com/reflex-dev/reflex/issues/6726)) +- Fix `_get_all_hooks_internal` mutating each component's cached internal hooks with its descendants' hooks, which made memo tag hashes order-dependent and duplicated hooks into memo bodies. ([#6741](https://github.com/reflex-dev/reflex/issues/6741)) + +### Performance + +- Cache framework-path checks in `console.deprecate`'s call-stack walk, making repeat calls ~150x faster (deprecated attributes on hot paths, like `RouterData.page`, no longer cost multiple milliseconds per access). ([#6736](https://github.com/reflex-dev/reflex/issues/6736)) +- Event chaining (`yield OtherState.handler(rows)`) no longer deep-copies payload values that are not attached to any state: only state-bound `MutableProxy` subtrees are copied, making proxy-free payloads ~5x faster to chain. ([#6739](https://github.com/reflex-dev/reflex/issues/6739)) +- `Var.to()` and `Var.guess_type()` resolve their target Var subclass through 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](https://github.com/reflex-dev/reflex/issues/6742)) + + ## v0.9.6.post1 (2026-06-26) ### Features diff --git a/packages/reflex-base/news/6701.deprecation.md b/packages/reflex-base/news/6701.deprecation.md deleted file mode 100644 index 3e58567df83..00000000000 --- a/packages/reflex-base/news/6701.deprecation.md +++ /dev/null @@ -1 +0,0 @@ -`ArrayVar.foreach` is deprecated; use `ArrayVar.map` instead. diff --git a/packages/reflex-base/news/6701.feature.md b/packages/reflex-base/news/6701.feature.md deleted file mode 100644 index cb747ab52eb..00000000000 --- a/packages/reflex-base/news/6701.feature.md +++ /dev/null @@ -1 +0,0 @@ -`ArrayVar` gained `map`, `filter`, `reduce`, and `flat_map` operations, and `StringVar.strip` now accepts a `chars` argument alongside new `lstrip`/`rstrip` methods. diff --git a/packages/reflex-base/news/6716.feature.md b/packages/reflex-base/news/6716.feature.md deleted file mode 100644 index d2873616344..00000000000 --- a/packages/reflex-base/news/6716.feature.md +++ /dev/null @@ -1 +0,0 @@ -Added `default_color_mode` to `rx.Config` (`"system"`, `"light"`, or `"dark"`, also settable via `REFLEX_DEFAULT_COLOR_MODE`) and moved the shared `LiteralColorMode` type and color-mode string constants into `reflex_base.constants`. This lets apps set the initial color mode without depending on the Radix themes appearance prop. diff --git a/packages/reflex-base/news/6726.bugfix.md b/packages/reflex-base/news/6726.bugfix.md deleted file mode 100644 index 543eb00db10..00000000000 --- a/packages/reflex-base/news/6726.bugfix.md +++ /dev/null @@ -1 +0,0 @@ -Custom attributes set on a `Field` are now preserved (deep-copied) when the state metaclass rebuilds fields, instead of being silently discarded. The reserved `annotation` attribute is never carried over so rebuilt fields are not misidentified as pydantic fields. diff --git a/packages/reflex-base/news/6730.feature.md b/packages/reflex-base/news/6730.feature.md deleted file mode 100644 index 7633597fc10..00000000000 --- a/packages/reflex-base/news/6730.feature.md +++ /dev/null @@ -1 +0,0 @@ -`@rx.memo` now accepts a `wrapper=` argument controlling the JS function that wraps the compiled component definition: keep the default React `memo`, pass a custom function `Var` (e.g. an `rx.vars.FunctionStringVar` carrying its own imports), or pass `wrapper=None` to export the bare function component. diff --git a/packages/reflex-base/news/6736.performance.md b/packages/reflex-base/news/6736.performance.md deleted file mode 100644 index ff80caf8553..00000000000 --- a/packages/reflex-base/news/6736.performance.md +++ /dev/null @@ -1 +0,0 @@ -Cache framework-path checks in `console.deprecate`'s call-stack walk, making repeat calls ~150x faster (deprecated attributes on hot paths, like `RouterData.page`, no longer cost multiple milliseconds per access). diff --git a/packages/reflex-base/news/6739.performance.md b/packages/reflex-base/news/6739.performance.md deleted file mode 100644 index dbc358c13cb..00000000000 --- a/packages/reflex-base/news/6739.performance.md +++ /dev/null @@ -1 +0,0 @@ -Event chaining (`yield OtherState.handler(rows)`) no longer deep-copies payload values that are not attached to any state: only state-bound `MutableProxy` subtrees are copied, making proxy-free payloads ~5x faster to chain. diff --git a/packages/reflex-base/news/6741.bugfix.md b/packages/reflex-base/news/6741.bugfix.md deleted file mode 100644 index 44d9e398f9a..00000000000 --- a/packages/reflex-base/news/6741.bugfix.md +++ /dev/null @@ -1 +0,0 @@ -Fix `_get_all_hooks_internal` mutating each component's cached internal hooks with its descendants' hooks, which made memo tag hashes order-dependent and duplicated hooks into memo bodies. diff --git a/packages/reflex-base/news/6742.performance.md b/packages/reflex-base/news/6742.performance.md deleted file mode 100644 index 04e1bc18b3d..00000000000 --- a/packages/reflex-base/news/6742.performance.md +++ /dev/null @@ -1 +0,0 @@ -`Var.to()` and `Var.guess_type()` resolve their target Var subclass through cached registry lookups instead of scanning the full registry with `safe_issubclass` on every call (~70% of the cost of constructing a var operation). diff --git a/packages/reflex-base/news/6763.feature.md b/packages/reflex-base/news/6763.feature.md deleted file mode 100644 index 5b3d779df15..00000000000 --- a/packages/reflex-base/news/6763.feature.md +++ /dev/null @@ -1 +0,0 @@ -Added `frozen_lockfile` to `rx.Config` (default `True`, also settable via `REFLEX_FROZEN_LOCKFILE`), controlling whether the frontend package manager runs in lockfile-enforcing mode. Reflex still creates, manages, and syncs the lockfile regardless; the option only controls whether a lockfile/`package.json` mismatch is treated as an error. diff --git a/packages/reflex-components-core/CHANGELOG.md b/packages/reflex-components-core/CHANGELOG.md index 1529667c50b..cbdcc6ce4ab 100644 --- a/packages/reflex-components-core/CHANGELOG.md +++ b/packages/reflex-components-core/CHANGELOG.md @@ -1,3 +1,10 @@ +## v0.9.7 (2026-07-15) + +### Miscellaneous + +- `rx.upload` internals use `ArrayVar.map` instead of the deprecated `foreach`. ([#6701](https://github.com/reflex-dev/reflex/issues/6701)) + + ## v0.9.6 (2026-06-25) ### Bug Fixes diff --git a/packages/reflex-components-core/news/6701.misc.md b/packages/reflex-components-core/news/6701.misc.md deleted file mode 100644 index 9d7126b9af4..00000000000 --- a/packages/reflex-components-core/news/6701.misc.md +++ /dev/null @@ -1 +0,0 @@ -`rx.upload` internals use `ArrayVar.map` instead of the deprecated `foreach`. diff --git a/packages/reflex-components-radix/CHANGELOG.md b/packages/reflex-components-radix/CHANGELOG.md index 84fda97429b..f547d66cfe6 100644 --- a/packages/reflex-components-radix/CHANGELOG.md +++ b/packages/reflex-components-radix/CHANGELOG.md @@ -1,3 +1,10 @@ +## v0.9.6 (2026-07-15) + +### Miscellaneous + +- `rx.segmented_control` internals use `ArrayVar.map` instead of the deprecated `foreach`. ([#6701](https://github.com/reflex-dev/reflex/issues/6701)) + + ## v0.9.5 (2026-06-10) ### Miscellaneous diff --git a/packages/reflex-components-radix/news/6701.misc.md b/packages/reflex-components-radix/news/6701.misc.md deleted file mode 100644 index 64d13fb11eb..00000000000 --- a/packages/reflex-components-radix/news/6701.misc.md +++ /dev/null @@ -1 +0,0 @@ -`rx.segmented_control` internals use `ArrayVar.map` instead of the deprecated `foreach`. diff --git a/packages/reflex-docgen/CHANGELOG.md b/packages/reflex-docgen/CHANGELOG.md index 9d2cf88e357..7d3801e2be0 100644 --- a/packages/reflex-docgen/CHANGELOG.md +++ b/packages/reflex-docgen/CHANGELOG.md @@ -1,3 +1,10 @@ +## v0.9.3 (2026-07-15) + +### Bug Fixes + +- Fixed `meta_description` and `description` frontmatter keys being misinterpreted as component preview lambdas. ([#6704](https://github.com/reflex-dev/reflex/issues/6704)) + + ## v0.9.2 (2026-06-03) No significant changes. diff --git a/packages/reflex-docgen/news/6704.bugfix.md b/packages/reflex-docgen/news/6704.bugfix.md deleted file mode 100644 index d458c6caa7b..00000000000 --- a/packages/reflex-docgen/news/6704.bugfix.md +++ /dev/null @@ -1 +0,0 @@ -Fixed `meta_description` and `description` frontmatter keys being misinterpreted as component preview lambdas.