Commit Graph

18 Commits

Author SHA1 Message Date
Thomas Brandého
462b023019
use add_imports everywhere () 2024-06-12 09:26:45 -07:00
Masen Furer
66f0a49b75
Pass _var_is_string parameter to Var.create () 2024-06-10 14:32:32 -07:00
Thomas Brandého
4b955d3831
clean up hooks and update component to use add_hooks () 2024-06-06 10:26:04 -07:00
Elijah Ahianyo
34bf25071a
[REF-2821]Improve Dynamic Imports ()
* Improve import times

* add lazy loading to rx.el

* add lazy loading to reflex core components

* minor refactor

* Get imports working with reflex web

* get imports to work with all reflex examples

* refactor to define imports only in the root.

* lint

* deadcode remove

* update poetry deps

* unit tests fix

* app_harness fix

* app_harness fix

* pyi file generate

* pyi file generate

* sort pyi order

* fix pyi

* fix docker ci

* rework pyi-generator

* generate pyi for __init__ files

* test pyright

* test pyright ci

* partial pyright fix

* more pyright fix

* pyright fix

* fix pyi_generator

* add rx.serializer and others

* add future annotation import which fixes container CI, then also load recharts lazily

* add new pyi files

* pyright fix

* minor fixes for reflex-web and flexdown

* forward references for py38

* ruff fix

* pyi fix

* unit tests fix

* reduce coverage to 68%

* reduce coverage to 67%

* reduce coverage to 66%as a workaround to coverage's rounding issue

* reduce coverage to 66%as a workaround to coverage's rounding issue

* exclude lazy_loader dependency review checks.

* its lazy-loader

* Add docstrings and regenerate pyi files

* add link

* address Pr comments

* CI fix

* partially address PR comments.

* edit docstrings and fix integration tests

* fix typo in docstring

* pyi fix
2024-05-31 16:43:10 +00:00
Masen Furer
c5f32db756
[REF-2787] add_hooks supports Var-wrapped hooks ()
* [REF-2787] add_hooks supports Var-wrapped hooks

* Fix VarData definition in .pyi file to allow removal of type ignore comments
* Var.create and Var.create_safe accept _var_data parameter
* Replace instances where a set of imports was being passed to VarData
* Update code throughout reduce use of `._replace` to add VarData

* Fixup: user hooks _var_data.imports will never be iterable, just a single ImportDict
2024-05-15 14:59:45 -07:00
Thomas Brandého
0c0477cffb
extend rx.input allowed types () 2024-04-24 16:04:56 -07:00
Martin Xu
5274f04b66
[REF-2296] Rename recursive functions () 2024-04-04 09:26:31 -07:00
Thomas Brandého
34ee07ecd1
use dict instead of set to store hooks () 2024-04-03 17:13:42 -07:00
Masen Furer
8ef193809c
textarea: expose auto_height and enter_key_submit props ()
* textarea: expose auto_height and enter_key_submit props

These two props improve the workflow for chat apps and other situations where
we want multiline input.

auto_height: resize the textarea based on its contents

enter_key_submit: pressing enter submits the enclosing form (shift+enter
inserts new lines)

Fix 

* Update pyi
2024-03-28 17:17:30 -07:00
Masen Furer
b89a18f632
Separate get_hooks and get_hooks_internal for stable output ()
* Separate `get_hooks` and `get_hooks_internal` for stable output

When downstream component wrappers depend on State when writing hooks, they
need to be assured that all internal hooks (events, var hooks, memoized
handlers, etc) will be rendered prior to user-defined hooks.

This also makes it less likely for downstream components to feel the need to
overwrite `get_hooks` (no underscore) directly and break internal functioning
of Reflex components.

* Include internal hooks in AppWrap and Page

* Apply get_hooks_internal in a few more places
2024-03-15 16:16:09 -07:00
benedikt-bartscher
19a5cdd408
Track state usage ()
* rebase

* pass include_children kwarg in radix FormRoot

* respect include_children

* ruff fixes

* readd statemanager init, run pyi gen

* minor performance imporovements, fix for state changes

* fix pyi and pyright

* pass include_children for chakra

* remove old state detection

* add test for unused states in stateless app

---------

Co-authored-by: Masen Furer <m_github@0x26.net>
2024-03-07 14:25:55 -08:00
Masen Furer
5d647a498f
[REF-1368] Move common form functionality to rx.el.forms ()
* [REF-1368] Move common form functionality to rx.el.forms

Allow plain HTML Form element to have magic on_submit event handler.

* Chakra and Radix forms inherit `on_submit` functionality from rx.el.form

Consolidate logic in the basic HTML form and use it in both Radix and Chakra
form wrappers.

* from __future__ import annotations for py38
2024-03-07 13:17:54 -08:00
Masen Furer
3c3c331856
[REF-2101] Support default_value and default_checked on rx.el.input () 2024-02-27 16:57:37 -08:00
Masen Furer
3136a86e58
[REF-1921] Remove HTML attributes that shadow CSS props () 2024-02-09 16:13:35 -08:00
Tom Gotsman
cb66933921
many small changes from going over all props () 2024-02-07 18:16:47 -08:00
Masen Furer
52d2bccbca
[REF-1746] Define value prop on base rx.el.textarea () 2024-01-26 15:11:22 -08:00
Thomas Brandého
a0bd83b915
add event triggers for base html components () 2023-12-07 11:22:40 -08:00
Alek Petuskey
88a3276356
HTML Refactor () 2023-11-20 15:16:03 -08:00