* [REF-3184] Raise exception when encountering nested `async with self` blocks
Avoid deadlock when the background task already holds the mutation lock for a
given state.
* [REF-3339] get_state from background task links to StateProxy
When calling `get_state` from a background task, the resulting state instance
is wrapped in a StateProxy that is bound to the original StateProxy and shares
the same async context, lock, and mutability flag.
* If StateProxy has a _self_parent_state_proxy, retrieve the correct substate
* test_state fixup
* implement more literal vars
* fix super issue
* pyright has a bug i think
* oh we changed that
* fix docs
* literalize vars recursively
* do what masen told me :D
* use dynamic keys
* forgot .create
* adjust _var_value
* dang it darglint
* add test for serializing literal vars into js exprs
* fix silly mistake
* add handling for var and none
* use create safe
* is none bruh
* implement function vars and do various modification
* fix None issue
* clear a lot of creates that did nothing
* add tests to function vars
* added simple fix smh
* use fconcat to make an even more complicated test
* reflex.build polling: catch exceptions and retry
Extend interval to 2 seconds to reduce server load.
* Add function to check if a string looks like a generation hash
* reflex init: allow --template to be a generation hash if --ai is specified
* implement LiteralStringVar and format/retrieval mechanism
* use create safe
* add cached properties to ConcatVarOperation
* fix caches
* also include self
* fix inconsistencies in typings
* use default factory not default
* add missing docstring
* experiment with immutable var data
* solve pydantic issues
* add sorted function
* missing docs
* forgot ellipses
* give up on frozen
* dang it darglint
* fix string serialization bugs and remove unused code
* add returns statement
* whitespace moment
* add simple test for string concat
* export ConcatVarOperation
* define new JS-type var classes
* add docstring
* get rid of dataclass definitions and export all new vars
* order imports in the correct way
* only hash once
* implement format for immutable vars
* add some basic test
* make reference only after formatting
* win over pyright
* hopefully now pyright doesn't hate me
* forgot some _var_data
* i don't know how imports work
* use f_string var and remove assignments from pyi file
* override post_init to not break immutability
* add create_safe and test for it
* add module prefix to state names
* fix state names in test_app
* update state names in test_state
* fix state names in test_var
* fix state name in test_component
* fix state names in test_format
* fix state names in test_foreach
* fix state names in test_cond
* fix state names in test_datatable
* fix state names in test_colors
* fix state names in test_script
* fix state names in test_match
* fix state name in event1 fixture
* fix pyright and darglint
* fix state names in state_tree
* fix state names in redis only test
* fix state names in test_client_storage
* fix state name in js template
* add `get_state_name` and `get_full_state_name` helpers for `AppHarness`
* fix state names in test_dynamic_routes
* use new state name helpers in test_client_storage
* fix state names in test_event_actions
* fix state names in test_event_chain
* fix state names in test_upload
* fix state name in test_login_flow
* fix state names in test_input
* fix state names in test_form_submit
* ruff
* validate state module names
* wtf is going on here?
* remove comments leftover from refactoring
* adjust new test_add_style_embedded_vars
* fix state name in state.js
* fix integration/test_client_state.py
new SessionStorage feature was added with more full state names that need to be formatted in
* fix pre-commit issues in test_client_storage.py
* adjust test_computed_vars
* adjust safe-guards
* fix redis tests with new exception state
---------
Co-authored-by: Masen Furer <m_github@0x26.net>
If pydantic v1 is already installed, there is no reason to restore the original
pydantic modules, which seems to introduce subtle incompatibilities with some
pydantic versions.
Perform the pydantic version check early on and exit for v1 before doing
anything with the sys.modules.
Fix#3642
* fix axis orientation prop
* add margin prop explanation
* active bar and on animation start
* remove data key from y-axis
* precommit and pyi generator
---------
Co-authored-by: Tom Gotsman <tomgotsman@Toms-MacBook-Pro.local>
Co-authored-by: Tom Gotsman <tomgotsman@toms-mbp.lan>
* fix: unexpected kwargs raise type error, on _replace
* add: docstring for _replace, test for invalid kwargs replace
* add: parametrize var for replace test
* fix: computed_var _replace with invalid kwargs
* - added possibility to pass front- and backend exception handlers to rx.App
- wrapped the app with ErrorBoundary component to catch rendering errors
* added missing exception handler to reflex.app._process
* regenerated pyi
* fix unit tests for exception handler validation
* fix typing error in ErrorBoudary
* - fix error_bounday pyi
- minor refactoring of error boundary
- removed error boundary from 404 page
* added missing inspect module import after merging main
* fix typing error
* Clean up ErrorBoundary component
* Remove custom _render function
* Remove special imports in Component base class
* Simplify hooks for better composability
* test_exception_handlers: also test in prod mode
* fixed color prop
* fixed error boundary bug and removed hardcoding of the frontend event exception state
* formatted the code after conflict resolution
* fixed type of the error_boundary
* ruff format
---------
Co-authored-by: Maxim Vlah <m.vlah@senbax.de>
Co-authored-by: Masen Furer <m_github@0x26.net>
* feat: Adding an event to go back just as the user would.
* fix: Simplification suggested by masenf.
* fix: And now apply the fix to the right function.
* [REF-3067] Do not purge .web/pages in dev mode
Avoid race condition in hot reload that occurs when pages are removed before
they are recreated.
Fix#3416
* use constants instead of hardcoded string