🙏 Thanks to our supportive community and helpful contributors! 💪
Breaking Changes
Default Websocket Endpoint is now /_event
#1542
Upload endpoint also moved to /_upload
.
Any reverse proxy configurations that were explicitly forwarding /event
and /upload
to the backend server should be updated to use the new endpoints.
- renamed reserved endpoints of Reflex by @Lendemor in #1542
- Caddyfile: reflex uses
/_event
and/_upload
now by @masenf in #1726
App
kwarg connect_error_component
is removed.
Use overlay_component
instead. (#1379)
New Features
Client-side Storage integrated with State #1629
- Allow
rx.LocalStorage
andrx.Cookie
type vars in a State class that are automatically persisted in the client browser when modified on the backend. - These values can be used in frontend or backend code just like any other state Var.
class State(rx.State):
my_token: rx.LocalStorage = ""
my_hour_cookie: rx.Cookie = rx.Cookie("initial", max_age=3600)
def set_token(self):
self.my_token = str(uuid.uuid4())
def update_cookie(self):
if self.my_hour_cookie == "initial":
self.my_hour_cookie = "updated"
Implement on_mount
and on_unmount
for all components #1636
These new event handlers, present on all components, tie into React’s useEffect
hook and are used to trigger backend events needed to initialize a component when it loaded in a page.
Note: on_mount
will fire twice in dev mode due to the use of React’s StrictMode.
Note: on_mount
will not fire for page navigation events between different params of the same dynamic route, since the page itself does not get reloaded so no remount occurs. For navigation events, see on_load
argument of app.add_page
.
FNM is now used to install nodejs on POSIX platforms
by @ElijahAhianyo in #1606 #1701
frontend_packages
are automatically determined #1607
frontend_packages
are inferred based on thelibrary
prop of a wrapped component, instead of having to specify them manually in therxconfig.py
file.- The
library
prop may now include a version pin, like **library =** "gridjs-react@^6.0.1"
- The
package.json
list of frontend dependencies only includes components that are actually used in the app, which decreases bundle size. - To include additional dependencies used by a component, specify them in the new
lib_dependencies
prop of the wrapped component.
Per-component prop autocompletion for IDEs #1708
Generated .pyi
files provide better function signatures for component create
methods, enumerating most recognized props.
Further enhancements will be supplied in a future release to include per-prop documentation and improved signatures for event handlers.
Support Breakpoints in VSCode and PyCharm #1653
- Breakpoints set in the IDE will be respected when running the project in dev mode. See DEBUGGING.md for an example.
Expose basePath
configuration option #1724
Support running multiple reflex apps from the same domain by changing the basePath
prefix that the frontend uses (by @nevdelap).
Improvements
- Validate component children by @ElijahAhianyo in #1647
- Refactor zipping in
reflex export
by @martinxu9 in #1668 - Avoid leaking secrets in log files and on the console.
- fix:issue-1667;added if condition check to not echo DB_URL by @shashank40 in #1681
- Automatically display a Modal when the backend is unable to connect.
- Add contains, reverse operations for Var by @martinxu9 in #1679
- Add special var for upload: clear_selected_files by @martinxu9 in #1703
- Support automatic serialization of date, datetime, time, and timedelta Vars in a State class.
- added changes for datetime by @wassafshahzad in #1745
- Raise TypeError when attempting to incorrectly use a state Var in a
bool
oriter
context. - Allow dynamic routes to work with static hosting (github pages, netlify, s3, etc)
Bug Fixes
- ReflexList: reassign field on
insert
by @masenf in #1652 - Allow event handlers in parent state to be directly called from child state.
- Allow
rx.form
to work with debounce inputs - Track var dependencies in comprehensions and nested functions by @masenf in #1728
- Proper serialization for chained Event payloads by @masenf in #1725
Minor Changes and Fixups
- Upgrade to v0.2.6 by @picklelo in #1669
- Revert "Use DebounceInput wrapper for fully controlled Editable" by @martinxu9 in #1670
- Use stream_logs for frontend process by @picklelo in #1682
- Fix run frontend only by @picklelo in #1706
- Update zh_cn README.md by @sszzz830 in #1685
- fix: correct the zh_cn README by @milochen0418 in #1716
- Fix setting substate client storage by @picklelo in #1723
- Avoid compile step when running production backend by @masenf in #1665
- AppHarness: disable telemetry for test apps by @masenf in #1733
- state: _init_mutable_fields for backend vars as well by @masenf in #1729
- Fix project hash and modernize type annotations by @picklelo in #1704
- Refactor: Move format_prop Static Method for Improved Reusability by @ElijahAhianyo in #1714
- ConnectionModal uses Cond for rendering by @masenf in #1739
- remove some packages requirements in frontend_packages option by @Lendemor in #1700
- App: only render default overlay_component when DefaultState is not used by @masenf in #1744
New Contributors
- @shashank40 made their first contribution in #1681
- @sszzz830 made their first contribution in #1685
- @nevdelap made their first contribution in #1724
Full Changelog: v0.2.6...v0.2.7