Commit Graph

113 Commits

Author SHA1 Message Date
Masen Furer
ae20644a82
Merge remote-tracking branch 'origin/main' into reflex-0.4.0 2024-02-08 10:17:34 -08:00
benedikt-bartscher
eabbbea171
fix EventHandlers and ComputedVars inherited by mixin classes (#2534)
* wip event handlers for state mixins

* fix computed vars, prepare event handler tests

* fix computed vars and event handlers inherited by mixins

* Base is not a mixin

* improve state inheritance tests

* wait for alerts to appear

* poll_for_content to fix flaky ci tests
2024-02-07 14:48:39 -08:00
Nikhil Rao
05d1be2182
Move core components to radix namespace (#2506) 2024-02-02 14:26:46 -08:00
jackie-pc
032017df3a
simple pytest benchmark for measuring event <=> state update round trip time (#2489) 2024-01-30 15:55:55 -08:00
Masen Furer
bece5bdb44
[REF-1632] Apply rx.App styles to Radix Themes root div (#2481) 2024-01-29 16:58:05 -08:00
benedikt-bartscher
5cc1ecfe4a
fix SmartDisplay visible parameter (#2451) 2024-01-24 17:41:16 -08:00
benedikt-bartscher
6401dc6a7f
extend state inheritance tests with non-computed vars (#2425) 2024-01-23 12:20:34 -08:00
benedikt-bartscher
ae1a6e1acc
inherit computed vars from state mixins (#2351) 2024-01-12 14:22:38 -08:00
Masen Furer
accaf6dc52
[REF-1365] Radix + Tailwind Compatibility (and allow tailwind to be completely disabled) (#2246) 2023-12-28 00:14:04 -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
Alek Petuskey
7164b91d7b
Implement Radix Themes (#2236) 2023-12-06 16:47:03 -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
a2d5bbc133
[reflex-web tweaks] Do not memoize children of InputGroup (#2230) 2023-11-30 09:48:28 -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
7eccc6d988
[REF-723+] Upload with progress and cancellation (#1899) 2023-11-16 15:46:13 -08:00
Masen Furer
9480f76a27
reflex_init_in_docker_test: export both frontend and backend (#2182) 2023-11-16 14:21:54 -08:00
Masen Furer
5e6520cb5d
Support Form controls via name attribute (no ID or ref) (#2012) 2023-11-10 12:58:59 -08:00
Alek Petuskey
dd982c5ace
Add benchmarking tests (#2143) 2023-11-08 17:41:08 -08:00
Nikhil Rao
6e1bce3412
Prompt for template on reflex init (#2122) 2023-11-03 13:37:01 -07:00
Masen Furer
b313aaf3ef
rx.call_script callback needs to await promises (#2121) 2023-11-02 14:37:02 -07:00
Masen Furer
bf20a530df
Do not stop prop is there is no prop to stop (#2116)
Check that desired event actions are defined on the object passed as the DOM
event before calling them to avoid frontend errors.
2023-11-02 10:21:41 -07:00
Masen Furer
56476d0a86
Expose DOM event actions on EventHandler, EventSpec, and EventChain (stopPropagation) (#1891)
* Expose preventDefault and stopPropagation for DOM events

All EventHandler, EventSpec, and EventChain can now carry these extra
"event_actions" that will be applied inside the frontend code when an event is
triggered from the DOM.

Fix #1621
Fix REF-675

* Test cases (and fixes) for "event_actions"

* form: from __future__ import annotations

for py38, py39 compat

* Revert overzealous merge conflict resolution
2023-10-31 11:42:42 -07:00
Masen Furer
f66c6c3361
Support callback for rx.call_script (#2045) 2023-10-26 17:54:48 -07:00
Masen Furer
21dbdc0103
Replace renamed Var.type_ with _var_type (#2039) 2023-10-26 12:34:00 -07:00
Masen Furer
93d19d6dc3
[REF-938] Fix up radix themes issues (#2002) 2023-10-24 14:29:54 -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
Masen Furer
c3f5f345bb
convert initialEvents to a function (#1982) 2023-10-17 10:39:56 -07:00
Masen Furer
67606561d3
[REF-668] Wrap MyApp with radix Theme component (#1867)
* partly add some radix-ui/themes based components

* add @radix-ui/themes integration to top-level app

* WiP: compile _app_wrap based on which component library is used

TODO: working color mode

* WiP get color mode working with agnostic provider

still not perfect, as the RadixColorModeProvider seems to trip hydration errors
when using color_mode_cond component, but for now, this provides a nice balance
between the two libraries and allows them to interoperate.

* WiP template _app.js instead of making a separate wrap file

* WiP: use next-themes for consistent darkmode switching

* strict pin chakra deps

* Move ChakraColorModeProvider to separate js file

* move nasty radix themes js code into js files

* remove chakra from default imports

* chakra fixup import to use .js extension

* Add radix theme typography and layout components

* do NOT special case the radix theme...

avoid templating json and applying it, avoid non-customizable logic

just add the radix Theme component as an app wrap if the user specifies it to
rx.App, and any other app-wrap theme-like component could _also_ be used
without having to change the code.

this also allows different themes for different sections of the app by simply
placing elements inside a different rdxt.theme wrapper.

* Theme uses "radius" not "borderRadius"

* move next-themes to main packages.json

this is always used, regardless of the component library

* test_app: test cases for app_wrap interface

* Finish wrapping Button, Switch, and TextField components

* docstring, comments, static fixups

* debounce: use alias or tag when passing child Element

Fix REF-830

* test_app: ruin my beautiful indentation

* py38 compatibility

* Add event triggers for switch and TextField

* Add type hints for radix theme components

* radix themes fixups from writing the tests

* Add integration test for radix themes components

* test_app: mock out package installation

we only need the compile result, we're not actually trying to install packages

* avoid incompatible version of @emotion/react

* test_radix_themes: include theme_panel component

* next-themes default scheme: "light"

until all of our components look good in dark mode, need to keep the default as
light mode regardless of the system setting.
2023-10-16 15:31:50 -07:00
Masen Furer
024cb5fa9b
Var field cleanup (#1943) 2023-10-13 14:53:55 -07:00
Elijah Ahianyo
26885d98cf
rx.table __bool__ regression fix (#1828) 2023-09-28 09:31:01 -07: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
Nikhil Rao
264c44e630
Disable metrics in CI (#1822) 2023-09-15 18:15:25 -07:00
Elijah Ahianyo
f2b0915aff
Type Validation for Var Operations and Enhanced Compatibility (#1674) 2023-09-12 15:57:40 -07:00
Elijah Ahianyo
891e6a4736
Allow underscores in routes (#1713) 2023-09-08 12:18:33 -07:00
Masen Furer
6fa9bfea09
Fix rx.Cookie with custom name (#1767) 2023-09-06 14:02:24 -07:00
Masen Furer
2e014422f5
App: only render default overlay_component when DefaultState is not used (#1744) 2023-09-05 16:22:25 -07:00
Masen Furer
38c5503f94
Client-side Routing (404 redirect) (#1695) 2023-09-05 16:22:00 -07:00
Thomas Brandého
63b5fbd7b0
add pyi_generator script (#1708) 2023-08-31 14:25:56 -07:00
Nikhil Rao
7d7b7901a9
Fix setting substate client storage (#1723) 2023-08-31 09:54:27 -07:00
Masen Furer
cc89f2b6e7
Proper serialization for chained Event payloads (#1725) 2023-08-31 09:50:15 -07:00
Masen Furer
99843d98af
debounce_input should respect child ref (#1717) 2023-08-30 12:46:55 -07:00
Masen Furer
9fbc75d84a
Client-side storage / State integration (#1629) 2023-08-30 12:43:29 -07:00
Masen Furer
2392c52928
Implement on_mount and on_unmount for all components. (#1636) 2023-08-30 09:50:39 -07:00
Martin Xu
51f0339fa4
Add special var for upload: clear_selected_files (#1703) 2023-08-28 17:15:31 -07:00
Masen Furer
042710ca91
Handle file uploads with component-local state (#1616) 2023-08-18 13:12:17 -07:00
Masen Furer
2613b865f2
test_form_submit: poll for backend_state to be updated (#1625) 2023-08-18 12:56:47 -07:00
Masen Furer
afcbe7e5a6
Move initial state to separate file (#1599) 2023-08-17 09:54:07 -07:00
Masen Furer
8c4183f500
integration tests: don't shadow real error when screenshot fails (#1608) 2023-08-16 13:05:36 -07:00
Nikhil Rao
00714c60ac
Fix rx.link href prop and Var.to_string type (#1600)
* Fix rx.link href prop

* Update bool var types
2023-08-16 11:41:19 -07:00
Masen Furer
8ce3ee19cc
fix flakyness in test_dynamic_routes (#1603) 2023-08-16 00:53:09 -07:00
Masen Furer
2ff823e89a
Event Loop Refactor (#1590) 2023-08-15 15:17:08 -07:00
Thomas Brandého
59132e533b
Add AppHarness for form submit (#1571) 2023-08-14 23:20:36 -07:00
Masen Furer
544d352e55
Run AppHarness selenium integration tests in CI (#1538) 2023-08-07 14:46:09 -07:00
Masen Furer
4a658ef9be
Wrap Input and TextArea with DebounceInput for full control (#1484) 2023-08-07 14:27:42 -07:00
Masen Furer
919f239168
check_initialized: skip REFLEX_DIR check for backend only (#1478) 2023-08-02 06:33:56 -07:00
Masen Furer
c11d9e657f
Disable fully controlled Input and TextArea (#1383) 2023-07-31 12:19:34 -07:00
Nikhil Rao
e26bba80a6
Create ~/.reflex directory and update integration tests (#1419) 2023-07-27 16:39:53 -07:00
Masen Furer
77c4451d24
integration/test_server_side_event.py: tests for set_value (#1390) 2023-07-21 11:50:51 -07:00
Masen Furer
2c97c1e7ca
reflex.testing.AppHarness: tools for testing reflex apps (#1326) 2023-07-13 15:45:57 -07:00