Releases: reflex-dev/reflex
v0.8.5
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.
- add progrss for imports and statefulizing by @adhami3310 in #5646
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
.
- remove autofocus by @adhami3310 in #5644
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
.
- make tag immutable by @adhami3310 in #5641
Bugfixes
- fix httpx client mount verify setting #5632 by @ruhz3 in #5635
- prevent tag special props from being a shared mutable reference by @adhami3310 in #5640
- move address family socket creation to inside of try catch by @adhami3310 in #5637
- completely remove vite in favor of rolldown-vite by @adhami3310 in #5645
- fix prevent AutoScroll hook name collision with unique ID by @ruhz3 in #5650
- get the running loop to compile async state by @adhami3310 in #5657
Chores
- fix reflex-web ci by @adhami3310 in #5642
- upgrade 085dev by @adhami3310 in #5639
- update template links by @adhami3310 in #5652
Cleanups
- do not force import event and page by @adhami3310 in #5559
- simplify error handling for first compile by @adhami3310 in #5628
- move on submit form spec to event.py by @adhami3310 in #5638
- delete unused html props by @adhami3310 in #5643
Full Changelog: v0.8.4...v0.8.5
v0.8.4
Release Notes
Add query_parameters
to router.url
It should be similar to router.page.query
and be its long-term replacement.
- add origin and query parameters to router url by @adhami3310 in #5596
Bugfixes
- Fix cookie JSON parsing by disabling automatic parsing (ENG-6818) by @devin-ai-integration[bot] in #5616
- check open ports for which address families we can bind to by @adhami3310 in #5621
- snip source correctly for dep tracker by @adhami3310 in #5613
- fix FOUC on refresh by @Lendemor in #5608
- fix breakpoints / flash by @Lendemor in #5627
Chores
- clean up app._compile by @adhami3310 in #5599
- 4dev by @adhami3310 in #5611
- move httpx imports to function scope by @adhami3310 in #5612
- [ENG-6830] add timestamps to debug logs by @masenf in #5618
Full Changelog: v0.8.3...v0.8.4
v0.8.3
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.
- disable stateful app detection by @adhami3310 in #5583
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
- Add missing rx.el.figure HTML element by @devin-ai-integration[bot] in #5575
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
.
- add event_action flags to rx.event decorator by @Lendemor in #5574
- fix docstring by @Lendemor in #5592
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.
- increase number of workers from the default one by @adhami3310 in #5586
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.
- add name and message to frontendend exception handler by @adhami3310 in #5585
Bugfixes
- ENG-6695: Do not allow call_script EventSpec to accept callback after being called by @masenf in #5571
- fix attribute check for SQLAlchemy labeled column properties by @benedikt-bartscher in #5567
- add message to why port is skipped by @adhami3310 in #5584
- check input_type is a str before checking its type by @adhami3310 in #5587
- only delete init if in cwd by @adhami3310 in #5601
Chores
- bump to 083 for dev by @adhami3310 in #5572
- modify the contributing guide a tad bit to use uv run python -m reflex.utils.pyi_generator by @adhami3310 in #5576
- add uv required version by @adhami3310 in #5595
- fix spelling mistakes by @tartansandal in #5606
New Contributors
- @tartansandal made their first contribution in #5606
Full Changelog: v0.8.2...v0.8.3
v0.8.2
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).
- deprecate overlay_component by @adhami3310 in #5544
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.
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.
- enable sitemap plugin by default by @adhami3310 in #5558
- _add_builtin_plugins after setting from env by @adhami3310 in #5566
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).
- add --host to react router by @adhami3310 in #5554
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.
- move rx config away from pydantic by @adhami3310 in #5557
Misc
Bugfixes
- Add
property
prop to Base HTML tag by @masenf in #5548 - check port with bind over connect_ex by @adhami3310 in #5564
Chores
- upgrade to 082dev by @adhami3310 in #5543
- bump rolldown-vite and bun by @adhami3310 in #5563
- pin rollup by @adhami3310 in #5570
Full Changelog: v0.8.1...v0.8.2
v0.8.1
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
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
- load plugins from env variable by @adhami3310 in #5524
rx.el.a maps to react router link
You can still get the original through rx.el.elements.a
.
Bugfixes
- fix gunicorn in prod mode by @Lendemor in #5521
- use deterministic hash for stateful component names by @adhami3310 in #5525
- Limit scope of bun react-dom/server hack by @masenf in #5532
- only access .name for upload component by @adhami3310 in #5515
- use jsx for root by @adhami3310 in #5535
- add error handling for port process check by @adhami3310 in #5540
- remove keyframes as template string and inline it by @adhami3310 in #5541
Chores
- bump to 081 for dev by @adhami3310 in #5514
New Contributors
Full Changelog: v0.8.0...v0.8.1
v0.8.0
Reflex_080.mp4
Release Notes
Breaking Changes
Local JS files
If your app included local .js
files (from assets or elsewhere), and those files contain JSX syntax, they must be renamed with a .jsx
suffix now.
REMOVED DEPRECATIONS
The following has been removed and was previously deprecated:
-
UploadFile.filename, deprecated in
0.7.1
. UseUploadFile.name
instead (which strictly returns the file name with no slashes or such). To get the full path, useUploadFile.path
. -
App.error_boundary, deprecated in
0.7.1
. UseApp.app_wraps
(which has other app wraps as well, most likely you would like to provide those, as well as your different error wrap). -
App.api
, deprecated in0.7.9
. Useapi_transformer=your_fastapi_app
instead. Read: https://reflex.dev/docs/api-routes/overview#api-transformer -
App.add_custom_404_page
, deprecated in0.6.7
. Use add_page with/404
route instead. -
Component.__init__
, deprecated in0.7.2
. Now it only inits the component and doesn't call post init to add events and such. -
Non prefixed config env vars, deprecated in
0.7.13
. Things like ENV_FILE now have to be passed explicitly as `REFLEX_ENV_FILE. -
Gunicorn configuration env variables, deprecated in
0.7.9
. Removed:timeout
,gunicorn_worker_class
,gunicorn_workers
,gunicorn_max_requests
,gunicorn_max_requests_jitter
. If you would like to customize those, I encourage you to either call gunicorn directly (reflex.App is a factory for ASGI apps), or do so using gunicorn environment variable flags. -
Inferring TailwindV3, deprecated in
0.7.13
. We assume no Tailwind unless explicitly enabled through the plugins config. -
get_decorated_pages
, deprecated in0.7.9
. If you need to use a similar function you most likely need to implement your own page registry. -
validate_parameter_literals
, deprecated in0.7.11
. I don't think anyone but us used this function but it's nonetheless removed now. -
Var._var_name
,Var._var_name_unwrapped
,Var.create_safe
, andVar._type
. All deprecated in various releases. All have better named equivalents.
This was done in this PR:
[MAJOR REWRITE] Replace Next with React Router
NextJS has served us well, but the needs of the framework has grown and we hit certain limits that made NextJS a suboptimal choice. To not go too long, compilation times and other factors have encouraged us to cut down on a big dependency that we barely use most of its features.
- [0.8] [ENG-5825] remix over next by @adhami3310 in #4984
Breaking Changes
THIS MOST DEFINITELY HAS BREAKING CHANGES. Especially if you used something deeply attached to how JS works. During this prerelease we are going to triage regressions and fix them til they are at an acceptable state.
- Static exports are now stored in
.web/build/client
(instead of.web/_static
)
[REMOVED] reflex.suneditor
We have moved suneditor to its own package: https://github.com/reflex-dev/reflex-suneditor
-
deprecate suneditor by @adhami3310 in #5407
[REMOVED] Experimental layout
We will be leaning more heavily into less in the core package (where less, is less opinionated UI).
- remove experimental layout and clean up old experiments by @adhami3310 in #5392
[Major Rewrite] rx.State no longer inherits from Pydantic
rx.State is now a simple python Class. Nothing that fancy. The changes were made to be backwards compatible but you can optionally use rx.field(...)
(or rx.field(default_factory=...)
) to define fields more explicitly.
- [0.8] remove pydantic as a base class of state by @adhami3310 in #5396
- fix missing value for mutable state field leading to shared field value by @adhami3310 in #5416
[BREAKING] rx.Component.get_event_triggers is now a classmethod
We still invoke it mostly from a self context, but you should port it to be a classmethod.
[Major Rewrite] Remove Pydantic as a dependency of PropsBase
You can use it as before, it's just not a Pydantic class. (TODO: add code here about using component field)
Enable TailwindV4 by default
Newly generated apps with reflex init will have the tailwindV4 plugin enabled by default instead of the v3 one.
- tailwind v4 by default and other cleanups by @adhami3310 in #5435
Add earlier checks for wrong app names
If you had your name named wrong, now we check that a tad bit earlier in the compile process and with a more helpful message.
Additional Event Info
Now you can use information about the pointer (the mouse thingy) in pointer events. (TODO: remind me to write an example here).
Also you could use on_scroll_end when.. the scroll ends! Unless you are in Safari, in which case you have to wait until they implement that :/
- pass pointer info for on_click, on_double_click, and on_context_menu by @Lendemor in #5391
- add on_scroll_end event by @Lendemor in #5401
Improved Error Messaging that contains Vars
If you noticed some weird "rx__state__..." names, those are backend vars JS output. Now we strip those form compilation errors and replace them with what you might expect as more normal names. (TODO, add concrete examples)
- replace compiled state name with module and name in errors by @adhami3310 in #5381
Add suffix to user defined vars to avoid clash with JS keywords
Javascript has a decent amount of keywords, and sometimes you might accidentally call your variable package
and get a syntax error. This should solve this.
- [0.8] don't use reserve words for variable names by @adhami3310 in #5251
Built-in style reset
rx.App
now has a parameter named reset_style
that is True by default. It's there if you are not using Tailwind and you want to reset differences between the browsers.
Hot reload with REFLEX_ENV_FILES
If you are using Granian, now we pass the REFLEX_ENV_FILES environment flag for it to watch its changes.
- reload env file on hot reload in granian by @adhami3310 in #5510
- use granian env_files option instead of reload hook by @adhami3310 in #5512
Bugfixes
- [ENG-2566] Fix accordion style without Tailwind by @masenf in #5445
- handle the reload directory better if there's init.py next to rxconfig.py by @adhami3310 in #5437
- pin dynamic lucide icon by @adhami3310 in #5439
- make windowed library into a list because of recompilation inconsistencies by @adhami3310 in #5436
- fix HMR for RR by @adhami3310 in #5456
- do not export local stateful component by @adhami3310 in #5462
- Sort initial state to avoid spurious changes to context.js by @masenf in #5463
- make run dev run react router dev instead of vite dev by @adhami3310 in #5460
- always install react helmet by @adhami3310 in #5466
- put __reflex_global_styles in a link by @adhami3310 in #5471
- stip env vars before interpreting them by @adhami3310 in #5470
- ENG-6363: remix: ignore some changes in .web to reduce reloads by @masenf in #5473
- dedupe windowed libraries at the end by @adhami3310 in #5482
- avoid side effects of checking app module existing by @adhami3310 in #5480
- fix get_value and add unit tests by @Lendemor in #5485
- move dynamic plotly to react lazy syntax by @adhami3310 in #5492
- Ensure __reflex_base CSS is declared first by @masenf in #5493
- always send on load even on going on the link by @adhami3310 in #5469
- Import
useEffect
normally by @masenf in #5501 - Read routes from _unevaluated_pages by @masenf in #5503
- Include default metas for char_set and viewport by @masenf in #5500
- remove init requirement to figure out if the app exists by @adhami3310 in #5507
- detect if port is used on IPV6 by @Lendemor in #5508
- ENG-6500: Add vite-plugin-safari-cachebust to smooth out HMR issues by @masenf in https://github.com/refle...
v0.7.14
Release Notes
[WARNING: different UI output] add style recursive for memo
Previously, we were not adding the app styles to memoized components. Now that's fixed, but in certain apps some of your memoized components might look different, so adjust your styles after upgrading.
- add style recursive for memo by @adhami3310 in #5380
Context on what page failed to evaluate
If you're on Python 3.11+, you will get a helpful message indicating which route is the one that caused the error.
- add context on route during evaluation by @adhami3310 in #5342
Full Logging support
If you want to run reflex with a high loglevel but want to store debug logs just in case. You can set the environment variable REFLEX_ENABLE_FULL_LOGGING to true. This will by default store it in the user directory (something like .locals/shared/reflex). You can change the path of the log file with the environment variable REFLEX_LOG_FILE.
- print debug logs in the user directory under logs by @adhami3310 in #5388
- do not log to file if progress by @adhami3310 in #5402
Components Improvements
- support str for size prop in el.select by @carlosabadia in #5359
- add g svg element by @carlosabadia in #5360
- support float and str for stroke_width prop in recharts components by @carlosabadia in #5358
- adjust rechart types by @Lendemor in #5336
- add str support for some html components props by @carlosabadia in #5378
Bugfixes
- do not run nextjs check on import by @adhami3310 in #5352
- Handle REFLEX_ENV_FILE at init time by @masenf in #5349
- do not prematurely import app module if providing app_module_import by @adhami3310 in #5350
- detect class var that are forward ref by @Lendemor in #5362
- fix reload paths being restricted to the app dir by @adhami3310 in #5363
- make get_props use get_js_fields by @adhami3310 in #5361
- fix checking for migrations in granian by @adhami3310 in #5348
- fix app_wraps not being passed from inside a rx.memo by @Lendemor in #5387
- no need to kill nextjs on package change by @adhami3310 in #5389
- ignore visited components for all_app_wrap_components by @adhami3310 in #5404
- compile custom components before we get app wraps of the pages by @adhami3310 in #5405
Chores
- update deps 0714 by @adhami3310 in #5328
- delete wsl integration test by @adhami3310 in #5368
- update pyi hashes by @adhami3310 in #5365
- enable all ruff rules but not really by @adhami3310 in #5367
- add uv sync to setup build env by @adhami3310 in #5366
- upgrade deps just before 0714 by @adhami3310 in #5373
- fix infinite loop in pyi generator by @adhami3310 in #5354
- Enable wide assortion of ruff rules by @adhami3310 in #5372
- move environment into its own file by @adhami3310 in #5403
Misc
- add repr to plugins by @adhami3310 in #5364
- some prepwork to anticipate for removing pydantic from propsbase by @Lendemor in #5370
- ignore log for hot reload by @adhami3310 in #5369
- identify app_class in telemetry events by @Lendemor in #5374
- track node and bun version by @adhami3310 in #5375
- Revert "identify app_class in telemetry events (#5374)" by @adhami3310 in #5383
- another way to check on enterprise usage by @Lendemor in #5400
Full Changelog: v0.7.13...release/reflex-0.7.14
v0.7.13
Release Notes
Remove Pydantic as a base class of Component
rx.Component
used to inherit from BaseModel
, but that's no longer the case. We opted to write our own Metaclass to handle the specific needs of Components better.
This has great improvements for hot reload time for small apps as Pydantic spent around 75% of import time just deep copying fields. On my own machine, a hot reload of a simple app went down from ~1.2sec to just around 200ms!
While this is not intended to be a breaking change, it's likely that a very introspective code could behave differently with this one. So please test it and report to us so we can preserve behavior as best as possible.
- remove pydantic as base class of component by @adhami3310 in #5289
length() for dicts
If you are using object vars (State fields of type dict or Base/dataclasses), you can now call .length()
on them. This is a simple wrapper over .keys().length()
.
- add length var operation for objects by @adhami3310 in #5318
Allow Vars to be the result of the render function of Foreach
This relaxes the requirement from being a component. Vars are wrapped in a Fragment.
- allow rendering vars in foreach by @adhami3310 in #5271
Prefix Config Vars with REFLEX_
The environment variables defined in Config
will now be read with REFLEX_
as a prefix. Previous not prefixed names are still names but are deprecated.
Stronger type checking against partially filled variables
If you were unlucky enough, you might have written some code where you capture some arguments but reflex decides that it wants to give your event handler even more arguments. In these cases, we weren't checking the types of such arguments against the event callback. This now triggers a compilation error.
- add type checking for partially filled events by @adhami3310 in #5288
Ignore certain file formats from hot reload
Granian was reloading on more file formats than necessary, so we manually exclude a set of file formats that are unlikely to be a cause of hot reload. If you still notice weird hot reloads on file changes that are irrelevant to your application, we can append that list with more values.
- ignore certain file formats from granian hot reload by @adhami3310 in #5326
Tailwind V3 is now contained in a module (and rudimentary Reflex Plugin System)
We now have a basic plugins system with a few hooks. It's not very documented, but you can basically provide a list of plugins to the plugins argument in rx.Config
. You can add compile time hooks to create files, modify files, define stylesheets, define javascript dependencies, and more.
We moved our tailwind v3 code to use such plugin system. You should either set tailwind=None
inside of your rx.Config
or set plugins
to [rx.plugins.TailwindV3Plugin()]
. Automatic assumption of tailwind is deprecated.
We're also starting our work on Tailwind V4. You can try it by setting plugnis to rx.plugins.TailwindV4Plugin()
.
- move tailwind to its own module by @adhami3310 in #5169
- make sure the progress count is correct with plugins by @adhami3310 in #5327
- add config to tailwind v4 plugin by @adhami3310 in #5331
Bugfixes
- do not add auto setters on reflex states by @adhami3310 in #5314
- do not broadcast event to all clients if modify state is misused by @adhami3310 in #5322
- send empty files list by @adhami3310 in #5323
- do not delete the .web dir when init-ing by @adhami3310 in #5319
- fix typeddict as annotation by @Lendemor in #5324
Chores
- bump deps 0713 by @adhami3310 in #5309
- crack down on sets for uniqueness by @adhami3310 in #5316
- Use patch to precommit by @adhami3310 in #5279
- update radix deps to 0713 by @adhami3310 in #5335
Full Changelog: v0.7.12...v0.7.13
v0.7.12
Release Notes
Bugfixes
- [ENG-5784] Restrict
update_vars_internal
to browser storage vars by @masenf in #5293 - don't treat name with - differently by @adhami3310 in #5291
- Include required
jsx
andFragment
imports in ComponentVar by @masenf in #5294 - add responsive to vstack and hstack by @adhami3310 in #5298
- load mounts from environment variable for httpx by @adhami3310 in #5297
Chores
- bump to 0.7.12dev by @adhami3310 in #5287
- fix reflex-web ci not having requirements.txt by @adhami3310 in #5296
Full Changelog: v0.7.11...v0.7.12
v0.7.11
Release Notes
[DEPRECATION] rx.next.video
It wasn't particularly usable to begin with.
- deprecate next video by @adhami3310 in #5260
Slightly stronger hydration mismatch strictness
This will stop you from putting rx.el.p
inside of a rx.el.p
and such.
- add invalid children to html components by @adhami3310 in #5261
Add option to disable auto-setters
This can allow you to be more explicit on what public State fields can be set by the user.
- feat: allow disabling auto-setters via state_auto_setters config by @benedikt-bartscher in #4480
Use Javascript syntax over JSX
This shouldn't affect you, but our output code is now using normal Javascript and no JSX syntax. This solves some of the issues we had with context swapping between Vars and Components.
- don't use jsx syntax by @adhami3310 in #5127
Upgrade rx.icon
Lucide has updated their list of icons, and now those changes are available in Reflex.
- update lucide to 507.0 by @adhami3310 in #5269
- update to 508 lucide by @adhami3310 in #5275
Remove Cond as a Memoization leaf
This might improve the runtime performance of your frontend!
Optimizations
- β‘οΈ Speed up function
to_camel_case
by 128% by @misrasaurabh1 in #5239 - use knowledge about generic types to improve their getters and checkers by @adhami3310 in #5245
- optimize rx.color to not use validate literal parameters by @adhami3310 in #5244
Bugfixes
- fix tailwind for lucide icons by @adhami3310 in #5267
Misc
- update backend deps by @adhami3310 in #5250
- update bun version to 1.2.12 by @adhami3310 in #5254
- include symlink folder when running export/deploy by @Lendemor in #5256
- upgrade to nextjs 15.3.2 by @adhami3310 in #5268
Chores
- move coveragerc to pyproject by @adhami3310 in #5231
- i broke pre commit once again by @adhami3310 in #5264
- bump to 0.7.11 by @adhami3310 in #5265
- icons need pyi update by @adhami3310 in #5276
New Contributors
- @misrasaurabh1 made their first contribution in #5239
Full Changelog: v0.7.10...v0.7.11