Skip to content

Releases: reflex-dev/reflex

v0.8.10

10 Sep 00:22
a605e7a

Choose a tag to compare

Release Notes

rx.redirect now takes popup option.

WARNING: This also made it such that is_external and replace are keyword-only arguments.

You can use popup along with is_external to make a popup screen. Be wary that some browsers might block those (occasionally).

Pass along SQL Alchemy Pool configuration

You can use the environment variables: SQLALCHEMY_POOL_SIZE, SQLALCHEMY_MAX_OVERFLOW, SQLALCHEMY_POOL_RECYCLE, and SQLALCHEMY_POOL_TIMEOUT to configure their corresponding pool configuration.

Determinism Fixes

The Reflex compiler should ideally be deterministic. We fixed a few spots where it wasn't. This included switching from sets to dicts in a few places and fixing the seed for the random ID for components. This should ideally limit the number of unintended HMR errors.

Styles Fixes

With --env prod, some CSS styles might appear in the wrong order, causing weird styling. This is now fixed.

  • put reflexGlobalStyles before everything and add style to radix theme root by @adhami3310 in #5763

Re-add UploadFile.filename to maintain compatibility with Starlette

We removed that property because it had inconsistent value among browsers. Now it's back, but it should be consistent.

  • readd UploadFile.filename for compat with StarletteUploadFile by @adhami3310 in #5772

Specify extra_headers to rx.upload_files

In case you want your upload files post request to have extra headers, you can use the extra_headers keyword argument.

Chores

Full Changelog: v0.8.9...v0.8.10

v0.8.9

02 Sep 20:34

Choose a tag to compare

Release Notes

Deprecate state_auto_setters being defaulted to True.

In 0.9.0 this option will default to False. Set it to True if you want to use set_ pattern, or implement setters explicitly.

Option to disable Vite's Hot-Module-Reload

In case you are getting "No module update found for route", you can force full page reload on updates by setting the environment variable VITE_FORCE_FULL_RELOAD to 1. In case you want to disable the reload completely (so refreshing manually to update the page), you can set VITE_HMR to 0.

ImportVar(tag="*", is_default=True, alias='Alias) works as expected now

It renders to:

import * as Alias from '...'

Wrap additional SVG elements.

Those include: Polyline, SvgImage, Use, TSpan, TextPath, Pattern, ClipPath, Symbol, Mask, ForeignObject, SvgA, Animate, AnimateMotion, AnimateTransform, Set, MPath, Desc, Title, Metadata, Script, SvgStyle, Switch, View

Performance optimizations

Some cleanups in particularly offending functions. It doesn't affect most things but it does improve things by a bit.

Serialize Memo components as Vars

You can use memo components as Vars of type=type[Component].

Chores

Full Changelog: v0.8.8...v0.8.9

v0.8.8

25 Aug 22:11

Choose a tag to compare

Release Notes

Performance Optimizations

We replaced jinja2 with simpler fstring calls. This resulted in approximately 30% faster rendering step. We also optimized the import collections by ~15%.

Add more information to asyncio Tasks

If a task gets cancelled or such now Reflex will add a bit more information to what task that was.

  • Provide descriptive names for asyncio.Task by @masenf in #5727

Bugfixes

Chores

Full Changelog: v0.8.7...v0.8.8

v0.8.7

18 Aug 19:40

Choose a tag to compare

Release Notes

Bugfixes

Chores

Full Changelog: v0.8.6...v0.8.7

v0.8.6

11 Aug 17:49

Choose a tag to compare

Release Notes

Misc

Bugfixes

Chores

New Contributors

Full Changelog: v0.8.5...v0.8.6

v0.8.5

04 Aug 20:21

Choose a tag to compare

Release Notes

More accurate progress tracking

When compiling a large app, we weren't incrementing the counter for some time-consuming tasks. Like collecting imports and stateful-izing components. Now we do, so the progress bar is a more accurate estimate of how much progress has been made.

Remove autofocus (not auto_focus)

autofocus is an old guy we had and it wasn't working. Now we only have the HTML/React field auto_focus.

Make Tag immutable

If you happened to have overwrote _render or such, you might be familiar with Tag. We modified it to be immutable as we have been the victims of misusing its mutability. Review your code that involves _render or render.

Bugfixes

Chores

Cleanups

Full Changelog: v0.8.4...v0.8.5

v0.8.4

28 Jul 21:28

Choose a tag to compare

Release Notes

Add query_parameters to router.url

It should be similar to router.page.query and be its long-term replacement.

Bugfixes

Chores

Full Changelog: v0.8.3...v0.8.4

v0.8.3

21 Jul 21:25

Choose a tag to compare

Release Notes

Disable stateless app detection

If you have a stateless app, now you need to explicitly set rx.App(enable_state=False) for it to be truly stateless.

reflex db status

A helpful command to visualize your migrations!

Add rx.el.figure

I'm not sure why it was missing, but better late than never. https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/figure

WindowEventListener

You can use rx.window_event_listener to add event handlers to the Window instance. For example:

rx.window_event_listener(on_key_down=rx.console_log)

would log key presses on the whole window. It also supports: on_resize, on_scroll, on_focus, on_blur, on_visibility_change, on_before_unload, on_key_down, on_popstate, and on_storage.

Default event action flags in @rx.event

class State(rx.State):
    @event(throttle=500, stop_propagation=True)
    def handle_with_defaults(self):
        pass

It supports stop_propagation, prevent_default, throttle, debounce, and temporal.

Increase number of default workers in production

You can change the number of workers in production by setting the GRANIAN_WORKERS. If you don't, and you are using Redis, we set a higher value depending on the number of cores in your CPU.

Add useful information to frontend exceptions

Previously they only had the stack, which was not very helpful. Now they include the type and the message.

Bugfixes

Chores

New Contributors

Full Changelog: v0.8.2...v0.8.3

v0.8.2

14 Jul 20:40

Choose a tag to compare

Release Notes

Deprecated: overlay_component

rx.App.overlay_component is deprecated. You can use rx.App.extra_app_wraps instead.

For example, if you had:

rx.App(overlay_component=rx.box(rx.text("Overlay Component")))

You can instead do:

app = rx.App(
    extra_app_wraps={
        (1, "Overlay Component"): lambda _: rx.box(rx.text("Overlay Component"))
    }
)

The (1, "Overlay Component") defines the nestedness and an ID of the Component. The higher the number the higher it is. For example, if ComponentA had nestedness of 1, and ComponentB had a nestedness of 2, then the output is going to be roughly:

<ComponentB>
  ...
  <ComponentA>...</ComponentA>
<ComponentB>

The value is a function that takes one boolean argument, that is, if the app is stateful (true) or not (false).

Get client ip from X-FORWARDED-FOR header if present

If you were running a your reflex app behind a proxy, this should improve the usefulness of this field.

  • Extract client_ip from x-forwarded-for header by @masenf in #5547

Enable SitemapPlugin by default

We will enable SitemapPlugin by default for apps that do not specify them in the plugins field. If you want to explicitly enable it, add it to plugins:

rx.Config(
    ...,
    plugins=[rx.plugins.sitemap.SitemapPlugin()],
)

Or if you would like to disable it:

rx.Config(
    disable_plugins=[
        "reflex.plugins.sitemap.SitemapPlugin",
    ]
)

The disable_plugins takes a list of strings representing the fully qualified (module + class name) name of the plugins.

Frontend is public to network by default

Previously, the backend was exposed to local network (0.0.0.0) but frontend wasn't (127.0.0.1). Now frontend matches the backend. We will add an option to change this later (both frontend and backend).

rx.Config is now a dataclass

If you were inheriting from rx.Config (for some reason?) you might want to update your code. This provides nicer type hints and might warn you about wrong fields.

Misc

Bugfixes

Chores

Full Changelog: v0.8.1...v0.8.2

v0.8.1

07 Jul 19:28

Choose a tag to compare

Release Notes

router.url

If you just want the url of the page the user is on, then rx.State.router.url is what you need. It's very similar to urllib.parse url, so you can do host, port, and whatnot. The plan is to move away from router.page.

  • add url and route_id to routerdata as a replacement for pagedata by @adhami3310 in #5516

Blur focus

Do you want to de-focus an element? You can use rx.event.blur_focus

  • If we have set_focus() we need blur_focus(). by @riebecj in #5522

Load plugins from environ

If you need to override plugins through an environment variable, now you can do so.

REFLEX_PLUGINS=reflex.plugins.tailwind_v3.TailwindV3Plugin

rx.el.a maps to react router link

You can still get the original through rx.el.elements.a.

  • ENG-6503: use react-router Link instead of rx.el.a by @masenf in #5529

Bugfixes

Chores

New Contributors

Full Changelog: v0.8.0...v0.8.1