Commit Graph

15 Commits

Author SHA1 Message Date
benedikt-bartscher
f27eae7655
fix AppHarness reloading (#2916)
* move AppHarness tests to module scope

* fix AppHarness reloading

* add test

* docstrings and formatting

* fix benchmarks not reloading state module
2024-03-26 11:09:46 -07:00
Masen Furer
e3db9adc70
Fix py3.8 integration test_var_operations.py (#2858)
A newly added test was not py3.8 compatible and is breaking CI runs
2024-03-13 17:45:27 -07:00
Masen Furer
036afa951a
Make @rx.memo work with state vars passed as props (#2810)
* Make @rx.memo work with state vars passed as props

Seems like this was a regression from the StatefulComponent refactor, because
trying to pass a state Var to a CustomComponent gave undefined, likely due to
`_get_vars` not accounting for `self.props` in CustomComponents.

With this change, it works.

Integration test added to `test_var_operations.py`

* Allow CustomComponent props to be Component

Avoid calling `.json()` on all Base types because the Var serializer already
does that, but this way, more specific types (like Component) can be serialized
differently.

When the type is Component, attach a VarData with the imports and hooks to when
the Var is rendered, it also carries the correct imports/hooks and does not
throw frontend errors.
2024-03-13 13:41:17 -07:00
Masen Furer
eb18ce90d5
[REF-2172] Add DECORATED_PAGES before compiling in thread (#2841) 2024-03-12 10:28:37 -07:00
Nikhil Rao
05d1be2182
Move core components to radix namespace (#2506) 2024-02-02 14:26:46 -08:00
jackie-pc
7388617b72
apps should no longer call "app.compile()" (#2291) 2023-12-18 16:06:21 -08:00
Masen Furer
e52267477c
[REF-1417] Convert underscore-prefixed style props to pseudo selector (#2266) 2023-12-11 13:37:57 -08:00
Elijah Ahianyo
e3ee98098a
RED-1052/rx.State as Base State (#2146) 2023-11-29 09:43:33 -08:00
Masen Furer
527437cf23
[REF-144] Add context in each component to prevent rerenders (#2198) 2023-11-27 16:05:59 -08:00
Masen Furer
1603144c7d
[REF-889] useContext per substate (#2149) 2023-11-21 11:52:06 -08:00
Masen Furer
5e6520cb5d
Support Form controls via name attribute (no ID or ref) (#2012) 2023-11-10 12:58:59 -08: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
Nikhil Rao
8231993e5a
Improvements to custom styles in rx.markdown (#1852) 2023-09-25 15:59:48 -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
Elijah Ahianyo
f2b0915aff
Type Validation for Var Operations and Enhanced Compatibility (#1674) 2023-09-12 15:57:40 -07:00