> For AI agents: the complete documentation index is at [llms.txt](https://reflex.dev/docs/llms.txt). For a Markdown version, remove the trailing slash from the page URL and append `.md`. The docs home is available at [index.md](/docs/index.md).

## v0.11.0 (2026-11-11)

### Breaking Changes

- Reading a plain `@property` of a Pydantic model or dataclass through a state Var now raises `VarAttributeError` at compile time. The default serializer does not send such a property, so the Var always rendered empty. Use `@pydantic.computed_field`, or register an `rx.serializer` that includes the value. ([#7648](https://github.com/reflex-dev/reflex/issues/7648))

### Features

- Serialize SQLAlchemy `DeclarativeBase` models without a custom `@rx.serializer`: loaded columns and relationships are sent, and unloaded or expired attributes are left out instead of raising `DetachedInstanceError` or `MissingGreenlet`. ([#7756](https://github.com/reflex-dev/reflex/issues/7756))
- On a state schema mismatch, a production page now dispatches a cancelable `reflex:state-mismatch` event on `window` before it reloads or shows the "new version available" banner. A listener that calls `event.preventDefault()` skips both, so the app decides when to reload; `event.detail` carries the `frontend` and `backend` state schema hashes. ([#7653](https://github.com/reflex-dev/reflex/issues/7653))
- With OpenTelemetry tracing enabled, JSON log records (`REFLEX_LOG_JSON=true`) emitted inside a span now include its `trace_id` and `span_id`, so logs can be correlated with traces. ([#7668](https://github.com/reflex-dev/reflex/issues/7668))

### Bug Fixes

- Use the browser's current route when building the websocket connection's initial hydration event, so navigation during connection setup cannot run the previous page's `on_load` handler or redirect. ([#7522](https://github.com/reflex-dev/reflex/issues/7522))
- Fix uploads triggered by toast actions or `rx.call_script` callbacks failing with `ReferenceError: filesById is not defined`. Such uploads now send the files selected when they run, not when the toast opened. ([#7409](https://github.com/reflex-dev/reflex/issues/7409))
- Fix state updates streamed back during an upload being applied more than once, which could restore a value that a newer update had replaced. ([#7721](https://github.com/reflex-dev/reflex/issues/7721))
- Synced `rx.LocalStorage` vars in other tabs now reset to their defaults, like a page load, when localStorage is cleared or their key is removed. ([#7652](https://github.com/reflex-dev/reflex/issues/7652))
- Fix a `TypeError` when an event handler is called with a proxied state value (such as `self.other(self.items)`) after one was called with a proxied value of a different kind, such as a dict. ([#7673](https://github.com/reflex-dev/reflex/issues/7673))
- `StringVar.reversed()` now reverses Unicode code points, so a character such as an emoji is no longer split into lone surrogates. ([#7548](https://github.com/reflex-dev/reflex/issues/7548))
- Type SQLAlchemy `synonym()` attributes like the attribute they point to, so `State.model.alias` compiles and string operations such as `.upper()` work on it. ([#7756](https://github.com/reflex-dev/reflex/issues/7756))
- Under mypy, `@rx.event` handlers are typed as `EventCallback` instead of `EventNamespace`, so calling one directly no longer fails with `"EventNamespace" not callable`, and annotations through the event namespace, such as `rx.event.EventSpec` or `rx.event.EventCallback[int]`, are accepted as types by mypy and pyright. ([#7709](https://github.com/reflex-dev/reflex/issues/7709), [#7810](https://github.com/reflex-dev/reflex/issues/7810))
- Calling an event handler with five to eight positional values now type-checks, binding every argument or the leading ones of a longer handler. ([#7752](https://github.com/reflex-dev/reflex/issues/7752))
- An `EventHandler` stored outside a state, e.g. in a dataclass field, now reads back as the handler for type checkers instead of `Any`; read through a state instance it is the bound function. ([#7755](https://github.com/reflex-dev/reflex/issues/7755))
- `FunctionStringVar.create` accepts `_var_type=EventChain`, for a JS function bound to an event trigger as its whole handler. ([#7754](https://github.com/reflex-dev/reflex/issues/7754))
- A column of a SQLAlchemy `DeclarativeBase` model whose column type gives no useful Python type, such as `JSON`, `JSONB` or `PickleType`, now has the type of its `Mapped[...]` annotation when read through a state var, so `data: Mapped[dict] = mapped_column(JSON)` supports `State.model.data["key"]`, and a `Mapped[list[str]]` JSON column supports `rx.foreach` and array operations, without `.to(dict)`. An annotation that refines the column's Python type, such as `Mapped[dict[str, int]]` over `dict`, is used too; otherwise the column type still decides. ([#7798](https://github.com/reflex-dev/reflex/issues/7798))
- Operations on an optional list var (`list[T] | None`) holding `None` no longer crash the page or the production prerender: the list acts as an empty list, so `contains` is false, `length` is 0 and `join` gives an empty string. As with any empty list, `reduce` without an `initial` value still raises; pass `initial=` when the list can be `None`. ([#7800](https://github.com/reflex-dev/reflex/issues/7800))
- A computed var that returns an optional list, tuple, set or frozenset (for example `-> set[str] | None`) now reads as `ArrayVar` or `SetVar` for type checkers instead of `ComputedVar`, so its operations type-check. ([#7800](https://github.com/reflex-dev/reflex/issues/7800))
- Deprecation warnings now point at the app line that triggered them when the deprecated call runs inside a `reflex_components_*` package (for example `on_change=client_state.set_value`), instead of a file in `site-packages`. ([#7811](https://github.com/reflex-dev/reflex/issues/7811))
- `reflex run --json` no longer waits on exit for a descendant process that outlives the app and keeps its output open, which could happen on Python 3.13 to 3.15, most often on Windows. ([#7855](https://github.com/reflex-dev/reflex/issues/7855))

### Performance

- Inferring the type of a large dict var no longer copies all of its keys and values. ([#7057](https://github.com/reflex-dev/reflex/issues/7057))
- The first event of a handler that takes a `dict`, dataclass, `TypedDict` or Pydantic model argument no longer imports SQLAlchemy on the event loop. ([#7802](https://github.com/reflex-dev/reflex/issues/7802))

### Documentation

- The `REFLEX_ENV_MODE` entry in the environment variable reference now says that `reflex run` and `reflex export` set it from `--env`, and that users should not set it. ([#7712](https://github.com/reflex-dev/reflex/issues/7712))


## v0.10.1 (2026-10-26)

### Deprecations

- `VarData(position=...)` and `Hooks.HookPosition` are deprecated and ignored: hooks render in declaration order. Remove the `position` argument; to place a hook after another one, put the one it reads in its `VarData(hooks=...)`. ([#7586](https://github.com/reflex-dev/reflex/issues/7586))
- `reflex_base.utils.format.format_data_editor_column` is deprecated and will be removed in 1.0; `rx.data_editor` applies the column defaults itself. ([#7607](https://github.com/reflex-dev/reflex/issues/7607))

### Features

- Add the experimental `react_compiler` configuration option, also available as `REFLEX_REACT_COMPILER`, to opt in to automatic React component memoization. ([#7234](https://github.com/reflex-dev/reflex/issues/7234))
- Event props and the events an event handler returns accept any sequence of events, e.g. a tuple or a variable typed `list[EventSpec]`, not only a list literal. The new `reflex_base.event.event_sequence` helper returns such a value as a sequence of events, wrapping a single event in a list. ([#7402](https://github.com/reflex-dev/reflex/issues/7402))
- The compiled context module exports `stateSchema`, a hash of the state tree the frontend was built for, and the frontend sends it in the socket.io CONNECT `auth` payload under the `state_schema` key. The backend answers a mismatch with the new `state_mismatch` socket event; in production, the frontend then reloads once per cooldown window or shows a "new version available" banner, while in development it only warns in the console. ([#7553](https://github.com/reflex-dev/reflex/issues/7553))
- Add `reflex_base.vars.get_leaf_vars`, which returns the vars a var reads by unwrapping var operations, casts, literal containers and function bodies, for example to list a derived var's dependencies in a React hook's dependency array. ([#7606](https://github.com/reflex-dev/reflex/issues/7606))
- Add the `trusted_proxy_hops` configuration option for safely resolving client IPs from trusted proxy headers. ([#7614](https://github.com/reflex-dev/reflex/issues/7614))

### Bug Fixes

- `TypedDict` form data honors `Required` and `NotRequired`, including inside `Annotated`, in modules using `from __future__ import annotations`: a `NotRequired` field no longer needs a matching form control. ([#7386](https://github.com/reflex-dev/reflex/issues/7386))
- An event handler stored outside a state, e.g. in a component or dataclass field, now type-checks as the handler instead of a bound function, and a handler read through a state instance is typed as a function returning `Any`. ([#7401](https://github.com/reflex-dev/reflex/issues/7401))
- `LiteralObjectVar.create` is typed to take any value that serializes to a mapping, such as a dataclass, as it does at runtime, not only a mapping. ([#7403](https://github.com/reflex-dev/reflex/issues/7403))
- The CDN fallback for an unbundled sub-path dynamic import now puts the sub-path before jsdelivr's `/+esm`, so it resolves instead of returning 404. ([#7405](https://github.com/reflex-dev/reflex/issues/7405))
- ty now reads an optional model, dataclass or mapping field (`rx.Field[X | None]`) on the state class as `ObjectVar[X]`, as pyright already did, instead of `ObjectVar[X | None]`. ([#7413](https://github.com/reflex-dev/reflex/issues/7413))
- Cancel pending hydration and page-load event chains when their client disconnects. ([#7415](https://github.com/reflex-dev/reflex/issues/7415))
- Calling an upload handler with `rx.upload_files(...)` or `rx.upload_files_chunk(...)` as its only argument, as the upload docs show, now type-checks under pyright and ty, for a handler taking `list[rx.UploadFile]` or `rx.UploadChunkIterator`. ([#7419](https://github.com/reflex-dev/reflex/issues/7419))
- Frontend updates and events now keep working when a backend update names a substate the compiled frontend does not know. Reflex skips that substate and reports it once per connection. ([#7435](https://github.com/reflex-dev/reflex/issues/7435))
- Fix a blank page with `Maximum call stack size exceeded` in apps with thousands of state classes. State is now read from one shared store, so the React provider tree no longer grows with the number of states. ([#7441](https://github.com/reflex-dev/reflex/issues/7441))
- Raise descriptive errors when page or compile contexts are accessed outside compilation. ([#7517](https://github.com/reflex-dev/reflex/issues/7517))
- Make `StringVar` length, indexing, and slicing count Unicode code points so operations do not split valid surrogate pairs. On a `None` string these operations now behave as if it were empty. ([#7518](https://github.com/reflex-dev/reflex/issues/7518))
- A frontend error event that carries no `Error` object, such as the benign `ResizeObserver loop` notification, no longer throws inside `window.onerror` and is now reported to `handle_frontend_exception`. ([#7544](https://github.com/reflex-dev/reflex/issues/7544))
- Editing one tab no longer leaves other `sync=True` browser storage vars that share its storage `name` stale in other tabs; every such var is now synced, not only the last one declared. ([#7545](https://github.com/reflex-dev/reflex/issues/7545))
- A state var annotation that names an undefined symbol, such as `items: list[Item] = []` under `from __future__ import annotations`, raises `NameError: name 'Item' is not defined` again instead of an unrelated `TypeError` or `AttributeError`. This also covers vars without a default, backend vars, and Python 3.14 annotations without the `__future__` import. ([#7547](https://github.com/reflex-dev/reflex/issues/7547))
- Report a hydrate message that exceeds the server's message size limit, with its size and the limit, instead of sending it and retrying. Reduce browser storage data and reload to recover. ([#7551](https://github.com/reflex-dev/reflex/issues/7551))
- On POSIX, `reflex run --json` forwards SIGINT to its child process, so supervisors that signal only the Reflex PID can stop the app cleanly. ([#7558](https://github.com/reflex-dev/reflex/issues/7558))
- Raising a negative number or a negated var to a power, such as `(-State.x) ** 2`, now compiles to valid JavaScript instead of failing the frontend build with "A unary expression with the '-' operator cannot be used as the left operand of an exponentiation expression". ([#7565](https://github.com/reflex-dev/reflex/issues/7565))
- Write the Tailwind `important` option to the generated `tailwind.config.js` under the `important` key. It was emitted as `importants`, so Tailwind ignored it. ([#7573](https://github.com/reflex-dev/reflex/issues/7573))
- A background task that re-enters an expired session now rehydrates the loaded states. The browser drops their stale values and keeps its route and browser storage; its next event runs the current page's on_load. ([#7585](https://github.com/reflex-dev/reflex/issues/7585))
- Component hooks render in the order they are declared and merged, so a hook always comes after the hooks it reads. Before, a component whose prop and `add_hooks` Var read the same state could render a hook before the state declaration it reads and fail with a `ReferenceError`. A hook that reads state must carry it: return `rx.Var(f"const x = {State.value}")` from `add_hooks`, not a plain string built with `str(State.value)`. ([#7586](https://github.com/reflex-dev/reflex/issues/7586))
- Passing a plain `dict` to `format_prop` no longer raises `AttributeError`; the dict is JSON-encoded like any other literal. ([#7587](https://github.com/reflex-dev/reflex/issues/7587))
- Resolve Pydantic v2 model field types without emitting deprecation warnings, while retaining Pydantic v1 compatibility. ([#7592](https://github.com/reflex-dev/reflex/issues/7592))
- Retry with backoff and show the connection error when the server or a proxy closes the connection before it is established, for example when browser storage makes the hydrate message too large, instead of reconnecting in a tight loop. ([#7605](https://github.com/reflex-dev/reflex/issues/7605))
- Event handler arguments hinted as an `rx.Model` no longer emit a `PydanticDeprecatedSince20` warning for every key of the payload. ([#7636](https://github.com/reflex-dev/reflex/issues/7636))
- Upgrade the default Bun version to 1.4.4, which removes compromised emSign certificate authorities from its bundled trust store. ([#7639](https://github.com/reflex-dev/reflex/issues/7639))

### Performance

- Add the `REFLEX_BACKEND_START_METHOD` environment variable to choose how production backend workers are started (`fork`, `spawn`, or `forkserver`). ([#7079](https://github.com/reflex-dev/reflex/issues/7079))
- Unchanged objects and arrays in state updates now keep their previous identity on the frontend, so memoized components skip re-rendering them, and an update that changes nothing no longer re-renders at all. ([#7273](https://github.com/reflex-dev/reflex/issues/7273))
- A running background event handler no longer keeps the state tree it was dispatched with alive once it has entered `async with self`. With the Redis state manager, every long-running background task used to hold an extra copy of the session's state. ([#7447](https://github.com/reflex-dev/reflex/issues/7447))

### Documentation

- Document the supported `BaseStateMeta` contract for custom state metaclasses, including the `state_root` and `mixin` class keywords and the reserved `_reflex_state_root` attribute. ([#7626](https://github.com/reflex-dev/reflex/issues/7626))

### Miscellaneous

- Update generated apps to React 19.3.1, Vite 8.3.4, PostCSS 8.5.30, and postcss-import 17.0.1. ([#7645](https://github.com/reflex-dev/reflex/issues/7645))


## v0.10.0 (2026-10-08)

### Breaking Changes

- Require Python 3.11 or newer; Python 3.10 is no longer supported. ([#7449](https://github.com/reflex-dev/reflex/issues/7449))
- Assigning over a state var's field through its state class raises `TypeError`; change its default with the field's `set_default` instead, such as `State.__fields__["count"].set_default(10)`. ([#7516](https://github.com/reflex-dev/reflex/issues/7516))
- Mutable values provided as state var defaults are deep-copied when assigned at class creation time or passed to `set_default`, so later changes to the original object no longer reach new sessions. A module-level list filled in after the `class` statement, such as `options: list[str] = OPTIONS` followed by `OPTIONS.append(...)`, now starts every session empty: fill it before the class is defined, or declare `default_factory=lambda: list(OPTIONS)`. ([#7519](https://github.com/reflex-dev/reflex/issues/7519))
- Formatting a backend var as a string, e.g. `width=f"{State._size}px"`, now raises `BackendVarFormatError` (a `VarTypeError`) instead of embedding its default value. The error names the fix: read its default with `State._size.default_value()`, declare a constant shared by all sessions as `ClassVar[...]`, or use a regular state var for a value the UI shows and updates. ([#7456](https://github.com/reflex-dev/reflex/issues/7456), [#7496](https://github.com/reflex-dev/reflex/issues/7496))
- `reflex_base.utils.types.is_backend_base_variable` and `RESERVED_BACKEND_VAR_NAMES` are removed: whether a state var is a backend var is now a property of its `Field` in `get_fields()`. By convention, fields named with a leading `_` are backend vars. `is_mutable_type` moved to `reflex_base.utils.types` (still importable from `reflex.istate.proxy`). ([#7312](https://github.com/reflex-dev/reflex/issues/7312))
- `PageContext.get()` and `CompileContext.get()` now raise `LookupError` instead of `RuntimeError` when no context is active, the same as every other `BaseContext` subclass. Compiler plugins that catch `RuntimeError` around these calls should catch `LookupError`. ([#6553](https://github.com/reflex-dev/reflex/issues/6553))
- Remove `reflex_base.constants.CustomComponents`, which only the removed `reflex component` CLI used. ([#6425](https://github.com/reflex-dev/reflex/issues/6425))

### Features

#### State vars

- `Field` is now the descriptor holding a state var's value, and `EventHandler` binds to the state that declares it when accessed on a state instance. ([#7312](https://github.com/reflex-dev/reflex/issues/7312))
- Add `Field.set_default` to change a state var's default, given exactly one of `default` or `default_factory`, such as `State.__fields__["items"].set_default(["a"])`. ([#7519](https://github.com/reflex-dev/reflex/issues/7519))
- A double-underscore state attribute (a name-mangled `__private` name or a dunder) can now be a backend var by declaring it with an explicit `rx.field()` value, e.g. `__counter: rx.Field[int] = rx.field(0)`. Without one it stays a plain class attribute, like in 0.9.x. ([#7465](https://github.com/reflex-dev/reflex/issues/7465))

#### Configuration

- `SQLALCHEMY_POOL_TIMEOUT`, `REFLEX_BACKEND_COLD_START_TIMEOUT`, `REFLEX_SOCKET_INTERVAL` and `REFLEX_SOCKET_TIMEOUT` are `timedelta` settings, so they accept a unit suffix such as `REFLEX_SOCKET_TIMEOUT=2m`. A bare number is still read as seconds, so existing values keep their meaning. ([#7138](https://github.com/reflex-dev/reflex/issues/7138))
- `REFLEX_AUTO_RELOAD_COOLDOWN`, `REFLEX_OPLOCK_HOLD_TIME` and `REFLEX_STATE_MANAGER_DISK_DEBOUNCE` replace `REFLEX_AUTO_RELOAD_COOLDOWN_TIME_MS`, `REFLEX_OPLOCK_HOLD_TIME_MS` and `REFLEX_STATE_MANAGER_DISK_DEBOUNCE_SECONDS`, and take a duration such as `250ms` or `5m`. The old names still work and keep counting the unit in their name, with a deprecation warning; they are removed in 1.0. ([#7138](https://github.com/reflex-dev/reflex/issues/7138))
- Add the `REFLEX_REDIS_MAX_CONNECTIONS` and `REFLEX_REDIS_POOL_TIMEOUT` environment variables for bounding each asynchronous Redis client's connection pool. A configured cap must be at least 3 to leave room for the token manager's two pub/sub listeners and ordinary commands; the pool wait defaults to 2 seconds and must be above 0 and shorter than the state-lock lifetime. ([#7179](https://github.com/reflex-dev/reflex/issues/7179))

#### Other

- Add `Var.deep_equals()` for structural comparison of nested frontend values. ([#7208](https://github.com/reflex-dev/reflex/issues/7208))
- Add `reflex_base.utils.log.supervise_output()`, which runs a command with its stdout and stderr on pipes and writes every line it and its descendants print as a JSON record; lines that already are JSON log records pass through unchanged. Output that a descendant writes after the command exits is forwarded for at most a few seconds. ([#7350](https://github.com/reflex-dev/reflex/issues/7350))

### Bug Fixes

#### Vars and compilation

- Negative-step slices of array and string Vars now match Python at a `-1` bound (e.g. `State.items[-1::-1]` no longer renders an empty list), and a Var step (e.g. `State.items[::State.step]`) no longer raises `RecursionError`. ([#7326](https://github.com/reflex-dev/reflex/issues/7326))
- `Var._replace(_var_data=...)` no longer raises `TypeError: dataclasses.replace() got multiple values for keyword argument '_var_data'`. ([#7256](https://github.com/reflex-dev/reflex/issues/7256))
- A state that mixes in `abc.ABC` or another `ABCMeta` class (`class MyMixin(ABC, rx.State, mixin=True)`) no longer fails with a `StateValueError` claiming `_abc_impl` is reserved by `BaseState`. ([#7339](https://github.com/reflex-dev/reflex/issues/7339))
- Calling an event handler of up to four arguments on the state class with its arguments, plain or as Vars, and passing such a handler where a callable of its arguments is expected now type-check under ty, as they already did under pyright. Calls of handlers with five or more arguments can still be misreported by ty. ([#7414](https://github.com/reflex-dev/reflex/issues/7414))
- Auto-memoized `@rx.memo` wrapper names no longer repeat the wrapped memo component's tag. ([#7004](https://github.com/reflex-dev/reflex/issues/7004))
- Pages in apps with many substates no longer intermittently fail to server-render with a 500 such as `SyntaxError: Invalid regular expression: /[^a-z-]/: Stack overflow`. ([#7369](https://github.com/reflex-dev/reflex/issues/7369))
- Form submissions retain ID-backed controls with unset values while omitting IDs from non-controls. ([#7227](https://github.com/reflex-dev/reflex/issues/7227))

#### Events and uploads

- Flatten nested client event lists before dispatch and keep processing queued events after one event fails. ([#7319](https://github.com/reflex-dev/reflex/issues/7319))
- Events sent while a buffered upload is in flight are no longer chained to it: an uploading client that disconnects no longer cancels other clients' events, the upload's response no longer waits for them, and navigating during an upload cancels the previous page's unfinished `on_load` handlers again. Concurrent buffered uploads no longer hang or end each other's responses early, and state changes made after an upload's response has ended, such as by events a backend exception handler chains after the upload handler fails, now reach the client instead of being silently dropped. ([#7357](https://github.com/reflex-dev/reflex/issues/7357))
- `sync=True` `rx.LocalStorage` vars no longer bounce between open tabs forever when the value changes while other tabs are loading, or in several tabs at once: a tab no longer writes a value it sent to the backend back over a newer one another tab stored meanwhile. ([#7505](https://github.com/reflex-dev/reflex/issues/7505))
- `rx.download(data=State.var)` percent-encodes the JSON it puts in the `data:` URL, so a `#` or `%` in the data no longer truncates or corrupts the downloaded file. ([#7325](https://github.com/reflex-dev/reflex/issues/7325))
- OpenTelemetry spans of top-level events enqueued during an HTTP request (a chunked upload, or a custom API route calling `app.event_processor.enqueue`) no longer carry a `reflex.event.parent_txid` naming the event processor's root context; only chained events name the event that produced them. ([#7358](https://github.com/reflex-dev/reflex/issues/7358))

#### Other

- Deprecation warnings no longer point at a pseudo-location such as `<string>` or `<frozen importlib._bootstrap>` when the deprecated call runs inside generated or frozen code; the location now names the first real user file. ([#7138](https://github.com/reflex-dev/reflex/issues/7138))

### Performance

- Speed up first page loads by opening the websocket before React mounts and hydrating the page in the same round trip as the connect. ([#7064](https://github.com/reflex-dev/reflex/issues/7064))
- Lower the CPU cost of every backend event: cached computed var reads, field reads and writes, event dispatch and the JSON encoding of state deltas are faster. A computed var returning a value of the wrong type is now logged once per computed value instead of on every read, and `EventHandler.is_background` and `EventHandler.supersedes` are read once per handler, so mark the function before the handler is first used. ([#7370](https://github.com/reflex-dev/reflex/issues/7370))
- Building Vars (operations, comparisons, `rx.cond`, `rx.foreach`) is up to twice as fast, so pages that derive many Vars compile faster; the generated code is unchanged. ([#7370](https://github.com/reflex-dev/reflex/issues/7370))
- Reading a cached computed var no longer re-validates its return type, and in production mode state var assignments and computed var results check only the outer type instead of walking every element. The type checks only log errors, so this changes no behavior beyond fewer element-level log messages in production. ([#7353](https://github.com/reflex-dev/reflex/issues/7353))
- Reduce event-queue overhead when prepending events and processing events with a connected socket. ([#7053](https://github.com/reflex-dev/reflex/issues/7053))
- Compile memoized components faster by reusing unchanged memo bodies instead of rendering them again. ([#7123](https://github.com/reflex-dev/reflex/issues/7123))

### Miscellaneous

- Update generated apps to React 19.3, Vite 8.3.2, Socket.IO client 4.8.4, Autoprefixer 10.6.1, and PostCSS 8.5.29. Update the bundled Bun runtime to 1.4.2. ([#7424](https://github.com/reflex-dev/reflex/issues/7424))


## v0.9.12 (2026-09-21)

### Features

- Add `rx.vars.use_hook_var()` to create a `Var` bound to the value of a no-argument React hook imported from a given library, and `rx.vars.use_id()` to get React's stable `useId` value for the rendered component. ([#6708](https://github.com/reflex-dev/reflex/issues/6708))
- Python 3.15 has provisional support and is tested in CI. Upstream dependency limitations remain, including dill-based function serialization, which affects some persisted state and dynamic components with Redis. ([#6930](https://github.com/reflex-dev/reflex/issues/6930))
- `VarData` now tracks every state field a var is built from in `field_dependencies`, a mapping of state name to that state's field names, unioned and deduped as vars merge. A computed var depending on a composite var (`deps=[SomeState.composite]`) is now invalidated when any of its underlying fields changes — including fields belonging to a different state, which previously went untracked. `state` and `field_name` still report the first state and its first field, so existing readers are unaffected; read `field_dependencies` when you need every state a var reaches. ([#7068](https://github.com/reflex-dev/reflex/issues/7068))
- Add `BaseVarShadowsInheritedVarError`, raised when a substate declares a var that shadows a var inherited from a parent state. ([#7077](https://github.com/reflex-dev/reflex/issues/7077))
- Add native image cells to `rx.data_editor` with `type="image"`, allowing image thumbnails and text to appear together in the same grid. ([#7081](https://github.com/reflex-dev/reflex/issues/7081))
- `EnvVar` reads `timedelta` values as a number of seconds, or with a `us`, `ms`, `s`, `m`, `h` or `d` suffix. ([#7131](https://github.com/reflex-dev/reflex/issues/7131))

### Bug Fixes

- Automatically memoized components now preserve parent-provided props, event handlers, styles, and refs, allowing them to work correctly with Radix `as_child` wrappers. ([#6850](https://github.com/reflex-dev/reflex/issues/6850))
- Fix hooks and imports being silently dropped from the compiled output when two
  vars with the same value but different metadata were interpolated into the same
  f-string. Var hashing is now derived from the same identity `Var.equals` uses,
  which also fixes `Var.equals` raising `VarTypeError` for vars that carry
  dependencies, and makes `NumberVar` and `BooleanVar` hashable. ([#7015](https://github.com/reflex-dev/reflex/issues/7015))
- Preserve SQLModel relationships, ObjectVar field access, and optional serializer overrides on cold startup, including classes without module names and multiple optional-library bases. Avoid import-order failures, fork hangs, and registry corruption during serializer lookup. ([#7049](https://github.com/reflex-dev/reflex/issues/7049))
- Keep the project-local modules imported by `rxconfig.py` when the config is reloaded from the same project root, so classes they define are not duplicated and states are not registered twice. ([#7075](https://github.com/reflex-dev/reflex/issues/7075))
- Use the standard sitemap XML namespace and include `frontend_path` in default sitemap URLs. ([#7078](https://github.com/reflex-dev/reflex/issues/7078))
- Load `rxconfig` only from the requested project directory, preventing an installed or editable app from supplying another project's configuration when no local config exists. ([#7078](https://github.com/reflex-dev/reflex/issues/7078))
- Generated `.pyi` stubs now type a prop declared as a union — `content: Var[str] | Component`, say — as optional, matching the `None` default that `create()` gives every prop. Type checkers previously reported the generated signature itself as an error. ([#7080](https://github.com/reflex-dev/reflex/issues/7080))
- Persist the bundled-library registry used by backend-only workers when serializing state hydration data. ([#7096](https://github.com/reflex-dev/reflex/issues/7096))
- An `AttributeError` raised while computing a var, such as a typo inside an `@rx.serializer`, is now re-raised as a `ReflexRuntimeError` chained to the original error instead of a misleading `Attribute _cached_var_name not found` error. ([#7115](https://github.com/reflex-dev/reflex/issues/7115))
- Fix `RecursionError: maximum recursion depth exceeded` in the event processor when a handler re-chains itself many times (for example a polling loop started from `on_load`), which surfaced on the client's next navigation and in the event cleanup callbacks. ([#7145](https://github.com/reflex-dev/reflex/issues/7145))
- Consolidate deprecation warnings behind the shared logging pipeline while preserving the public `console.deprecate` API. ([#7152](https://github.com/reflex-dev/reflex/issues/7152))
- Flush OpenTelemetry compile spans before the isolated initial development compile worker exits. ([#7155](https://github.com/reflex-dev/reflex/issues/7155))
- Fix client-side event routing for events queued from callbacks (e.g. a `rx.call_script` callback or toast action triggering an upload handler): the client handler name was passed in the `event_actions` slot, so handlers like `uploadFiles` never ran. ([#7156](https://github.com/reflex-dev/reflex/issues/7156))
- Fix `ReferenceError: queueEvents is not defined` when a callback formatted for a JS interface (e.g. a toast action button) runs outside the event-loop eval context; such callbacks now dispatch through `addEvents` like compiled event triggers. ([#7157](https://github.com/reflex-dev/reflex/issues/7157))
- The upload helper no longer imports `json5`, completing the frontend dependency removal started in 0.9.2. Exported production bundles no longer embed json5's bundled core-js 2.6.5 runtime, and upload responses are now parsed with the same native JSON path the socket already uses, non-finite float values included. ([#7165](https://github.com/reflex-dev/reflex/issues/7165))
- Superseding event handlers (`@rx.event(supersedes=True)`) now cancel stale invocations across distinct event chains: supersession is ordered by the user-initiated root enqueue, so the newest chain wins, invocations within one chain (self-chains and sibling fan-out) coexist, and a stale chain enqueuing a superseding handler after a newer chain already has is dropped instead of cancelling the newer work. ([#7168](https://github.com/reflex-dev/reflex/issues/7168))
- Fix `@rx.memo` components dropping the app wraps their body requires. Providers
  requested by a nested child, or through var data as `rx.upload`'s
  `UploadFilesProvider` is, now reach the app root — so a provider-backed
  component behaves the same inside a memo as inlined into the page. ([#7176](https://github.com/reflex-dev/reflex/issues/7176))
- `Annotated[...]` hints now resolve to the type they annotate wherever Reflex inspects a type. A var typed with a pydantic discriminated union — `Annotated[Cat | Dog, Field(discriminator="kind")]` — no longer raises `Unsupported type ... for guess_type.` when read out of a state var, and its attributes resolve through the union as usual. ([#7189](https://github.com/reflex-dev/reflex/issues/7189))
- Bumped react-router to 8.4.0. ([#7202](https://github.com/reflex-dev/reflex/issues/7202))
- `BaseStateMeta` validates the declarations of every class descending from a state declared with `state_root=True` (`reflex`'s `BaseState`), so `reflex` no longer needs a `BaseStateMeta` subclass as the metaclass of its states and a third-party metaclass derived from `BaseStateMeta` composes with state classes again. ([#7215](https://github.com/reflex-dev/reflex/issues/7215))
- An `@rx.var(cache=False)` value only counts as sent to the client once the delta carrying it is delivered, so a value a `get_delta` override withholds is sent as soon as the override releases it instead of being deduplicated away until it changes again. ([#7216](https://github.com/reflex-dev/reflex/issues/7216))

### Performance

- Components that read the color mode or event loop context no longer re-render on unrelated `ThemeProvider` updates or on router navigation. The `ThemeProvider` system-preference listener is now attached once on mount. ([#6180](https://github.com/reflex-dev/reflex/issues/6180))
- Reduce browser rendering overhead for state updates, especially in apps with many substates. ([#6181](https://github.com/reflex-dev/reflex/issues/6181))
- Lazy imports now cache resolved attributes on the package, so repeated access is a plain attribute lookup instead of a `__getattr__` round-trip. On Python 3.15+, lazy loading delegates to the interpreter's native lazy imports (PEP 810). ([#6930](https://github.com/reflex-dev/reflex/issues/6930))
- `ComputedVar` now records a key for the value an uncached (`cache=False`) var last sent to each client, so `BaseState.get_delta` can leave the var out of the delta when a recomputation produces the same value. ([#6946](https://github.com/reflex-dev/reflex/issues/6946))
- Load pandas, Plotly, and Pillow serializers on demand and avoid importing SQLAlchemy for generic type helpers, reducing startup time and memory when these integrations are unused. ([#7049](https://github.com/reflex-dev/reflex/issues/7049))
- The event processor now refreshes only the router vars whose backing `router_data` keys actually changed, so a navigation no longer rebuilds and re-sends the connection-scoped session and header data. `ROUTER_VARS` names the per-field router vars that replaced the single `router` var on the root state. ([#7068](https://github.com/reflex-dev/reflex/issues/7068))
- Add the opt-in `frontend_lazy_bundled_libraries` config setting to defer optional dynamic-component libraries until first use. React and the shared runtime remain immediately available. The setting does not guarantee fewer JavaScript bytes or requests for every application. ([#7078](https://github.com/reflex-dev/reflex/issues/7078))
- Allow unused memoized components to be removed from shared frontend bundles. Render readable code before Shiki loads, and highlight blocks as they approach the viewport. Changed highlighting options immediately restore the readable fallback until new highlighting succeeds. ([#7078](https://github.com/reflex-dev/reflex/issues/7078))
- Speed up compilation by reading only the props a component sets, caching literal Var dispatch by value type, and trimming render and app-wrap bookkeeping. Tags now render through `render(children)`: `CommonTag` holds the generic protocol shared by every tag class, and `Tag` overrides it with a direct fast path. ([#7121](https://github.com/reflex-dev/reflex/issues/7121))
- Share one event chain per handler and trigger across call sites, and reuse memoized event wrappers by chain identity during compilation. ([#7122](https://github.com/reflex-dev/reflex/issues/7122))
- Var operations no longer keep a permanent reference to every operand they are built from, fixing a memory leak that grew with each operation an app created, and building them is 1.5x to 3.8x faster depending on the operation. ([#7198](https://github.com/reflex-dev/reflex/issues/7198))

### Miscellaneous

- Route log records from the new `reflex-build-sdk` package through the Reflex logger, so they follow the configured log level and sinks. ([#7166](https://github.com/reflex-dev/reflex/issues/7166))


## v0.9.11 (2026-09-11)

### Breaking Changes

- Bundled Bun moves to 1.4.0, and the minimum supported Bun version rises to 1.4.0 with it. Bun 1.4 creates new lockfiles at `lockfileVersion: 2`, which Bun 1.3.x cannot parse at all — so once a project's `reflex.lock/bun.lock` has been generated under 1.4, everyone building it (teammates, CI, Docker images) needs Bun 1.4 too. An existing `lockfileVersion: 1` lockfile is kept at v1 by Bun 1.4, even across dependency changes, so already-initialized projects are unaffected until their lockfile is regenerated from scratch. Reflex installs and manages its own Bun, so this only needs action if you point `bun_path` at your own Bun or rely on one from `PATH`. ([#7019](https://github.com/reflex-dev/reflex/issues/7019))

### Deprecations

- `reflex_base.config._load_config()` is deprecated in favor of `_get_config()`; use `get_config()` to read the cached config. ([#6933](https://github.com/reflex-dev/reflex/issues/6933))

### Features

- Add inert OpenTelemetry trace points and metrics around event handler execution, state acquisition, socket messages and compile stages (`reflex_base.otel`) and `window.__reflex_otel` hooks in the frontend event loop and upload helper; they cost one boolean check, and import nothing from `opentelemetry`, until the `reflex-otel` package enables them (`reflex-base` itself does not depend on `opentelemetry-api`). ([#6227](https://github.com/reflex-dev/reflex/issues/6227))
- `hybrid_property` remains a `property` subclass at runtime, but type checkers now resolve class-level access to the frontend var's type instead of the descriptor: without a var function it follows the var equivalent of the getter's return type, and a var function may declare a type of its own. The var function may be a `classmethod` or `staticmethod`, may return `None` to declare that the property has no frontend value on a class, and — like `getter`, `setter` and `deleter` — may be defined under a name of its own instead of shadowing the property's declaration. ([#6812](https://github.com/reflex-dev/reflex/issues/6812))
- `reflex_base.utils.log.reserve_stdout()` reserves stdout for a machine-readable document, rendering log records, tables, rules, prompts, spinners and progress bars to stderr for as long as it is set. ([#6917](https://github.com/reflex-dev/reflex/issues/6917))

### Bug Fixes

- A hybrid property a state inherits from a base class is no longer shadowed by state storage when the state annotates its name, which made such a state fail to instantiate. ([#6812](https://github.com/reflex-dev/reflex/issues/6812))
- Attribute probes on vars (e.g. `inspect.iscoroutinefunction` via `unittest.mock`) no longer trigger ForwardRef resolution of unrelated annotations, silencing spurious "Failed to resolve ForwardRefs" warnings and avoiding `NameError` under PEP 649 lazy annotations on Python 3.14. ([#6929](https://github.com/reflex-dev/reflex/issues/6929))
- Avoid ModuleNotFoundError when loading `rxconfig.py` in a multi-threaded context. ([#6933](https://github.com/reflex-dev/reflex/issues/6933))
- Auto-memoized components that render identically no longer share a generated memo name, which silently dropped one of the two compiled bodies. The name now accounts for:

  - module-level code emitted by `add_custom_code`
  - dynamic imports
  - app-wrap components, including `rx.text` and the other `MarkdownComponentMap` components that all hashed alike
  - the defining module, so same-named components from different modules stay apart
  - the identity of dataclasses and enum members, which previously hashed by shape and by `str()`

  ([#6947](https://github.com/reflex-dev/reflex/issues/6947))
- The compatibility delta flush for background handlers that never enter `async with self` now also runs when the handler raises, so uncached computed vars and preamble-dirty vars (like `router_data`) reach the client regardless of how the task ended. The exception still propagates to the backend exception handler afterwards; if the flush itself fails in that case, the flush error is logged instead of masking the handler's exception. ([#6995](https://github.com/reflex-dev/reflex/issues/6995))
- `rx.Config` now rejects a `frontend_path` whose segments are not plain directory names (`..`, backslashes, or drive letters), which would otherwise relocate the production build output outside of `.web/build/client`. ([#7044](https://github.com/reflex-dev/reflex/issues/7044))
- Fix the Safari dev-server cache-busting plugin rendering pages as comma-separated byte values with React Router 8. The rewritten HTML now streams through instead of being buffered, and multibyte characters split across response chunks stay intact. ([#7048](https://github.com/reflex-dev/reflex/issues/7048))
- Keep the frontend runtime stable across hot updates in `reflex run`. React contexts, event dispatchers, and element refs now survive a recompile, and the state and event-loop providers are no longer remounted on every compile, so a component refreshed before its provider no longer crashes with `Cannot read properties of null`, drops events, or reconnects the websocket. ([#7071](https://github.com/reflex-dev/reflex/issues/7071))
- Fix the post-eviction rehydrate fallback not running under `StateManagerRedis`. ([#7072](https://github.com/reflex-dev/reflex/issues/7072))
- Prevent runaway page-load event chains when backend-initiated events encounter expired state. ([#7073](https://github.com/reflex-dev/reflex/issues/7073))
- Reject `frontend_path` segments with trailing dots or spaces that Windows trims, and empty segments from repeated slashes, before they can produce inconsistent build paths. A single leading or trailing slash remains supported. ([#7105](https://github.com/reflex-dev/reflex/issues/7105))
- Preserve class-level `hybrid_property` frontend types on Pyright 1.1.412 and later instead of resolving them to `Any`. ([#7106](https://github.com/reflex-dev/reflex/issues/7106))
- `bundle_library()` bundles subpaths without an unused package root; explicit subpath strings also work without registering the package root. ([#7109](https://github.com/reflex-dev/reflex/issues/7109))
- Passing a component to `bundle_library()` prebundles the rendered library imports of its entire tree, including children and component-valued props, before initial rendering. ([#7109](https://github.com/reflex-dev/reflex/issues/7109))
- Invalid `bundle_library()` arguments now raise a clear `TypeError` directing callers to pass a library name string or a prototype component instance. ([#7109](https://github.com/reflex-dev/reflex/issues/7109))
- Preserve default exports when dynamic components use a bundled package root as well as a subpath. ([#7109](https://github.com/reflex-dev/reflex/issues/7109))
- Keep explicit `bundle_library()` registrations across compiler resets and registration-context forks without duplicates. ([#7109](https://github.com/reflex-dev/reflex/issues/7109))

### Performance

- Component content hashing, which auto-memoization runs for every memoized component during a compile, encodes roughly 1.2-1.3x faster on large pages. Generated memo module names change as a result; nothing outside the compiled output refers to them. ([#6947](https://github.com/reflex-dev/reflex/issues/6947))
- New opt-in dev-server knobs: `REFLEX_DEV_PROD_REACT=1` serves React's production build under the Vite dev server (navigation CPU on a large app 54 → 36 ms, prod build 24 ms; edits become a full reload since Fast Refresh needs dev React), and `REFLEX_VITE_WARMUP_ROUTES=1` pre-transforms route modules at startup so the first visit to a page no longer waits on Vite (105–131 → 43–69 ms, or 20–32 ms with both). ([#7021](https://github.com/reflex-dev/reflex/issues/7021))
- Trimmed the framework overhead around every event handler: the state fast-paths its own bookkeeping attributes, foreground handler tasks start eagerly on Python 3.12+, the computed-var expiry check only looks at interval vars, route matching is memoized per path, and socket.io handlers run inline. About 28% less CPU per trivial event and 20% more events per second per worker under concurrent load. ([#7025](https://github.com/reflex-dev/reflex/issues/7025))
- Reduce CLI startup time and memory by loading compiler plugins and optional SQLAlchemy property support only when used. ([#7050](https://github.com/reflex-dev/reflex/issues/7050))

### Miscellaneous

- Bump bundled frontend pins: react-router 8.3.1, isbot 5.2.2, postcss 8.5.26, postcss-import 17.0.0, and vite 8.2.2. postcss-import 17 requires Node 22+, which already matches the Reflex minimum. ([#7019](https://github.com/reflex-dev/reflex/issues/7019))


## v0.9.10.post1 (2026-09-01)

### Deprecations

- `reflex_base.config._load_config()` is deprecated in favor of `_get_config()`; use `get_config()` to read the cached config. ([#6933](https://github.com/reflex-dev/reflex/issues/6933))

### Bug Fixes

- Avoid ModuleNotFoundError when loading `rxconfig.py` in a multi-threaded context. ([#6933](https://github.com/reflex-dev/reflex/issues/6933))


## v0.9.10 (2026-09-01)

### Bug Fixes

- Enqueuing an event chained from a parent event that has already finished no longer raises `RuntimeError: Cannot add a child to an EventFuture that is already done.`. Such a late-chained event skips registration under the completed parent and is processed normally. ([#6801](https://github.com/reflex-dev/reflex/issues/6801))
- Compiling unchanged source twice now produces the same files. Import order came from a `set`, whose iteration order varies with `PYTHONHASHSEED`, and a library's imports were not deduplicated against themselves; both fed the content hash a memoized component is named from, so each compile renamed those components and invalidated downstream build caches for no reason. ([#7012](https://github.com/reflex-dev/reflex/issues/7012))

### Performance

- Compiling an app with many components is substantially faster. Imports are now deduplicated as they are merged rather than only at the end, so naming a memoized component no longer costs work proportional to the size of its subtree. An app with 80 routes and 42,268 components went from 263s to 48s. ([#7012](https://github.com/reflex-dev/reflex/issues/7012))


## v0.9.9.post1 (2026-09-01)

### Deprecations

- `reflex_base.config._load_config()` is deprecated in favor of `_get_config()`; use `get_config()` to read the cached config. ([#6933](https://github.com/reflex-dev/reflex/issues/6933))

### Bug Fixes

- Avoid ModuleNotFoundError when loading `rxconfig.py` in a multi-threaded context. ([#6933](https://github.com/reflex-dev/reflex/issues/6933))


## v0.9.9 (2026-08-28)

### Breaking Changes

- `get_config(reload=True)` has been replaced by `reload_config()`, and the module-level `bundled_libraries` list in `reflex_base.components.dynamic` has moved onto the active `RegistrationContext` (use `bundle_library()` / `reset_bundled_libraries()` as before). Reading `reflex_base.components.dynamic.bundled_libraries` (or `DEFAULT_BUNDLED_LIBRARIES`) still works as a deprecated shim that resolves against the active context; the shims are removed in 1.0. ([#6382](https://github.com/reflex-dev/reflex/issues/6382))
- `pydantic` is no longer a hard dependency; pydantic model support activates when it is installed. Use the `reflex-base[pydantic]` extra (or `reflex[db]`) to keep it. ([#6786](https://github.com/reflex-dev/reflex/issues/6786))
- Upgraded the frontend to React Router 8.3.0 (from 7.18.2). Its new baseline requires Node 22.22.0+, so `Node.MIN_VERSION` moves from 22.12.0 to 22.22.0; the already-pinned React 19.2.8 and Vite 8.0.16 satisfy the React 19.2.7+ and Vite 7+ floors. React Router 8 dropped the `react-router-dom` re-export package, so it is no longer installed: components that declare `library = "react-router-dom"` must import from `react-router` instead (`RouterProvider`/`HydratedRouter` come from `react-router/dom`). Existing projects have the stale entry pruned from `package.json` on the next install. ([#6854](https://github.com/reflex-dev/reflex/issues/6854))

### Deprecations

- The `console.debug/info/success/log/warn/error/timing` helpers are deprecated (removal in 1.0) but keep working as shims; use `logging.getLogger(__name__)` and the pipeline in `reflex_base.utils.log` instead. The interactive Rich features (`print`/`rule`/`status`/`ask`/`progress`) remain first-class. ([#6867](https://github.com/reflex-dev/reflex/issues/6867))
- `get_config(reload=True)` is deprecated (removal in 1.0) but keeps working: passing `reload=True` emits a deprecation warning and delegates to `reload_config()`, which forces a fresh load of the config into the current `RegistrationContext`. ([#6985](https://github.com/reflex-dev/reflex/issues/6985))

### Features

- `RegistrationContext` now carries the loaded `Config`, the registered `App`, decorated pages, and bundled libraries, and provides `fork()` to derive a fresh context that preserves existing registrations while resetting the app and config. ([#6382](https://github.com/reflex-dev/reflex/issues/6382))
- Validate incoming state deltas in the frontend before dispatching and report unprocessable updates to the backend via a new `client_error` socket event instead of failing silently in the browser console. Values reported by a client are escaped and bounded before reaching the backend logs. ([#6827](https://github.com/reflex-dev/reflex/issues/6827))
- Added `reflex_base.utils.log`: a standard python logging pipeline with a rich-rendering console handler (legacy colors preserved), a JSON-lines handler behind `REFLEX_LOG_JSON`, record deduplication, and file logging. `LogLevel` gained a correct total ordering and `to_logging_level()`, and the interactive console helpers (`print`/`rule`/`status`/`progress`) now respect JSON mode. ([#6863](https://github.com/reflex-dev/reflex/issues/6863))
- Compiled components are now named for React DevTools: memoized components take a `displayName` from the Python class or `@rx.memo` function they came from instead of showing as `Anonymous`, generated contexts are named (`StateContext(reflex___state____state.my_state).Provider` rather than an unlabelled `Context.Provider`), pages are labelled with their route (`Component(blog/[slug])`), and client-only (`NoSSRComponent`) wrappers render as `ClientSide(<Tag>)`. ([#6945](https://github.com/reflex-dev/reflex/issues/6945))
- Add the `REFLEX_REFERRER_PARAM` environment variable, read at compile time to append a `ref` query parameter to the "Built with Reflex" badge link. ([#6951](https://github.com/reflex-dev/reflex/issues/6951))

### Bug Fixes

- Event handlers marked with `@rx.event(supersedes=True)` now use latest-wins semantics: enqueuing a new invocation cancels the previous unfinished event chain for the same client token. `on_load_internal` uses this to cancel stale `on_load` chains on navigation. ([#6593](https://github.com/reflex-dev/reflex/issues/6593))
- `@rx.memo` functions that forward props through `rx.RestProp` now classify those props the same way a regular component does: a forwarded prop that is not a declared prop of the target (e.g. `font_weight=`) joins the component's `style` and renders as `css`, instead of being passed through as an unrecognized prop and silently dropped. Such props merge with an explicit `style=` rather than replacing it, and props the target actually declares are still forwarded normally. ([#6605](https://github.com/reflex-dev/reflex/issues/6605))
- Declare `rx.plugins.RadixThemesPlugin()` in the `rxconfig.py` written by `reflex init`, so freshly scaffolded apps no longer emit the implicit Radix Themes enablement deprecation warning. ([#6776](https://github.com/reflex-dev/reflex/issues/6776))
- Qualify annotations whose bare builtin name is shadowed by a member of the same class, so `Var.create` is no longer inferred as `LiteralBooleanVar` for every argument type. `Var.bool`, `BaseComponent.set` and `PropsBase.dict` shadowed `bool`, `set` and `dict` for annotations elsewhere in their own class bodies, which type checkers resolve against the class namespace. ([#6846](https://github.com/reflex-dev/reflex/issues/6846))
- The `vite preview` server that react-router prerendering fetches pages from is now pinned to `127.0.0.1`, fixing `reflex export` failing with `Prerender: Request failed for /: ECONNREFUSED` in environments where `localhost` resolves to both IPv4 and IPv6 loopback addresses (such as docker containers). ([#6857](https://github.com/reflex-dev/reflex/issues/6857))
- Resolve event handler annotations before runtime state-class patches can shadow builtin names on Python 3.14. ([#6890](https://github.com/reflex-dev/reflex/issues/6890))
- Chained events (those yielded by an event handler) now inherit the routing data of the event being processed, so `router` and dynamic route args resolve against the view that produced them instead of whichever view the last client-sent event left on the root state. ([#6919](https://github.com/reflex-dev/reflex/issues/6919))
- Stop background event handlers from computing a delta and cleaning the root state after the state lock is dropped. On a shared state tree (opportunistic locking, in-memory state manager) a concurrent foreground write landing between the background task's dirty-var snapshot and its `_clean()` was silently discarded and never reached any delta. ([#6920](https://github.com/reflex-dev/reflex/issues/6920))
- Resolve `TypeAliasType` annotations (PEP 695 `type` statements and the `typing_extensions` backport) to their underlying value in `Var.guess_type`, `_isinstance` and `typehint_issubclass`. A state var annotated with an alias like `type Key = Literal["day", "week"]` now compiles and can be assigned to, and event handlers with alias-annotated arguments can be passed uncalled to event triggers. Parameterized generic aliases (`Keys[str]` for `type Keys[T] = list[T]`) and aliases nested in unions (`Key | None`) are resolved as well. ([#6944](https://github.com/reflex-dev/reflex/issues/6944), [#6986](https://github.com/reflex-dev/reflex/issues/6986))
- The generated `vite.config.js` no longer passes options rejected or deprecated by rolldown-vite 8.x: the no-op `rollupOptions.jsx` key is dropped and `output.advancedChunks` migrated to `output.codeSplitting` (same shape), removing the "Invalid input options" and "advancedChunks option is deprecated" warnings from every prod build/export. ([#6987](https://github.com/reflex-dev/reflex/issues/6987))
- Console warnings and errors no longer print literal backslash-escaped brackets (e.g. `dict\[str, str]`). The rich-markup escapes were left over from the legacy console helpers, but the logging pipeline renders messages with markup disabled, so bracketed type names now print verbatim. `VarAttributeError` messages drop the same escapes. ([#6989](https://github.com/reflex-dev/reflex/issues/6989))
- A custom component declaring `library = "react-router-dom"` (including versioned and subpath forms) now fails compilation with an actionable error naming the component, instead of silently installing the removed package — which pulled in a second, unpinned React Router 7 copy that worked in dev by accident and broke production builds. React Router 8 dropped `react-router-dom`: use `library = "react-router"` instead, or `"react-router/dom"` for `RouterProvider`/`HydratedRouter`. ([#6991](https://github.com/reflex-dev/reflex/issues/6991))
- With `REFLEX_ENABLE_FULL_LOGGING`, granian worker records reach the log file again: the file handler now opens in append mode (truncating once up front), so it reopens after the worker's post-fork `logging.config.dictConfig` closes it instead of silently dropping every worker-side record. The legacy console file writer follows the reopened stream through a proxy, so its timestamped lines no longer leak to stdout and break `--json` output. ([#6992](https://github.com/reflex-dev/reflex/issues/6992))

### Performance

- Dev mode no longer pays for React's per-element owner-stack capture: navigation clicks in a large app dropped from ~350ms to ~83ms of main-thread CPU (5.6x prod down to ~1.3x). In exchange `React.captureOwnerStack()` returns no owner frames in dev, which affects React DevTools' owner-stack view and custom error overlays built on that API; set `REFLEX_REACT_OWNER_STACKS=1` to restore them. ([#6905](https://github.com/reflex-dev/reflex/issues/6905))
- `MemoComponent` instances no longer opt out of compiler auto-memoization wholesale. Only the passthrough wrappers the auto-memoize pass generates do, tracked by the new `auto_memo_wrapper` flag on `MemoComponentDefinition`, so state-bound props and event handlers on a `@rx.memo` call site compile their hooks into a generated wrapper instead of the enclosing page. ([#6949](https://github.com/reflex-dev/reflex/issues/6949))
- Speed up prop validation and JSON serialization on hot paths: `_isinstance` now reads `__origin__` once per type, memoizes `get_args`, and caches the deferred `Var`/`LiteralVar`/`Field` imports instead of re-importing on every call, and `json_dumps` caches its deferred `serializers.serialize` lookup. ([#6862](https://github.com/reflex-dev/reflex/issues/6862))
- `vite_config_template` declares a `resolveId` hook filter (`{ id: /react-dom\/server/ }`) on `vite-plugin-always-use-react-dom-server-node`. The plugin runs with `enforce: "pre"`, so without a filter rolldown invoked its JS handler for every import specifier in the graph (~15,800 calls on the Reflex docs build) to redirect the one specifier imported by `entry.server.node.tsx`. The template also imports `./vite-plugin-safari-cachebust.js` with its extension, which Vite's `configLoader: "native"` requires. ([#6959](https://github.com/reflex-dev/reflex/issues/6959))

### Miscellaneous

- Removed the `postcss` entry from `PackageJson.OVERRIDES`, leaving that mapping empty. `postcss` is pinned directly in `DEV_DEPENDENCIES` (8.5.23), and that top-level pin already dedupes every transitive requirer (`autoprefixer`, `postcss-import`, and `vite`'s own `^8.5.15`). Projects that already installed 0.9.8 keep an inert `"postcss": "8.5.23"` override in `reflex.lock/package.json`; it matches the dev-dependency pin and can be deleted by hand. ([#6854](https://github.com/reflex-dev/reflex/issues/6854))
- Bump bundled `vite` from 8.0.16 to 8.2.0. ([#6857](https://github.com/reflex-dev/reflex/issues/6857))
- Internal logging in reflex-base migrated from the legacy console helpers to standard python `logging` per-module loggers. ([#6864](https://github.com/reflex-dev/reflex/issues/6864))
- Property docstrings are now noun phrases rather than "Get the ..." / "Return the ..." (ruff 0.16's new `D421`). `Field.default`, `Field.default_factory` and `Field.default_value()` now admit `None`, matching what they already hold for a field whose annotated type has no computed default, and `chain_updates()` declares its `events` parameter as `Any`, matching the runtime validation it delegates to. ([#6893](https://github.com/reflex-dev/reflex/issues/6893))


## v0.9.8 (2026-08-04)

### Features

- Add `Env.PREVIEW`, the `VITE_MINIFY` and `REFLEX_NO_AUTOPREFIXER` environment variables, a `minify`/`cssMinify` option on the vite config template, and a `REFLEX_NO_AUTOPREFIXER` toggle in the generated `postcss.config.js` to support the new `preview` run mode. ([#6663](https://github.com/reflex-dev/reflex/issues/6663))
- Add a staged `Plugin.register_route` hook with `add_page` and `has_app_page` capabilities that runs once per app before its first compilation, and `rx.plugins.get_plugin()` to look up the configured plugin instance by type (raising `ConfigError` on ambiguous matches). ([#6728](https://github.com/reflex-dev/reflex/issues/6728))

### Bug Fixes

- Preserve runtime value types for unannotated `@rx.memo` component parameters. ([#6659](https://github.com/reflex-dev/reflex/issues/6659))
- Compare timezone-aware datetime Vars by their instants instead of their serialized UTC offsets. ([#6767](https://github.com/reflex-dev/reflex/issues/6767))
- In python 3.13+, the EventProcessor loop was not catching asyncio.QueueShutdown resulting in uncaught exceptions during shutdown. ([#6773](https://github.com/reflex-dev/reflex/issues/6773))
- Prevented edits to unloaded routes from poisoning React Router's browser-side HMR queue and blocking all later hot updates until a full page reload. ([#6774](https://github.com/reflex-dev/reflex/issues/6774))
- Drain queued same-token events during graceful event processor shutdown. ([#6791](https://github.com/reflex-dev/reflex/issues/6791))
- Custom attributes on a `Field` are now carried onto the rebuilt field by reference instead of deep copy, so stateful callable markers keep their identity and markers holding non-copyable values (locks, clients) no longer crash state class creation. ([#6809](https://github.com/reflex-dev/reflex/issues/6809))

### Miscellaneous

- Bumped bundled frontend dependency pins to their current releases:

  - `react` / `react-dom`: 19.2.6 → 19.2.8
  - `react-router`, `react-router-dom`, `@react-router/node`, `@react-router/dev`, `@react-router/fs-routes`: 7.15.0 → 7.18.2
  - `isbot`: 5.1.40 → 5.2.1
  - `universal-cookie`: 7.2.2 → 8.1.2
  - `postcss`: 8.5.14 → 8.5.23
  - `autoprefixer`: 10.5.0 → 10.5.4
  - `@tailwindcss/typography`: 0.5.19 → 0.5.20
  - Bun: 1.3.13 → 1.3.14

  Also raised the `rich` upper bound to `<16` (adopting rich 15). Replaced the now-redundant `cookie` `package.json` override (`universal-cookie` 8 and `react-router` resolve `cookie` to 1.x on their own) with a `postcss` override pinning it to 8.5.23 so transitive resolutions stay on a patched release (>= 8.5.18) for a security advisory.

  ([#6678](https://github.com/reflex-dev/reflex/issues/6678))
- Remove the unused `REFLEX_USE_TURBOPACK` environment variable. Turbopack is a Next.js bundler; the flag has had no effect since Reflex moved to React Router and Vite in 0.8. ([#6803](https://github.com/reflex-dev/reflex/issues/6803))


## 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

- Added the `REFLEX_EXTRA_PLUGINS` environment variable, a colon-separated list of fully qualified plugin import paths appended to the config's `plugins` list. Unlike `REFLEX_PLUGINS`, which replaces the list entirely, this preserves plugins configured in `rxconfig.py`; an entry is skipped when a plugin of the same type is already present or when its type is listed in `disable_plugins`. ([#6685](https://github.com/reflex-dev/reflex/issues/6685))

### Bug Fixes

- Stop warning when a non-built-in plugin is listed in `disable_plugins`, so config can opt out of an env-provided plugin without a spurious warning. ([#6685](https://github.com/reflex-dev/reflex/issues/6685))
- Improve error message when plugin spec from environment cannot be used. ([#6685](https://github.com/reflex-dev/reflex/issues/6685))


## v0.9.6 (2026-06-25)

### Features

- `StringVar` now includes `lstrip` and `rstrip` methods. The `strip` method now accepts an optional `chars` argument for consistency with Python’s str API. ([#5417](https://github.com/reflex-dev/reflex/issues/5417))
- Added `reflex_base.utils.memo_paths`, which translates a memo's Python source module into the mirrored `.web/app_components/` JSX path and `$/...` library specifier used by the compiler. The memo component and compiler plugin now route each memo's compiled output through these helpers so it lands alongside its source module's layout, falling back to the per-name `utils/components/<name>` path when the module can't be mirrored. The helpers also derive a per-module-unique JS symbol for each mirrored memo, and the memo registry is keyed by `(name, source module)` so same-named memos defined in different modules coexist instead of colliding. ([#6457](https://github.com/reflex-dev/reflex/issues/6457))
- `ObjectVar` attribute access now resolves `HybridProperty` descriptors defined on the underlying type, evaluating the property's frontend logic with the object var substituted as `self`. `HybridProperty` moved to `reflex_base.vars.hybrid_property` (still available as `rx._x.hybrid_property`). ([#6617](https://github.com/reflex-dev/reflex/issues/6617))
- Add `AgentsMd` constants (canonical URL, managed-section markers, and `CLAUDE.md` bridge) supporting `reflex init` AGENTS.md generation. ([#6620](https://github.com/reflex-dev/reflex/issues/6620))
- Added `HybridPropertyError`, raised when a hybrid property's frontend logic accesses a backend (underscore-prefixed) var on a state while building its frontend var. ([#6621](https://github.com/reflex-dev/reflex/issues/6621))
- `package_json_template` accepts `**additional_keys` to include extra fields (e.g. `name`, `packageManager`, `engines`) in the rendered package.json. ([#6658](https://github.com/reflex-dev/reflex/issues/6658))

### Bug Fixes

- Preserve extra bound event arguments when `rx.upload_files` is used in an upload handler. ([#5290](https://github.com/reflex-dev/reflex/issues/5290))
- Avoid re-entering config loading when a `State` subclass is defined in `rxconfig.py`. ([#6662](https://github.com/reflex-dev/reflex/issues/6662))
- Bump the bundled `vite` dev dependency to 8.0.16, fixing a `server.fs.deny` bypass on Windows alternate paths (CVE-2026-53571) in the dev server of generated apps. ([#6665](https://github.com/reflex-dev/reflex/issues/6665))
- `pyi_hashes.json` entries are now computed from the final `.pyi` content after `ruff format` / `ruff check --fix` post-processing, instead of the intermediate generator output. A pyi_generator change that only affects pre-format output no longer flags hash changes for stubs whose final content is identical.

### Miscellaneous

- `Component` gained a private `_get_tag_name()` helper returning the JS expression that references the component's tag (quoted for global-scope DOM tags without a library); `Component._render` and `DebounceInput` now share it instead of duplicating the quoting logic. ([#6637](https://github.com/reflex-dev/reflex/issues/6637))


## v0.9.5 (2026-06-10)

### Features

- Event-argument type checking now treats a mapping-style payload as compatible with a `TypedDict`-annotated callback parameter, scoped narrowly to `on_submit` triggers whose payload is a `Mapping[str, ...]` so unrelated mapping events are unaffected. Adds the `FORM_SUBMIT_MAPPING` type var (exposed on the event namespace and `pyi_generator`'s default imports) and a `Component._is_form_control` class marker that a component sets to declare it contributes a named field to form submission data. ([#6301](https://github.com/reflex-dev/reflex/issues/6301))
- `VarData` gained an `app_wraps` field so a `Var` can declare the app-level wrapper components it requires; the compiler injects them around the app root, deduped by `(priority, tag)`. This is how the state and event-loop providers now reach the React tree, since event dispatch reaches `addEvents` via a module-level import (`Imports.EVENTS`) rather than a hoisted hook. The still-reactive `connectErrors` value moves to its own `CONNECT_ERRORS` import/hook, and `Component` deep copies now drop the render cache so compile-time clones (e.g. the app-root wrapper chain) render their mutated children. ([#6447](https://github.com/reflex-dev/reflex/issues/6447))
- Added a `hydrate_fallback` config option (settable via the `REFLEX_HYDRATE_FALLBACK` environment variable), a dotted import path to a callable returning the component shown while the page is hydrating. The app root template now emits a React Router `HydrateFallback` export when a fallback is provided, and the import-path resolution shared with `extra_overlay_function` resolves nested module paths correctly. ([#6630](https://github.com/reflex-dev/reflex/issues/6630))
- Added the `REFLEX_HOT_RELOAD_OVERRIDE_PATHS` environment variable, a colon-separated list of paths that, when set, fully replaces the paths watched for hot reload in dev mode. ([#6639](https://github.com/reflex-dev/reflex/issues/6639))

### Bug Fixes

- The `reflex_base.utils.pyi_generator` build-hook entrypoint no longer rewrites `pyi_hashes.json`: it only emits the `.pyi` stubs bundled in the wheel, so building a component package (or the build triggered by `uv sync`) no longer wipes the hash registry down to a single package's entries. The scanner also tolerates source-less modules (e.g. an empty `__init__.py`) instead of raising `OSError` on Python < 3.13. ([#6614](https://github.com/reflex-dev/reflex/issues/6614))
- Fixed `State.router.url` reflecting a stale query string after the URL was changed with `window.history.replaceState`/`pushState` (e.g. from `rx.call_script`). React Router's location does not observe direct history manipulation, so the query and hash are now read from the live `window.location` when building `router_data`, and the next event sent to the backend reports the correct URL (the path stays basename-relative so `frontend_path` is not applied twice; embedded apps keep using the in-widget memory router). A direct history mutation is intentionally not a navigation and does not itself emit an event — use `rx.redirect(..., replace=True)` when you need the URL change to update the router reactively and trigger `on_load`. ([#6625](https://github.com/reflex-dev/reflex/issues/6625))
- pyi_generator no longer includes underscore-prefixed props in generated .pyi files. ([#6628](https://github.com/reflex-dev/reflex/issues/6628))
- Frontend-only events (e.g. `rx.toast`, `rx.redirect`) returned from a middleware's `preprocess` are now emitted to the client instead of being enqueued on the backend event queue, where they had no registered handler and raised `KeyError`. The frontend/backend split that already applied to handler-yielded events is now shared via a `_route_events` helper and applied to middleware-preprocess updates too. ([#6644](https://github.com/reflex-dev/reflex/issues/6644))

### Performance

- Speed up component creation by resolving field defaults lazily (via class-level descriptors) instead of eagerly on every instance, caching each component class's event triggers, and memoizing `to_camel_case`. ([#6576](https://github.com/reflex-dev/reflex/issues/6576))


## v0.9.4 (2026-06-03)

### Deprecations

- Component-returning `@rx.memo` again accepts `key` without an `rx.RestProp` (with a deprecation warning), so `rx.foreach` call sites that set the react `key` keep working; this fallback is removed in 1.0. Other base props (`id`, `class_name`, `style`, `custom_attrs`, `ref`) and identity fields like `tag`/`library` still raise — declare an `rx.RestProp` to forward them.

### Features

- Dependency tracking now follows through hybrid properties, so computed vars that read a `hybrid_property` correctly recompute when the underlying state vars change. ([#3806](https://github.com/reflex-dev/reflex/issues/3806))
- The component memo implementation now lives in `reflex_base.components.memo` and is exported as `rx.memo`. Added `EMPTY_VAR_STR` and `EMPTY_VAR_INT` sentinel vars as memo-friendly defaults. ([#6517](https://github.com/reflex-dev/reflex/issues/6517))

### Bug Fixes

- Pin `es-toolkit@1.46.1` via package overrides to work around upstream breakage in recharts and es-toolkit. ([#6570](https://github.com/reflex-dev/reflex/issues/6570))
- Unpin `es-toolkit@1.46.1` via package overrides and bump vite to 8.0.14 to work around upstream breakage in recharts and es-toolkit. ([#6571](https://github.com/reflex-dev/reflex/issues/6571))

### Miscellaneous

- Removed the `Templates.CHOOSE_TEMPLATES` and `Templates.REFLEX_TEMPLATES_URL` constants, which supported the now-removed open-source templates `reflex init` option. ([#6592](https://github.com/reflex-dev/reflex/issues/6592))
