Skip to content

Releases

reflex-workflow@0.0.1a1

Pre-release

Choose a tag to compare

Breaking Changes

  • A wait's deadline now decides when the wait ends: once it has passed, deliver refuses the event and returns 0, even where no worker has reached the timeout step yet. Previously an event landing in that window won and the timeout's work was discarded, which let a caller delivering faster than the workers pass keep a deadline from ever being kept. An answer arriving just after the deadline is now refused rather than taken late. (#7288)
  • Require Python 3.11 or newer; Python 3.10 is no longer supported. (#7449)

Features

  • run_workflows(suspends_when_idle=True) is for a database that stops itself when nothing is querying it and charges for being up, such as Neon: the worker listens for nothing, because a held LISTEN is a connection such a database counts as work, and waits an hour between looks rather than thirty seconds. Measured on Neon, an idle worker with a listener never let compute suspend; without one it suspended five minutes after the last query. (#7288)
  • A workflow can declare __workflow_limit__ = Limit(by="customer", at_most=3) to cap how much of one group runs at once, counted across every worker. Workers also take their tables in turn and share each pass between them, so a table with a backlog no longer holds up the rest. (#7288)
  • Map AttemptLog onto your base and the engine records what each step attempt did — the step, the attempt number, the outcome, the error and how long it took — readable with await run.history(). Each record is written in the same transaction as the step it describes. (#7288)
  • connect_workflows(Session) sets up a process to start runs, deliver events and read their state without running any steps, so a web process no longer has to start a worker it does not want. (#7288)
  • Add reflex-workflow, a prototype of durable workflows where each workflow is a SQLAlchemy table and workers in the app run its steps on Postgres. (#7288)
  • A step can return fan_out(children, then=step) to run many child runs at once and carry on when the last one finishes. Each child is an ordinary run with its own retries and errors, and self.children(Child) reads them back. (#7288)
  • Limit now also says how often a group may start: Limit(by="provider", at_most=5, rate=60, per=timedelta(minutes=1)). Rates count in a token bucket that refills continuously, in a table the application maps with RateBucket. (#7288)
  • A workflow whose own attribute takes one of the engine's column names — a parent relationship, or a column of that name holding something else — is refused where it is declared, instead of failing on the first start() or the first claim. (#7288)
  • Workers hear about new work through Postgres LISTEN/NOTIFY rather than waiting for their next poll, so a run started or an event delivered by another process is picked up straight away. Polling remains the fallback. (#7288)
  • Runs can wait and repeat: a step returns wait_for(step, timeout=..., on_timeout=...) to
    park until deliver(...) hands it an event, or every(step, schedule) to run again on an
    interval or a Cron("0 9 * * MON-FRI", "America/Los_Angeles") expression. (#7288)
  • @step(lane="media") keeps a step on the workers started to serve that lane, with run_workflows(..., lanes=["media"]). Heavy work can have its own machines while ordinary steps run anywhere, and a worker skips tables it can run nothing of. (#7288)
  • run_workflows(on_idle=...) reports the instant a worker is next waiting for, on the database's clock and only when it changes, and reflex_workflow.wake(timeout) makes the worker in this process look now and holds until it has nothing left to take. Together they let a platform wake a deployment that suspends when idle, so its timers fire without anyone visiting the app. (#7288)
  • Workflows can be mixed into models on a MappedAsDataclass base by importing Workflow, AttemptLog and RateBucket from reflex_workflow.dataclass, which SQLAlchemy 2.1 requires and 2.0 warns about. The engine's columns stay out of the constructor, so a model reads as it did before the mixin was added. (#7288)
  • Steps are traced with OpenTelemetry when reflex-otel is instrumented: every attempt gets a <table>.<step> span linked to the handler, request, or step that scheduled it, with the attempt number, outcome, and error on it. Step arguments and row columns are never recorded, beyond what a failed attempt's exception message quotes. (#7635)

Bug Fixes

  • A rate-limit group too long to name in the bucket key is named by a digest of itself, rather than failing the insert; a group the engine cannot claim no longer stops the rest of its table from being claimed. (#7288)
  • cancel() no longer stops a run that began matching its predicate after it had read the rows to stop. Such a run was cancelled without its parent being told, leaving a fan-out waiting for a child that would never report. (#7288)
  • An event key is remembered when the run runs the event, not when it is buffered, so a resend of an event the run discarded unrun is accepted instead of being refused forever. A run going round an every(...) schedule no longer holds a buffered event it will never reach, which used to refuse every later delivery. (#7288)
  • cancel() over a large backlog no longer fails once the rows it matches would exceed a statement's parameter limit. It picks and stops them in one statement now, which is also one round trip rather than two. (#7288)
  • start() stores a column the caller set to None as None, rather than falling back to the column's default. deliver(..., restart=True) leaves a cancelled step its lease, as run() does, so the restarted step waits for it instead of running beside it. (#7288)
  • reflex_workflow.wake no longer returns while a step the worker took is still running, or before the step it continued into has run, so a host that suspends when it returns does not stop that work midway. (#7382)
  • An event delivered while a run is running the event it held for a wait is now held for the run's next wait, instead of being refused and lost. A run that waits on the same step again, such as a conversation, no longer misses a message that arrives during that step. A second answer to a wait whose held event has not been taken yet is still refused. (#7396)

Performance

  • An idle worker now waits the same whether or not it can listen for notifications, and a listener that cannot reconnect backs off up to max_idle_interval instead of retrying every second. A database that suspends itself when nothing is querying — Neon, and other managed Postgres — is no longer held awake by a worker with nothing to do. (#7288)
  • Claiming from a limited table and asking when work is next due now read indexes rather than scanning the table. On a 700k-row table with 500 groups a claim took 11.7s and is now 5ms, and the idle question 18ms and is now 1ms. Workflow tables gain an ix_<table>_lease index, so autogenerate a migration after upgrading. (#7288)

Documentation

  • The README covers using workflows from a Reflex app: why they go on their own DeclarativeBase rather than rx.Model, registering that base so reflex db makemigrations picks the tables up, and the session factory to give run_workflows. (#7288)

Miscellaneous

  • Type-check cleanly against SQLAlchemy 2.1. (#7645)

v0.10.1

Choose a tag to compare

@github-actions github-actions released this 27 Oct 01:29
9c64f1e

Breaking Changes

  • router.session.client_ip now ignores untrusted X-Forwarded-For headers by default. Configure trusted_proxy_hops to use forwarded client addresses from a trusted proxy chain. (#7614)

Features

  • Add an experimental, default-off react_compiler configuration flag to enable React Compiler memoization for generated components in development and production. (#7234)

  • Form on_submit handlers can annotate their form data as rx.form.FormData to receive every value of fields that share a name, in submission order; a dict annotation still keeps each name's last value. In a TypedDict annotation, a list[str] field collects every value of its name and a bool field is False when nothing was submitted, such as for an unchecked checkbox, or when the value is false-like, such as "false", "off" or "0"; for list[str] | None and bool | None fields an unsubmitted value is None, and an unsubmitted NotRequired field is left out. In a TypedDict, a list field range also collects the range[] values a two-thumb rx.slider(name="range") submits.

    @rx.event
    def handle_submit(self, form_data: rx.form.FormData[str, str]):
        self.toppings = form_data.getlist("topping")
    ``` ([#7386](https://github.com/reflex-dev/reflex/issues/7386))
  • A page's on_load accepts any sequence of events, e.g. a tuple, like a list of them. (#7402)

  • Detect a frontend built for another version of the app when it connects to the backend. The compiled frontend now carries a hash of the state tree (state names, frontend vars and event handler names) and sends it on every socket connect. On a mismatch, a production page reloads once (sharing the REFLEX_AUTO_RELOAD_COOLDOWN with the reload on frontend errors) and otherwise shows a "new version available" banner with a reload button; in dev mode it only logs a console warning. Load balancers serving several backend versions still need sticky sessions. (#7553)

  • Expose rx.moment_provider for sharing locale, timezone, formatting, and timer defaults across Moment components. (#7591)

Bug Fixes

  • Use atomic writes and OS locks to protect shared JSON metadata from concurrent Reflex processes. When locks are unavailable (for example, with a read-only REFLEX_DIR), writes remain atomic but concurrent updates may overwrite each other. (#7052)
  • Load backend apps by their configured module name so state updates work even when the app package has no __init__.py. (#7258)
  • A stateful_pages.json marker that is not valid UTF-8 is now treated as corrupt and rebuilt, instead of raising UnicodeDecodeError on every backend start. (#7404)
  • Type checkers see the database helpers of reflex.model (rx.session, rx.asession, rx.Model, ModelRegistry, ...) as defined, rather than as unions with the stand-ins used when the db extra is missing. (#7406)
  • Fix a global rx._x.client_state reader that mounts after the value was set, such as one behind an rx.cond, keeping the stale value when the value is later set back to its default. (#7407)
  • Fix TypeError: refs._client_state_set... is not a function when the backend pushes a global rx._x.client_state value before any component using it has mounted, such as one behind an rx.cond or a page that waits for hydration. The value is now kept for the first component that mounts. (#7407)
  • Fix unawaited coroutine warnings when a state delta filter withholds an async uncached computed variable. (#7410)
  • Fix installing Reflex source distributions with uv by excluding references to workspace packages that are not included in the archive. (#7411)
  • Cancel unfinished page-load event chains when the client disconnects, including hydration that has not yet started. Independent background events continue running. (#7415)
  • The backend log for an unknown frontend substate now says the substate was skipped instead of reporting a failed state update. The frontend exception handler docs describe how to resolve the mismatch. (#7435)
  • reflex.model (and rx.ModelRegistry, rx.session, rx.Model) can be imported without greenlet, which SQLAlchemy 2.1 only installs with its asyncio extra; only rx.asession and get_async_engine require it now. (#7440)
  • Detect state reads from the new shared state store when checking that an app that reads state defines an rx.State subclass. (#7441)
  • Raise an actionable error when a legacy string passed to App.modify_state() has a missing or unknown state path. Use rx.BaseStateToken(ident=client_token, cls=StateClass) to select the state explicitly. (#7443)
  • Production exports, reflex run --env prod, and preview startup that share a .web directory now wait for one another instead of overwriting each other's compiled frontend and archives. (#7453)
  • Mutating a nested value reached through dict.values() or dict.items() on a state var now marks the var dirty, so the UI and cached vars depending on it update. (#7500)
  • reflex run no longer logs "Unexpected exit from worker-1" when the dev backend is stopped with SIGTERM or SIGINT. (#7538)
  • Cap the automatically selected number of Redis-backed backend workers at eight. Set GRANIAN_WORKERS to override the default. (#7542)
  • reflex init no longer refuses to reinitialize an existing app just because its project directory is named reflex; the check now applies to the app_name set in rxconfig.py. (#7554)
  • Add development frontend packages with -D, so npm saves them under devDependencies and source-only hot reloads no longer reinstall frontend packages. (#7566)
  • Cached computed vars that depend on client storage (rx.LocalStorage, rx.SessionStorage, rx.Cookie) are now evaluated once per page load instead of twice. (#7568)
  • A background task that re-enters an expired session now rehydrates the loaded state tree, so the browser no longer shows stale values for those states. (#7585)
  • Repeated request headers are no longer collapsed to their last value: repeated cookie fields are joined with "; " and any other repeated field with ", ", so router.headers.cookie keeps every cookie. (#7588)
  • Websocket connections now accept request header values containing bytes that are not valid UTF-8. (#7602)
  • Avoid false type errors when hydrating or assigning strings to vars annotated with Cookie, LocalStorage, or SessionStorage. (#7603)
  • Clarify the warning shown when Bun is below the minimum supported version. (#7639)

Performance

  • Production backend workers on Linux are now forked from a supervisor that has already imported the app, so they share its memory instead of each importing the app again, which cuts memory use and startup time. Set REFLEX_BACKEND_START_METHOD=spawn for apps that are not fork-safe. (#7079)
  • The reflex run backend reload worker is now forked from the supervisor on Linux instead of started through a forkserver, so framework code is shared copy-on-write and the extra forkserver processes are gone. Set REFLEX_BACKEND_START_METHOD=spawn or REFLEX_STRICT_HOT_RELOAD=1 for apps that are not fork-safe. (#7113)
  • Speed up deployment archive creation by reducing filesystem checks for excluded files and avoiding recompression of precompressed frontend assets. (#7450)

reflex-release@0.2.1

Choose a tag to compare

@github-actions github-actions released this 27 Oct 01:03
36570bb

Miscellaneous

  • Allow towncrier 26. (#7645)

reflex-hosting-cli@0.2.1

Choose a tag to compare

@github-actions github-actions released this 27 Oct 01:12
c92884f

Bug Fixes

  • The reflex cloud project list table shows the project tier name instead of the full tier object. Use --json to get the full tier. (#7340)
  • Print reflex cloud apps logs lines as readable timestamp [LEVEL] message text instead of Python dicts. --json still prints the structured records, and --loglevel no longer hides the log lines. (#7390)
  • Show reflex login guidance when initial authentication rejects an access token, including instructions to replace or remove an explicit REFLEX_ACCESS_TOKEN or --token override.
    When reflex cloud whoami or a noninteractive cloud command cannot validate a token due to a temporary service or connection failure, suggest retrying instead of replacing credentials. (#7434)
  • reflex deploy now waits and retries confirmed scaling conflicts with progress messages, reusing the uploaded build and preserving support for custom backend URL prefixes. It stops on unrelated failures and uncertain writes, and warns when bounds may remain changed after a failed deployment, including server errors and unreadable success responses. (#7463)
  • Authentication validation now reports the HTTP status when the control plane refuses the request, and only suggests trying again later for failures that may succeed on retry (timeouts, HTTP 429 and server errors). (#7546)

Performance

  • Speed up non-interactive deploys by skipping the provider availability request used only for the interactive provider prompt. (#7452)

reflex-components-radix@0.10.1

Choose a tag to compare

@github-actions github-actions released this 27 Oct 01:17
3b3480b

Features

  • checkbox_group and checkbox_cards now support a controlled value with on_value_change, and the native form props that radio_group and radio_cards already have. (#7345)
  • Expose FormData on the form namespace as rx.form.FormData. The rx.form stub now declares the namespace as a class, so rx.form.FormData[str, str] works in type annotations; calls such as rx.form(...) and rx.form.root(...) type the same as before. (#7386)

Bug Fixes

  • Avoid Emotion's unsafe :first-child SSR warning for Radix Accordion items in development mode. (#7098)
  • rx.input's auto_complete now takes the HTML autocomplete value, such as "off" or "email", which used to raise a TypeError. A bool still works and now becomes "on" or "off"; before, React dropped it and browser autocomplete stayed on. (#7418)
  • Forward progress values to the Radix Root so its state and ARIA attributes reflect the displayed progress. (#7431)
  • Remove the as_child prop from rx.radio_cards.root and rx.radio_cards.item. Radix Themes does not accept asChild on either component: on the root it crashed the page or dropped the grid container, and on the item it did nothing. (#7555)

Miscellaneous

  • Update the Radix primitives to the versions bundled with the current radix-ui release that Radix Themes depends on (accordion 1.3.1, dialog 1.3.1, form 0.3.0, progress 1.2.1, slider 1.6.1), so apps load a single copy of each primitive. (#7645)

reflex-components-moment@0.10.1

Choose a tag to compare

@github-actions github-actions released this 27 Oct 01:03
36570bb

Bug Fixes

  • Expose the utc, calendar, from_, to, ago, element, fallback, filters, and renderers options of react-moment 2.x, which previously rendered as CSS, and add moment_provider for shared defaults and pooled timers. (#7591)

reflex-components-lucide@1.1.1

Choose a tag to compare

@github-actions github-actions released this 27 Oct 01:03
36570bb

Bug Fixes

  • Preserve imports required by icon props and expose the correct Lucide module through import_var. (#7604)

reflex-components-dataeditor@0.10.1

Choose a tag to compare

@github-actions github-actions released this 27 Oct 01:12
c92884f

Bug Fixes

  • rx.data_editor columns backed by state now get the same defaults as literal columns: type defaults to "str", id to the lowercased title, and a column may be given as just its title string. The column dicts passed to columns are no longer modified in place. (#7607)

Performance

  • Faster redraws for rx.data_editor grids whose columns or data come from state. (#7607)

reflex-components-core@0.10.1

Choose a tag to compare

@github-actions github-actions released this 27 Oct 01:12
c92884f

Deprecations

  • Submitting a form control's value under its id is deprecated and will be removed in 0.11; form data will then hold only what each control submits under its name. Compiling a form whose on_submit handler takes the form data now warns about each value-bearing control that has a static id but no name; give it a name, e.g. rx.input(id="email") becomes rx.input(id="email", name="email"). A control whose id differs from its name also stops adding a field keyed by its id, and a checkbox or switch whose id equals its name submits "on" or nothing instead of True or False; read it as a bool field of a TypedDict to keep a bool. See the form docs for details. (#7386)

Bug Fixes

  • Forms now see the name of a controlled input (one with value and on_change), so a TypedDict submit handler requiring that field no longer fails to compile. (#7386)
  • The default connection toast shows a hydration size error at once and keeps it open until the user closes it. (#7551)
  • window_event_listener and clipboard hooks now render in declaration order with the rest of the component's hooks instead of being moved after them. (#7586)

reflex-components-code@0.10.1

Choose a tag to compare

@github-actions github-actions released this 27 Oct 01:03
36570bb

Bug Fixes

  • Fix use_transformers=True on the Shiki code block rendering no transformers: the default shikijs transformers and their styles are now applied again. (#7437)

Miscellaneous

  • Update react-syntax-highlighter to 16.1.2. (#7645)