Repository navigation
Releases
reflex-build-sdk@0.1.3a1
Breaking Changes
reflex_build_sdk.triggersno longer accepts HMAC (v1) signatures or readsREFLEX_TRIGGER_SECRET:verifyandparse_deliverydrop theirsecretargument,SECRET_ENVis removed, andsigntakeswhsk_Ed25519 signing keys only. The platform never sent HMAC-signed deliveries, so no deployed app relied on them.
Features
reflex_build_sdk.triggersverifies the platform's Ed25519 (v1a) delivery signatures against the public key inREFLEX_TRIGGER_PUBLIC_KEY, so an app holds nothing that could sign a delivery. Installreflex-build-sdk[triggers]to get thecryptographypackage it needs.triggers.public_key(signing_key)returns the public half of awhsk_signing key.
reflex-workflow@0.1.1
Features
start(first, key=Model.column)keys a run on one unique column:Falsethen means exactly "a run with this key already exists", and a clash on any other unique column raisesRunConflict, which names the constraint when the database driver reports it. Withoutkey=,startbehaves as before. (#7925)
reflex-hosting-cli@0.2.2.post1
Miscellaneous
- Allow
reflex-build-sdk0.1.2. (#7973)
reflex-build-sdk@0.1.2
Features
- New
reflex_build_sdk.triggersmodule for receiving Reflex Build trigger deliveries:parse_deliveryverifies the Standard Webhooks signature againstREFLEX_TRIGGER_SECRETand reads the batch,EntryPointsdeclares the functions that turn an event into a workflow row (and lists them for the platform withmanifest()), andreplyformats the per-eventResult. It uses the standard library only. (#7926)
reflex-workflow@0.1.0
First release. reflex-workflow runs durable workflows on Postgres: each workflow is a SQLAlchemy table, each row is a run, and workers in your app claim due rows and run their steps. Requires Python 3.11 or newer and SQLAlchemy 2.0.20 or newer. The documentation covers defining workflows, running workers, and how the engine works.
Features
- Define a workflow by mixing
Workflowinto a SQLAlchemy model and marking methods with@step. A step returns what runs next: another step,wake_in(step, delay),wait_for(step, ...),every(step, schedule),fan_out(children, then=step), orNoneto stop.@step(retries=N, backoff=...)retries a failing step with doubling backoff. - Start and control runs with
await Model(...).start(step),Model.by(...).run(step),.deliver(event), and.cancel(). Starting a row that hits a unique constraint starts nothing, so a key never starts two runs. - Wait for outside events: a step returns
wait_for(step, timeout=..., on_timeout=...)anddeliver(step(args), key=...)hands the event to every matching run that is waiting for it. Akeymakes delivery idempotent, andrestart=Truelets a finished run take the event by starting again. - Run a step on a schedule with
every(step, interval)orevery(step, Cron("0 9 * * MON-FRI", "America/Los_Angeles")). - Fan out with
fan_out(children, then=step): the children run as ordinary runs with their own retries, the parent continues when the last one finishes, andself.children(Child)reads them back. - Cap concurrency and rate per group with
__workflow_limit__ = Limit(by="customer", at_most=3, rate=60, per=timedelta(minutes=1)), counted across every worker. Rates use a table the application maps withRateBucket. - Pin steps to dedicated workers with
@step(lane="media")andrun_workflows(..., lanes=["media"]). - Record what each step attempt did by mapping
AttemptLog, then read it withawait run.history(). - Set up a process that starts runs and delivers events without running steps with
connect_workflows(Session). - Workers pick up new runs and events at once through Postgres
LISTEN/NOTIFY, with polling as the fallback.run_workflows(on_idle=...)andreflex_workflow.wake(timeout)let a platform wake a deployment that suspends when idle, andrun_workflows(suspends_when_idle=True)keeps an idle worker from holding a database such as Neon awake. - Models on a
MappedAsDataclassbase importWorkflow,AttemptLog, andRateBucketfromreflex_workflow.dataclassinstead. - Trace every step attempt with OpenTelemetry when
reflex-otelis instrumented. Step arguments and row columns are never recorded.
reflex-components-internal@0.0.35
Release of reflex-components-internal 0.0.35.
v0.11.0
Breaking Changes
-
@rx.eventnow returns anEventHandlerinstead of the decorated function. A decorator stacked above@rx.eventis deprecated: the method still runs and registers under its own name, with a deprecation warning, until 1.0; apply other decorators below@rx.event.@rx.eventon a method of a class that is not a state keeps working when called through an instance, and on astaticmethodorclassmethodleaves it unchanged; both warn and should be removed, and calling such a method through the class (Helper.compute(obj, 3)) is not supported. A module-level function decorated with@rx.eventwhose first parameter is not a state stays a plain function and warns; drop the decorator from plain helper functions. Stacking@rx.eventtwice applies both, with the outer decorator's options winning; applying it to a handler already bound to another state, such asrx.event(OtherState.handler), raisesTypeError, so decorate the function instead. (#7673, #7810) -
deploy_urlnow defaults toNoneinstead ofhttp://localhost:3000, and in prod mode, when it is unset, the backend no longer sends CORS headers, so browsers cannot read cross-origin responses, and Socket.IO accepts same-origin connections only. Withdeploy_urlset, that origin is allowed in addition to the backend's own. A split frontend and backend, a CDN-served frontend or a proxy that rewritesHostneedsREFLEX_DEPLOY_URLset to the frontend's URL on the backend, for exampleREFLEX_DEPLOY_URL=https://app.example.com reflex run --env prod --backend-only. Previously any origin was allowed. Setcors_allowed_originsexplicitly for other setups (["*"]restores the old behavior). Behind proxies,X-Forwarded-HostandX-Forwarded-Protocount only whentrusted_proxy_hopsis set, and the first rejected origin in each worker logs a warning naming the setting to change. Code that readsconfig.deploy_urlmust handleNone: use the newconfig.frontend_urlfor the frontend's origin (deploy_urlwhen set,http://localhost:<frontend_port>otherwise), orconfig.api_urlwhen the backend serves the frontend from its own origin (single-port--env prod). (#7641, #7799) -
A
setorfrozensetstate var is now aSetVarrather than anArrayVar, so it no longer type-checks as a sequence in frontend code: indexing, slicing,map,filter,join,reverse,+,*, the comparisons<,<=,>and>=, andcontainswith afieldon it are deprecated. They still compile for now with a deprecation warning and will be removed in 1.0. Call.to_array()first:State.tags[0] # deprecated State.tags.to_array()[0] ``` ([#7642](https://github.com/reflex-dev/reflex/issues/7642))
-
Browser storage vars (
rx.Cookie,rx.LocalStorage,rx.SessionStorage) must be declared with a storage value as the default or with a storage type annotation. Adefault_factoryon a storage var, or one returning a storage value, now fails at compile time instead of being silently ignored or treated as an ordinary var. (#7582) -
Remove the built-in starlette-admin dashboard.
rx.AdminDash(...)now raises an error linking to the admin dashboard guide, which shows how to mount starlette-admin yourself withapi_transformer. (#7739) -
Calling an
rx.Appinstance (app()) returns a plain ASGI callable instead of aStarletteapp, so the result no longer hasadd_middleware,routesormount. Add Starlette middleware and routes withapi_transformerinstead. (#7624) -
rx.ModelRegistry.register(Base)is now optional: until a base is registered,reflex dband thealembiccommand line migrate the tables of everyDeclarativeBasesubclass defined at module level or in a class body of a module the app imports. A base meant for another database, or one defined by an installed library, then getscreate_tablein thedb_urlmigrations; register the bases ofdb_urlwithrx.ModelRegistry.register(Base)to leave the others out. An autogenerated revision that drops tables now logs a warning naming them. (#7797)
Deprecations
reflex.model.alembic_autogenerate,reflex.model.get_migration_historyandreflex.model.format_revision, and therx.Model.alembic_autogenerateandrx.Model.get_migration_historyclass methods, are deprecated and will be removed in 1.0.0.alembic_autogeneratenow runs through the generatedalembic/env.pyand ignores itsconnectionargument. Usealembic revision --autogenerate,alembic checkandalembic history --indicate-current, or the matchingreflex dbcommands, instead. (#7742)
Features
-
Event handlers are awaitable:
await State.handler(args)inside another event handler runs it right away on the same locked state and returns its result, so a handler may return a value to the backend code awaiting it (returned events still chain, a returned coroutine still raises, and return values are not sent to the frontend yet). An awaited handler passes through app middleware like a queued event; if a middleware blocks it, the await returnsNone. Awaiting a handler outside a client's event, such as in an API route outsideapp.modify_state, raisesEventHandlerTypeError. A non-event value returned by a handler that an event trigger such ason_clickran is dropped, and in dev mode a warning names the handler once; returning an uncalled handler or event creator, such asrx.redirect, still raisesTypeError.self.handler()keeps calling the plain method as before.@rx.event def add(self, amount: int) -> int: self.total += amount return self.total @rx.event async def add_twice(self, amount: int): await type(self).add(amount) total = await type(self).add(amount) yield rx.toast(f"total is now {total}") ``` ([#7673](https://github.com/reflex-dev/reflex/issues/7673), [#7782](https://github.com/reflex-dev/reflex/issues/7782), [#7821](https://github.com/reflex-dev/reflex/issues/7821))
-
Add
rx.client_statefor client-only state. A named var (rx.client_state("", name="query")) is global: any component can read and write it, and the backend canpushandretrieveit. An unnamed var is owned by the outermost page or@rx.memothat uses it, so each@rx.memoinstance gets its own value and a page's values reset when it unmounts. Setting a var re-renders only the components that read it..settakes a value, aFunctionVar, or a lambda (count.set(lambda v: v + 1)) and replaces.set_value, which is deprecated and will be removed in 1.0. Anamemust be an ASCII identifier without$, and declaring one name with two different defaults fails the compile, naming both declarations.rx._x.client_stateremains available with a deprecation warning. (#6936, #7804) -
Add
rx.vars.SetVarforset[T]andfrozenset[T]state vars, computed vars and literals, withcontains,length,union,intersection,difference,symmetric_difference,issubset,issuperset,isdisjointandto_arrayoperations. Elements compare by value, so sets of tuples work.rx.foreachaccepts a set var directly.frozensetis now a serializable state var type, and an optional set var (set[T] | None) holdingNoneacts as an empty set in every operation. (#7642) -
reflex db initnow runsalembic initand installs analembic/env.pythat loads the app and readsdb_urlfrom rxconfig.py, andreflex db migrate,makemigrationsandstatusare thin wrappers overalembic upgrade head,alembic revision --autogenerateandalembic history --indicate-current. Thealembiccommand line works on the same environment, soalembic downgrade -1needs no extra setup, andalembic revision --autogenerateandalembic checkevaluate the pages asreflex db makemigrationsdoes, so a model that only a page imports is compared too. In apps initialized by an earlier release, the nextreflex dbcommand ormigrate()call replaces the stockenv.pywith the current template, keeping the previous file asenv.oldand the existing revisions;migrate()logs a warning when it does so. Anenv.pyedited by hand is kept, with a warning that it is not the Reflex template; if it fails,reflex runlogs the error and thereflex dbcommands exit with it. To regenerate it, move it aside and runreflex db init. (#7742, #7809) -
In development, Reflex warns when an event handler or other task blocks the asyncio event loop for longer than
event_loop_blocking_thresholdseconds (default0.2,REFLEX_EVENT_LOOP_BLOCKING_THRESHOLD), naming the handler and the blocking line of your code. Set it to0to turn detection off. (#7672) -
React Compiler (the experimental
react_compileroption) now also optimizes generated components that useidrefs, generated UUIDs and memoized event handlers such as upload callbacks, installs the experimentalbabel-plugin-react-compilerrelease, and logs a warning that the option is experimental. Add the experimentalauto_memoizeoption (REFLEX_AUTO_MEMOIZE): setauto_memoize=Falsetogether with ...
reflex-release@0.2.2
Miscellaneous
- Generated release workflows now default to uv 0.13.6 and Python 3.14.10, which reject the compromised eMudhra intermediate CA certificates. (#7661)