Commit Graph

76 Commits

Author SHA1 Message Date
jackie-pc
7388617b72
apps should no longer call "app.compile()" (#2291) 2023-12-18 16:06:21 -08:00
benedikt-bartscher
f90982ea06
use redis-py url syntax for redis_url (#2267)
* use redis-py url syntax for redis_url

* port is optional

* Add StateManagerRedis.close method

The close helper method always calls `close_connection_pool=True` so that all
outstanding redis operations can be stopped before changing event loops.

---------

Co-authored-by: Masen Furer <m_github@0x26.net>
2023-12-12 10:54:10 -08:00
Masen Furer
0bbae2d3d5
[REF-1404] router_data not updated when processing events (#2255) 2023-12-04 16:45:22 -08:00
Masen Furer
60147dec65
[REF-201] Separate on_load handler from initial hydration (#1847) 2023-11-30 12:21:15 -08:00
Elijah Ahianyo
e3ee98098a
RED-1052/rx.State as Base State (#2146) 2023-11-29 09:43:33 -08:00
Masen Furer
ee87e62efa
[REF-1035] Track ComputedVar dependency per class (#2067) 2023-11-27 18:17:53 -08:00
Masen Furer
1603144c7d
[REF-889] useContext per substate (#2149) 2023-11-21 11:52:06 -08:00
Nikhil Rao
33e4816950
Lazy import modules in reflex (#2144) 2023-11-13 19:48:12 -08:00
Masen Furer
92dd68c51f
Improve Var type handling for better rx.Model attribute access (#2010) 2023-10-25 11:55:50 -07:00
Masen Furer
1734ba0b6d
Generate state delta from processed state instance (#2023) 2023-10-24 10:44:12 -07:00
Masen Furer
f6a7eed359
Fix AppHarness tests (#1987)
* test_client_storage: remove race conditions for cookie assignment

Poll for default timeout for cookies to appear in the controlled browser.

* Remove use of deprecated get_token and get_sid in core

Both reflex.app and reflex.state were still using deprecated methods, which
were throwing unsolvable warnings for end users.

* Remove deprecated router functions from integration tests

Mostly removing custom "token" var and replacing with
router.session.client_token.

Also replacing `get_query_params` and `get_current_page` usage as well.

* fix upload tests

Cannot pass substate as main app state, since it blocks us from accessing
"inherited vars"

* state: do NOT reset `router` to default

When calling `.reset` to reset state vars, do NOT reset the router data, as
that could mess up internal event processing.
2023-10-18 01:46:13 +02:00
Thomas Brandého
b1bab1206d
deprecate get_ methods for router_data, use BaseVars instead (#1967) 2023-10-17 09:59:44 -07:00
Elijah Ahianyo
433ccda3a6
No state No Websocket (#1950) 2023-10-13 14:54:59 -07:00
Masen Furer
024cb5fa9b
Var field cleanup (#1943) 2023-10-13 14:53:55 -07:00
Masen Furer
43cc8d4f6c
test_state: assert popped value is the actual value (#1906) 2023-10-02 17:43:05 -07:00
Masen Furer
4b84c2a471
state: subclass of MutableState must return _mark_dirty return value (#1898) 2023-10-02 11:17:45 -07:00
Masen Furer
418f9ad569
state: get_value unwraps MutableProxy first (#1887) 2023-10-01 10:13:27 -07:00
Masen Furer
4f6b3c049b
State.reset uses deepcopy on defaults (#1889) 2023-09-29 16:33:16 -07:00
Masen Furer
5ca7f29853
MutableProxy wraps values yielded by __iter__ (#1876) 2023-09-28 17:34:46 -07:00
Thomas Brandého
dcb17103bb
code cleanup (split constants into a folder) (#1866) 2023-09-28 17:27:20 -07:00
Masen Furer
83d7a044fe
StateProxy rebinds functools.partial and methods that are bound to the proxied State (#1853) 2023-09-21 17:59:18 -07:00
Masen Furer
351611ca25
rx.background and StateManager.modify_state provides safe exclusive access to state (#1676) 2023-09-21 11:42:11 -07:00
Masen Furer
1bfb579b20
state: implement __copy__ and __deepcopy__ for MutableProxy (#1845) 2023-09-20 16:46:49 -07:00
Elijah Ahianyo
2750228dbb
Prevent Substate class shadowing (#1827) 2023-09-19 15:56:39 -07:00
Masen Furer
1430075bdc
Reassign state Var when fields on a Base instance change (#1748) 2023-09-18 13:52:10 -07:00
Masen Furer
71811a600c
Var: __bool__ and __iter__ always raise a TypeError (#1750) 2023-09-05 13:44:22 -07:00
wassaf shahzad
e99d6723bc
added changes for datetime (#1745)
* added changes for datetime

* fixed formatting

* fixed darglint issue

* test_state: check for other datetime module classes

* utils/types.py: use issubclass check

fix docstring copy/paste issue

* utils/format.py: reuse types.is_datetime check

---------

Co-authored-by: Masen Furer <m_github@0x26.net>
2023-09-04 22:29:02 -07:00
Masen Furer
b44c2176e0
Track var dependencies in comprehensions and nested functions (#1728) 2023-09-04 14:31:17 -07:00
Masen Furer
12e516da64
state: _init_event_handlers recursively (#1640) 2023-08-25 13:28:58 -07:00
Martin Xu
510b71e644
Check the yield/return from user defined event handlers are valid (#1614) 2023-08-18 01:36:30 -07:00
Elijah Ahianyo
2fa087a0fa
Event Handlers should not shadow base state methods (#1543) 2023-08-10 12:47:35 -07:00
Smit Parmar
ef78465f16
Added support for RelexSet wrapper (#1535) 2023-08-10 09:59:03 -07:00
Thomas Brandého
9222bbbdf2
fix state reset() (#1501) 2023-08-02 11:02:05 -07:00
jackie-pc
e6f4bcdb95
Github action to run unit tests on windows (#1444) 2023-07-28 11:12:01 -07:00
Elijah Ahianyo
3fa33bd644
List and Dict mutation on setattr (#1428) 2023-07-27 12:45:57 -07:00
Masen Furer
20e2a25c9a
vars: unbox EventHandler and functools.partial for dep analysis (#1305)
When calculating the variable dependencies of a cached_var, reach into objects
with .func or .fn attributes and perform analysis on those.

Fix #1303
2023-07-05 16:05:49 -07:00
Masen Furer
cd63297fe4
state: Leading underscore functions are not backend vars (#1268) 2023-06-28 15:32:49 -07:00
Elijah Ahianyo
be48e13c71
Remove cookies (#1223) 2023-06-27 18:04:29 -07:00
Nikhil Rao
139ce38df1
Rename pynecone to reflex (#1236) 2023-06-25 16:56:55 -07:00
Elijah Ahianyo
b6ae225455
Get Cookies (#1221) 2023-06-20 14:57:33 -07:00
Nikhil Rao
fedecfdf44
Fix processing flag for generator events (#1157) 2023-06-09 10:50:03 -07:00
Elijah Ahianyo
278222db8f
async tests to test yield functionality (#1163) 2023-06-07 11:50:27 -07:00
Nikhil Rao
895719cf68
Fix processing flag for generator event handlers (#1136) 2023-06-05 11:30:59 -07:00
Nikhil Rao
a18c6880b5
Add async events (#1107) 2023-06-01 21:47:55 -07:00
Elijah Ahianyo
bb1cf4322e
Foreach support for other data structures(dict, set, tuple) (#1029) 2023-05-17 16:11:41 -07:00
Masen Furer
0491852a45
@pc.cached_var: explicit opt-in for ComputedVar tracking (#1000) 2023-05-11 17:47:54 -07:00
iron3oxide
32f3a387ae
Rename var module to vars (#983) 2023-05-09 23:01:25 -07:00
Masen Furer
557097e2ca
ComputedVar dependency tracking: require caller to pass objclass (#963)
Avoid issue where a ComputedVar is added to to a class dynamically, but does
not have a reference to the class its attached to, but requiring callers of the
`deps()` method to provide the objclass for looking up recursive method calls.

This allows for safer and more simplified determination of dependencies, even
in highly dynamic environments.
2023-05-09 14:36:45 -07:00
Nikhil Rao
dc2dff9323
Temp remove computed var dependency checks (#972) 2023-05-08 18:00:03 -07:00
Nikhil Rao
8e3daf9f5b
Clean up on_load events (#965) 2023-05-08 12:13:51 -07:00