* 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
* add bare sqlalchemy session, Closes#3512
* expose sqla_session at module level, add tests, improve typing
* fix table name
* add model_registry fixture, improve typing
* did not meant to push this
* add docstring to model_registry
* do not expose sqla_session in reflex namespace
All major browser use a "bfcache" to freeze pages when navigating away from the
domain, then they restore the page when going back.
However if the page uses websockets, these get kind of stuck unless you
disconnect them before freezing (and have a mechanism for reconnecting, which
we already do).
Ref: https://web.dev/articles/bfcacheFix#3478
* StatefulComponent event handler useCallback dependency array
Ensure the useCallback dependency array for event handlers also handled
destructuring objects and the `...` rest parameter.
Avoid hooks that are not variable declarations.
* Abstract color_mode related Var creation
* Allow `set_color_mode` to take a parameter at compile time
* Update type hinting of `Var._replace` to indicate that it returns BaseVar
* color_mode_button with allow_system=True uses new set_color_mode API
`set_color_mode` is now a CallableVar and uses very similar logic internally,
so this bit of code can be replaced.
* Fix for pydantic v1.10.17
* Ignore type checking for generic aliases in _var_name_unwrapped
* Allow ClientStateVar.set_value to be used with text inputs
* client_state: If var_name is not provided, create a random name
* client_state: partition the arg value to get `_e0` from `_e0.target.value`
* upgrade to latest ruff
* try to fix dep review
* try to fix dep review (2)
* upgrade black
* upgrade black (2)
* update allowed dependencies
* update allowed dependencies (2)
* update allowed dependencies (3)
* wait between interim and final in yield test
* remove previous commit, increase delay between yield
* forgot to save on the time.sleep(1) removal
* fix integration (maybe?)
* fix pyi?
* what even is going on
* what is realityi?
* test another fix for app harness
* try to wait even longer?
* force uvloop to be optional
* downpin fastapi < 0.111, remove changes to test
* add allow_system prop to colormode iconbutton, and clean up logic
* remove segmentedcontrol change from this PR
* make it work for chakraColorProvider too
* add comment to explain resolved_color_mode
* test_background_task: dispatch multiple async tasks
Use asyncio.gather to dispatch multiple tasks from a single background task
that all compete over the `async with self` lock. Even though the state itself
has a lock, each StateProxy instance should only allow a single `async with
self` context to run at a time.
* Protect StateProxy with an asyncio.Lock
Allow multiple tasks to reference the same StateProxy without stomping on each
other when entering an `async with self` context to acquire the state lock and
ultimately modify the state.
* remove stroke and fill from label as they are unsupported by recharts
* refacted legend
* added props to reference line
* updated type for stroke_width, added stroke, updated type for x y
* added x y to reference dot
* updated reference area
* regenerated pyi
* new pyis
* regenerated pyi
---------
Co-authored-by: Hongyu Yao <hongyuyao@Hongyus-MacBook-Pro-3.local>
Co-authored-by: Hongyu Yao <hongyuyao@hongyus-mbp-3.lan>