* 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
* add immutable var class
* add missing docs
* override _replace
* fix type imports
* override create as well
* remove deprecated properties and arguments
* remove unused code in ImmutableVar
* fix namespace issue
* no Self in 3.8
Ensure that reflex.utils.compat is loaded whenever `reflex` itself is imported
to try and avoid the sqlmodel metaclass conflict error that arises when
sqlmodel is imported first with pydantic v2, but reflex Model inherits from
rx.Base which is based on pydantic v1.
Fix#3515
The formatting of the upload ID had extra single quotes that were not needed.
Now that `_var_name_unwrapped` is used, any `str`-like Vars will automatically
be formatted with backticks
* split lifespan and middleware logic in separate mixin files
* fix for 3.8
* fix for unit tests
* add missing sys import
---------
Co-authored-by: Masen Furer <m_github@0x26.net>
* pyi_generator: avoid fully qualified names for reflex. types
The previous method added quite a large line diff to the pyi files, so for now,
lets just add the `Breakpoints` import to the default set along with Var,
EventHandler, Style and others.
* pyi_generator: fix generated files using ruff
also generate updated pyi files in reflex/experimental namespace
* remove black from dev dependencies
* poetry.lock: relock deps
* Update all pyi files with new formatting
* pre-commit fixes
* pyi_generator: fix __init__.pyi files again
* implement basic behavior to handle both radix and css
* add all components in theme, AND change pyi to include path of reflex types
* order type annotations in pyi_generator (#3585)
* order type annotations in pyi_generator
* run pyi_generator
* classvars should not be backend vars (#3578)
* classvars should not be backend vars
* cleanup RESERVED_BACKEND_VAR_NAMES
* order type annotations in pyi_generator (#3585)
* order type annotations in pyi_generator
* run pyi_generator
* do not validate non-cached var deps (#3576)
* do not validate non-cached var deps
* further improve Exceptions for misconfigured var deps
* order type annotations in pyi_generator (#3585)
* order type annotations in pyi_generator
* run pyi_generator
* fix git merge remains
* define function globally
* use more modern annotations
* only trigger when direct value and not state
* simplify unions
* accidentally removed avatar oop
---------
Co-authored-by: benedikt-bartscher <31854409+benedikt-bartscher@users.noreply.github.com>
* add computed backend vars
* finish computed backend vars, add tests
* fix token for AppHarness with redis state manager
* fix timing issues
* add unit tests for computed backend vars
* automagically mark cvs with _ prefix as backend var
* fully migrate backend computed vars
* rename is_backend_variable to is_backend_base_variable
* add integration test for implicit backend cv, adjust comments
* replace expensive backend var check at runtime
* keep stuff together
* simplify backend var check method, consistent naming, improve test typing
* fix: do not convert properties to cvs
* add test for property
* fix cached_properties with _ prefix in state cls
* Clear color mode local storage
* use the last compiled time logic to determine when to clear local storage
* precommit fix
* app harness fix
* run prettier on reflex/.templates/web/utils/helpers/color_mode.js
* make sure last_compiled_time is updated for stateless apps as well.
* set the chkara-ui-color-mode cookie instead of clearing it, so it is integrated in the app's useEffect cycle
* fix CI
* fix import formatting
---------
Co-authored-by: Masen Furer <m_github@0x26.net>
* Automatic authentication for backend on Github Codespaces
When running reflex on Github codespaces, the port forwarding mechanism
requires authentication, which happens automatically when first accessing the
port via HTTPS; however since the backend connects over the WSS protocol
instead, it gets an access error with no way to redirect to Github's
authentication servers to get the port open.
This PR adds an automatic redirection mechanism to a backend route when there
is a connection error accessing the frontend. After the backend route loads, it
redirects back to the frontend, but now it can connect to the backend via
websocket because the port forward is authenticated.
* manually update .pyi file 🫨
* Dont escape backticks in JS string interpolation
* add unit tests
* Fix darglint
* add a note to re-visit after new Var API is implemented
* tests should have a good meaning