* 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>
* `rx.color_mode.icon`, `rx.color_mode.button` and `rx.color_mode.switch` should not require a backend`
* remove print statement
* unit tests and precommit fix
* add unit tests
* change logic to check if event handlers actually contain state. Also delay websocket object check in state.js so server side events can get executed for stateless apps
* make sure events are not queued for server side events particularly ones that call queueEvents(clear_local_storage, clear_cookies, remove_local_storage, remove_cookies) when the app is stateless(no ws)
* fix unit tests
* fix broken unit tests in test_app
* modify socket check in processEvent to only return if socket exists and theres any event in the queue that requires state
* Apply suggestions from code review
make queueEvent call async
Co-authored-by: Masen Furer <m_github@0x26.net>
* await queueEventIfSocketExists
* Revert "await queueEventIfSocketExists"
This reverts commit 9ef8070b87.
---------
Co-authored-by: Masen Furer <m_github@0x26.net>
1. Updated recharts version to the newest - recharts.py
2. Added `legend_type` back for cartesian class, it was currently commented out - cartesian.py
3. Added `vertical_points` and `horizontal_points` to CartesianGrid class - cartesian.py
4. Added `ticks` `tick` `tick_count` `tick_line` `tick_size` `min_tick_gap`props to Axis class - cartesian.py
5. Refactored `on_click` `on_mouse_down` `on_mouse_up` `on_mouse_move` `on_mouse_out` `on_mouse_enter` `on_mouse_leave` event triggers of `Axis` class using Masen's new method - cartesian.py
6. Added `on_animation_begin` and `on_animation_end` event trigger to `Bar(Cartesian)` class - cartesian.py
7. Added `id` `is_animation_active` `animation_begin` `animation_duration` `animation_easing` `unit` `min_point_size` `name` prop to `Bar(Cartesian)` class - cartesian.py.
8. Added `unit` `name` props to `Area(Cartesian)` class - cartesian.py
9. Added `unit` `name` props to `Line(Cartesian)` class - cartesian.py
10. Added `id` `is_animation_active` `animation_begin` `animation_duration` `animation_easing` props to `Scatter(Recharts)` class - cartesian.py
11. Refactored eventtriggers for `Scatter(Recharts)` class using Masen's new method - cartesian.py
12. Change the var type of stack_id in `Area(Cartesian)` class to be string and int, it used to be only a string. - cartesian.py
13. Added `name_key` prop and `on_animation_start` and `on_animation_end` prop to `Funnul(Recharts)` class cartesian.py
14. Added `on_mouse_down` `on_mouse_up` `on_mouse_over` `on_mouse_out` event triggers to `PieChart(ChartBase)` and also refactored using Masen's new method - Charts.py
15. Refaactored event triggers for referenceDot(Reference) class using Masen's new method. - Cartesian.py
16. Refactored event triggers for ChartBase(RechartsCharts) class using Masen's new method. - Cartesian.py
17. Refactored event triggers for Piechart(ChartBase) class using Masen's new method, Added `on_mouse_down` `on_mouse_up` `on_mouse_over` `on_mouse_out` event triggers - Cartesian.py
Co-authored-by: Hongyu Yao <hongyuyao@hongyus-mbp-3.lan>