* feat: Optionally comparing fields, e.g. on rx.Base based types.
* feat: Minimally invasive change.
Leave the current implementation as is. Added test.
* fix: Supporting old-school python versions.
* fix: Adding masenf's suggestions to use var instead of string.
When setting the font_family prop for a component, also set the radix token
`--default-font-family` so that child radix components will inherit the font.
Always treat ComponentState subclasses as mixin, and explicitly pass
`mixin=False` in `.create` classmethod when intentionally creating a substate.
This allows a "base" ComponentState to have subclasses that also work as
ComponentState themselves.
Fix#3368
* add support for lifespan tasks
* allow passing args to lifespan task
* add message to the cancel call
* allow asynccontextmanager as lifespan tasks
* Fix integration.utils.SessionStorage
Previously the SessionStorage util was just looking in localStorage, but the
tests didn't catch it because they were asserting the token was not None,
rather than asserting it was truthy.
Fixed here, because I'm using this structure in the new lifespan test.
* If the lifespan task or context takes "app" parameter, pass the FastAPI instance.
* test_lifespan: end to end test for register_lifespan_task
* In py3.8, Task.cancel takes no args
* test_lifespan: use polling to make the test more robust
Fix CI failure
* Do not allow task_args for better composability
---------
Co-authored-by: Masen Furer <m_github@0x26.net>
* wip connection toaster
* never duplicate toast for websocket-error
* wip update banner
* clean up PR
* fix for 3.8
* update pyi
* ConnectionToaster tweaks
* Use `has_too_many_connection_errors` to avoid showing the banner immediately
* Increase toast duration to avoid frequent, distracting flashing of the toast
* Automatically dismiss the toast when the connection comes back up
* Include `close_button` for user to dismiss the toast
* If the user dismisses the toast, do not show it again until the connection comes back and drops again
* Use `connection_error` var instead of a custom util_hook to get the message
* ConnectionPulser: hide behind toast
* Hide the connection pulser behind the toast (33x33)
* Add a title (tooltip) that shows the connection error
* Re-add connection pulser to default overlay_component
If the user dismisses the toast, we still want to indicate that the backend is
actually down.
* Fix pre-commit issue from main
---------
Co-authored-by: Masen Furer <m_github@0x26.net>
* Support replacing route on redirect
Support next/router `.replace` interface to change page without creating a
history entry.
* test_event: include test cases for new "replace" kwarg
New experimental feature to create client-side react state vars, save them in
the global `refs` object and access them in frontend rendering/event triggers
as well on the backend via call_script.
* [REF-2787] add_hooks supports Var-wrapped hooks
* Fix VarData definition in .pyi file to allow removal of type ignore comments
* Var.create and Var.create_safe accept _var_data parameter
* Replace instances where a set of imports was being passed to VarData
* Update code throughout reduce use of `._replace` to add VarData
* Fixup: user hooks _var_data.imports will never be iterable, just a single ImportDict
* typed mixins
* implicit mixin=True kwarg for ComponentState subclasses
* fix: always init other subclasses
* adjust tests: all mixins support base vars now
This change will add a new action to scan the dependency's licenses
for any that may not be allowed for this project.
The pip-licenses command was run to get a dump of all the licenses
associated with this repo and put into the allow-licenses list.
Normally, you might only want to use deny-licenses list, but for
packages like Redis, there is no defined SPDX identifier for it.
Note: this list will require future maintenance as dependencies get
added that are not already in the allow list.
https://spdx.org/licenses/https://github.com/raimon49/pip-licenses
Related to issue #2901
Signed-off-by: Eric Brown <eric_wade_brown@yahoo.com>
In order to improve build time performance, this change switches
usage of pip to uv. The uv command is a pip alternative promising
much faster installs of Python packages.
For more information on uv, see:
https://github.com/astral-sh/uvCloses: #2748
Signed-off-by: Eric Brown <eric_wade_brown@yahoo.com>
* Get `action` and `cancel` working for rx.toast
Respect defaults set in ToastProvider toast_options when firing a toast with
it's own ToastProps set.
* Update reflex/components/sonner/toast.py
Co-authored-by: Thomas Brandého <thomas.brandeho@gmail.com>
* Move queueEvent formatting into rx.utils.format module
Implement on_auto_close and on_dismiss callbacks inside ToastProps
* Update rx.call_script to use new format.format_queue_events
Replace duplicate logic in rx.call_script for handling the callback function.
* Move PropsBase to reflex.components.props
This base class will be exposed via rx._x.PropsBase and can be shared by other
wrapped components that need to pass a JS object full of extra props.
---------
Co-authored-by: Thomas Brandého <thomas.brandeho@gmail.com>
* Throw Warning for Projects Created in OneDrive on Windows
* precommit
* remove dead code
* REFLEX_USE_NPM escape hatch to opt out of bun
In some unsupported environments, we need to just not use bun. Further
investigation needed.
---------
Co-authored-by: Masen Furer <m_github@0x26.net>
The demo template includes a drop down menu item named Contact
has an email address to the founders. However, the email address
includes an extraneous = character in the domain part making it
invalid.
Signed-off-by: Eric Brown <eric_wade_brown@yahoo.com>