On py3.9 and py3.10, `dict[str, str]` and other typing forms are kinda
considered classes, but they still fail when doing `issubclass`, so
specifically exclude generic aliases before calling issubclass.
Fix#4424
Bonus fix: support upcasting of pydantic v1 and v2 models
* wip rx._x.asset improvements
* only add symlink if it doesn't already exist
* minor improvements, add more tests
* use deprecated Generator for python3.8 support
* improve docstring
* only allow explicit shared, only validate local assets if not backend_only
* fix darglint
* allow setting backend only env to false.
* use new is_backend_only in assets
* ruffing
* Move to `rx.asset`, retain old API in `rx._x.asset`
---------
Co-authored-by: Masen Furer <m_github@0x26.net>
* [ENG-3953] Support pydantic BaseModel (v1 and v2) as state var
Provide serializers and mutable proxy tracking for pydantic models directly.
* conditionally define v2 serializer
Co-authored-by: Khaleel Al-Adhami <khaleel.aladhami@gmail.com>
* Add `MutableProxy._is_mutable_value` to avoid duplicate logic
* Conditionally import BaseModel to handle older pydantic v1 versions
* pre-commit fu
---------
Co-authored-by: Khaleel Al-Adhami <khaleel.aladhami@gmail.com>
* Rework Init workflow
* minor format
* refactor
* add comments
* fix pyright alongside some improvements
* add demolink for blank template
* fix darglint
* Add more templates and keep template name in kebab case
* revert getting other templates since we'll use the submodules approach
* remove debug statement
* Improvements based on standup comments
* Add redirect logic
* changes based on new flow
---------
Co-authored-by: Masen Furer <m_github@0x26.net>
When an event/event spec is marked as "temporal", it will not be queued unless
the backend is up. This can be used to prevent periodic events (like from
`rx.moment`) from queueing up while the backend is down, and then stampeding
when the backend comes up and the queue is drained. It can be used to avoid
processing many periodic events at once when the app is only expecting to
process such an event every so often.
* Handle Var passed to `rx.toast`
If the user provides a `Var` for `message` then apply it as `props["title"]` to
avoid a var operations error.
* remove unnecessary parentheses
* remove weird hacks
* get it right pyright
---------
Co-authored-by: Khaleel Al-Adhami <khaleel.aladhami@gmail.com>
In some cases, a routing failure can cause the failure to be cached. When the
router has a cached failure, pushing such a route will never call
routeChangeComplete, and thus on_load event will never be fired for that route.
Purposely clearing the error from the router allows the page to properly load
on subsequent attempts without refreshing the app.
The `rich` module should be set to `None`, indicating that rich should not be used.
Setting it to `False` worked before, but recently added code in typer fails
when checking `if rich is not None`.
ref: https://github.com/fastapi/typer/pull/847
* add typing to function vars
* import ParamSpec from typing_extensions
* remove ellipsis as they are not supported in 3.9
* try importing everything from extensions
* special case 3.9
* don't use Any from extensions
* get typevar from extensions
Because of some dodgy logic in Base.get_value and State.dict / State.get_delta
when the value of some state var X happened to be the name of another var in
the state Y, then the value for X would be returned as the value of Y.
wat.
Fixes#4369
* Temporarily downpin @radix-ui/themes <3.1.5
A visual/style regression was introduced in @radix-ui/themes 3.1.5
as described in radix-ui/themes#627 which reflex needs to avoid.
* Get expected radix library version from component
* Astral 0.5.0 path change
https://github.com/astral-sh/uv/releases
Use XDG (i.e. ~/.local/bin) instead of the Cargo home directory in the installer
* Fix path in production-app-platform example
---------
Co-authored-by: Masen Furer <m_github@0x26.net>
These are useful for typing purposes and should be exposed at the top level to
avoid requiring deep imports from subpackages that we may need to change later.
* Codeblock cleanup in markdown
* Initial approach to getting this working with rx.memo and reflex web
* abstract the map var logic
* the tests are not valid + pyright fix
* darglint fix
* Add unit tests plus mix components
* pyi run
* rebase on main
* fix darglint
* testing different OS
* revert
* This should fix it. Right?
* Fix tests
* minor fn signature fix
* use ArgsFunctionOperation
* use destructured args and pass the tests
* fix remaining unit tests
* fix pyi files
* rebase on main
* move language regex on codeblock to markdown
* fix tests
---------
Co-authored-by: Khaleel Al-Adhami <khaleel.aladhami@gmail.com>