Release Notes
Improvements to Tailwind Config Wrapping
Thanks to @itsmeadarsh2008, the tailwind config got expanded:
plugins = [
"@tailwindcss/forms", # simple require
{
"name": "@heroui/theme",
"import": {"name": "heroui", "from": "@heroui/theme"},
"call": "heroui"
},
{
"name": "tailwindcss-theme-variants",
"import": {"name": "themeVariants", "from": "tailwindcss-theme-variants"},
"call": "themeVariants",
"args": {
"themes": {
"light": { "selector": ".light-theme" },
"dark": { "selector": ".dark-theme" }
}
}
}
]- Support for importing functions from tailwind plugins by @itsmeadarsh2008 in #5121
Enable Granian as default
We have had fixes going into Granian that should make the experience as good as it was on Uvicorn/Gunicorn and in some cases better. There are most certainly issues so feel free to report them and we will do our best to mitigate them.
- reattempt at granian as default by @adhami3310 in #5165
Include all rx.memo components in the build
This saves us from doing another scan to discover them.
This also adds the ability to call memoized components from dynamic components!
class State(rx.State):
name: str = "Bob"
@rx.var
def count(self) -> rx.Component:
return counter(
name=self.name,
)
@rx.memo
def counter(name: str):
return rx.hstack(
rx.button(name),
rx.button(f"Not {name}"),
)
def index():
return rx.vstack(rx.text("Who Are You?"), State.count)Deprecate .api in favor of api_transformer
If you were doing something like:
app = rx.App()
@app.api.get("/pong")
def pong():
return {"message": "pong"}You should instead do
fastapi_app = FastAPI()
@fastapi_app.get("/pong")
def pong():
return {"message": "pong"}
app = rx.App(api_transformer=fastapi_app)The api_transformer takes one or multiple (a list) of Starlette/FastAPI apps. It can also take a function that takes ASGIApp and returns a different ASGIApp that mounts the previous one. For example, the above code is equivalent to:
from reflex.utils.types import ASGIApp
fastapi_app = FastAPI()
@fastapi_app.get("/pong")
def pong():
return {"message": "pong"}
def fastapi_transformer(app: ASGIApp):
fastapi_app.mount("", app)
return app
app = rx.App(api_transformer=fastapi_transformer)- starlette over fastapi by @adhami3310 in #5069
- delay api mounting until app finishes compile by @adhami3310 in #5184
Raise error when using @rx.event with events starting with an underscore.
Private events is not a thing and this can help to error earlier.
- raise error on private events by @adhami3310 in #5152
Replace typer with click
In our quest to cut down on dependencies we are simplifying our CI across reflex and reflex-hosting-cli to use click over typer (which what typer uses under the hood).
- click over typer by @adhami3310 in #5154
- add no interactive back by @adhami3310 in #5191
Misc
- output a slightly more helpful error message when we cannot download … by @adhami3310 in #5140
- treat small tuples different with figure out type by @adhami3310 in #5161
- bump frontend deps and bun by @adhami3310 in #5162
Bugfixes
- handle deocrated pages better by @adhami3310 in #5159
- exit gracefully when set_focus is passed a nonexistent argument by @adhami3310 in #5149
- error when var is given something not a str by @adhami3310 in #5164
- ignore env var set to empty string by @adhami3310 in #5167
- fix upload on drop by @adhami3310 in #5160
- fix for set_focus not binding
thisby @adhami3310 in #5183 - restore get_decorated_pages behavior and deprecate it by @adhami3310 in #5194
Chores
- properly shutdown socketio and sqlalchemy async engine in AppHarness by @benedikt-bartscher in #5146
- bump to 0.7.9dev by @adhami3310 in #5145
- remove distro by @adhami3310 in #5158
- remove minor version from ci by @adhami3310 in #5163
- uv lock by @adhami3310 in #5176
New Contributors
- @itsmeadarsh2008 made their first contribution in #5121
Full Changelog: v0.7.8...v0.7.9