💪 Thanks to our amazing users and contributors!! 🙌 🐍
Known Regressions
* non-sqlite database access is not working 1661
Breaking Changes
Chained event handlers from `return` / `yield` must always be referenced from the State class, NOT the instance
python
class State(rx.State):
def handlerA(self):
...
def handlerB(self):
return self.handlerA() ❌ Will raise TypeError now!
def handlerC(self):
return State.handlerA() ✅ Always reference chained handlers by class
The exception will look like `TypeError: Your handler State.handlerB must only return/yield: None, Events or other EventHandlers referenced by their class (not using self)` and will occur *when the handler is called*, not at compile time.
Removal of `Config` knobs
- `admin_dash` - configure the admin dashboard via `rx.App` instead
- `backend_transports` - all connections will use websocket
- `cors_credentials`
- `db_config` - use `db_url` instead
- `env` - specify the run environment via CLI flags to `reflex run --env dev|prod`
- `env_path` - reading environment variables from a file is no longer supported (suggest use of `docker-compose` or simply `source` the env file before running `reflex`)
- `override_os_envs` - os environment variables will always take precedence
- `polling_max_http_buffer_size` - all connections will use websocket
New Features
Support f-string formatting of State vars
Frontend rendering functions can now make use of `f"built in {State.value}"` style formatting, instead of `+` concatenation.
Node.js is automatically installed on Windows (non-WSL)
Using the cross-platform `fnm` tool to facilitate automatic installation of node runtime on native windows platform, where previously a manual install was needed.
POSIX support for `fnm` to replace `nvm` is coming soon.
Display system and environment information with `--loglevel debug`
For easier bug reporting and investigations, all relevant platform info, config, and tools used by Reflex will be logged in debug mode.
`rx.selected_files` Var exposes files selected by the `rx.upload` component
This new Var can be rendered as a frontend component:
python
rx.foreach(
rx.selected_files,
rx.text,
)
Improvements
Frontend performance boost
Refactoring the main frontend event loop reduces event handling and rendering time by 3x.
Refactored `Config` class
Simplify configuration knobs and recognize all configuration values set as environment variables.
`rx.form` now works with more form components
Including `rx.pin_input`, `rx.number_input`, and `rx.range_slider`
More flexible container serialization inside State classes
- `set` is now supported as a `Var` type
- Recursive serialization now allows for `list`, `tuple`, and `set` of PIL image, plotly plots, and pandas dataframes.
Use “trailingSlash” mode to better support static site hosting
When exporting a site via `reflex export`, an `index.html` file will be created inside a directory for each static route, which makes hosting via s3, github pages, netlify, and others simpler by not requiring a “try_files” rule or rewrites.
`docker-example` is simplified and extended
The main `Dockerfile` is simpler and there is now a `compose.yaml` and `Caddy.Dockerfile` which can be used to deploy a reflex app with automatic TLS support.
Other Improvements
- Expose `debounce_timeout` prop on `rx.input` and `rx.text_area` for tuning fully-controlled input behavior on large sites.
- Ignore `*.db` and files in default `.gitignore` template
- `NoSSRComponent` supports components using either named or default exports.
Bug Fixes
- Flex `wrap` and `direction` props accept list of values, for use at different responsive breakpoints.
- Can specify `on_load` when defining a custom 404 page.
- Raise useful exception when a user-defined State var shadows an internal name.
- `BUN_PATH` is respected again (regression from 0.2.3)
- Var operations like `to_string`, `and`, and `or` return a new Var with the correct `type_` set.
- Passing a `dict` as a prop where the values contain double quotes is no longer an error. (Fix `rx.html` component where content contains double quotes)
Other Changes
* For show file on PyPI correctly, to use the full-path hyperlink to indicate the raw file by milochen0418 in https://github.com/reflex-dev/reflex/pull/1559
* PR zh/zh_tw readme update by milochen0418 in https://github.com/reflex-dev/reflex/pull/1557
* Add windows warning message. by Alek99 in https://github.com/reflex-dev/reflex/pull/1570
* Change fixture scope to be run per session rather than per function by mat-mil in https://github.com/reflex-dev/reflex/pull/1569
* App harness use new_process by picklelo in https://github.com/reflex-dev/reflex/pull/1573
* Update urls to reflex.dev by picklelo in https://github.com/reflex-dev/reflex/pull/1572
* Update CONTRIBUTING.md by Alek99 in https://github.com/reflex-dev/reflex/pull/1580
* Add AppHarness for form submit by Lendemor in https://github.com/reflex-dev/reflex/pull/1571
* FIXED 1598: pyproject.toml: Wrong repository URL by jenisys in https://github.com/reflex-dev/reflex/pull/1602
* test_dynamic_routes: fix flakyness in test_dynamic_routes by masenf in https://github.com/reflex-dev/reflex/pull/1603
* Fix rx.link href prop and Var.to_string type by picklelo in https://github.com/reflex-dev/reflex/pull/1600
* integration tests: don't shadow real error when screenshot fails by masenf in https://github.com/reflex-dev/reflex/pull/1608
* link: fix link with no href by masenf in https://github.com/reflex-dev/reflex/pull/1612
* Update .gitignore to ignore coverage.* files by martinxu9 in https://github.com/reflex-dev/reflex/pull/1623
* Remove unused `full_control` related code by martinxu9 in https://github.com/reflex-dev/reflex/pull/1624
* test_form_submit: poll for backend_state to be updated by masenf in https://github.com/reflex-dev/reflex/pull/1625
New Contributors
* Smit-Parmar made their first contribution in https://github.com/reflex-dev/reflex/pull/1535
* mat-mil made their first contribution in https://github.com/reflex-dev/reflex/pull/1568
* jenisys made their first contribution in https://github.com/reflex-dev/reflex/pull/1602
* martinxu9 made their first contribution in https://github.com/reflex-dev/reflex/pull/1614
* danik292 made their first contribution in https://github.com/reflex-dev/reflex/pull/1645
**Full Changelog**: https://github.com/reflex-dev/reflex/compare/v0.2.4...v0.2.5