* add more tests
* add tests to raise coverage
* more tests, bump coverage to 73
* fix up icon_button test
* fix darglint for app.py
* fix utcnow usage warning
* set threshold to 72
* fix timestamp
* fix unit tests for linux-redis
* removed commented code and put a TODO
* adjust share command prompt
* use lower case "y" for console.ask, keep order consistent as "y" then "n"
* share command update: do not suggest demo URL is mandatory, also move to the last question; when checking if user has permission to upsert package, do POST to record this package (if first time sharing)
* clean up prompt for preview image
* build pyi files when building/publishing 3rd party
* fix typo in workflow
* add future annotation
* add tests to pass coverage check
* add more unit tests
* omit pyi_generator from test coverage
* change black from dev deps to direct deps
* remake all pyi
* format pyi if black is present, return as if otherwise
* fix requested changes
---------
Co-authored-by: Masen Furer <m_github@0x26.net>
* Add test_get_state_from_sibling_not_cached
A better unit test to catch issues with refetching parent states
and calculating the wrong parent state names to fetch.
* _determine_missing_parent_states: correctly generate state names
Prepend only the previous state name to the current relative_parent_state_name
instead of joining all of the previous state names together.
* [REF-2219] Avoid refetching states that are already cached
The already cached states may have unsaved changes which can be wiped out if
they are refetched from redis in the middle of handling an event.
If the root state already knows about one of the potentially missing states,
then use the instance that is already cached.
Fix#2851
* Connection pulser only depends on has_connection_errors
Avoid showing the WiFi error icon when the state is hydrating / navigating
because not being hydrated is not indicative of a connection error in itself.
* Set is_hydrated=False at route onChangeStart
When navigation event starts, set is_hydrated=False on the client side before
any on_load event is dispatched. This avoids a flickering problem where the
client browser navigates and briefly shows content on the page before
processing on_load events associated with the page.
Fix#2885
* Update pyi
* Remove upper bounds of most dependencies.
Also adds a import try except block for pydantic.v1 and relocks.
Keep black and ruff to not mess to much with current formatting
Make pyright see the right import as long as constraint still lock pydantiv v1
Down pin pytest-asyncio again due to known issue
Fix upload handler with latest versions of fastapi
Change comment
* Add changed lockfile
* Set max versions for deps
* Revert app.pyi
---------
Co-authored-by: Malte Klemm <malte.klemm@blueyonder.com>
Co-authored-by: Nikhil Rao <nikhil@reflex.dev>
* [REF-2265] ComponentState: scaffold for copying State per Component instance
Define a base ComponentState which can be used to easily create copies of the
given State definition (Vars and EventHandlers) that are tied to a particular
instance of a Component (returned by get_component)
* Define `State` field on `Component` for typing compatibility.
This is an Optional field of Type[State] and is populated by ComponentState.
* Add integration/test_component_state.py
Create two independent counters and increment them separately
* Add unit test for ComponentState
* 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#1231
* Update pyi
* add command to share custom component info for gallery
* cleanup
* tested
* Update custom_components.py
Co-authored-by: Masen Furer <m_github@0x26.net>
* reorder the questions
* ask user to verify info before publishing
* remove questions already captured in pyproject.toml
* no need to cache form inputs since not many questions
* tested
* cleanup
* delete test
---------
Co-authored-by: Masen Furer <m_github@0x26.net>
* parse_args_spec: resolve annotations with typing.get_type_hints
Ensure that event trigger specs in modules with future annotations are resolved
correctly.
Fix#2848
* Fix arg spec for on_upload_progress event
Make py3.8 compatible with `get_type_hints`
In exec.py, run_process_and_launch_url already passes `shell=True` on windows,
but the AppHarness has never really been used on Windows, so we were missing
this detail.
Fix#2941
* When a Var points to a model, prefer access to model fields.
When a Var points to a model, and fields of the model share the same name as
Var operations, access to the model fields is now preferred to avoid having Var
operation names shadow model fields. Since most Var operations do not actually
work against Models, this does not really block any functionality.
* Special case for ComputedVar needing to internally access fget
Since fget is a "slot" on property, normal __getattribute__ access cannot find it.
* Workaround https://github.com/python/cpython/issues/88459
In python 3.9 and 3.10, the `isinstance(list[...], type)` returns True, but
it's not a valid class for use in issubclass
* Use dill instead of cloudpickle for serialization
* smaller size pickles
* support dynamically defined states
* avoid issues with unpickleable globals
* pyproject: add dill, remove cloudpickle
* poetry.lock: relock dependencies
* Dynamically convert EventHandler to functools.partial
Instead of converting the functions up front and assigning them to the
instance, unbox the function from the EventHandler when it is requested via
__getattribute__. This reduces the size of the per-instance pickle, because
event handler bodies do not need to be included.
* Improve checking for cython_function_or_method
Because pydantic can be installed without cython, only use the workaround in
the case where the BaseModel.validate function is NOT a FunctionType,
indicating it's a cython function.
* Serialize all State subclasses by reference
* remove codspeed.yml
* test upload job
* minor edits to get upload job working
* perhaps this works
* upload needs relex-install-size
* retrigger pipeline
* test only on ubuntu
* change to save to db directly
* oops
* size benchmarks
* .web for counter
* its timeout-minutes
* se integration.sh to run and kill process
* install psycopg2
* move .web runs to integration_tests.yml to save runners
* fix measurement-type for reflex-web
* add database url to env
* psycopg2
* test run ids
* commit sha gets the job done
* refactor
* add more matrices
* move reflex package size to integration_test.yml
* fix venv path
* test fix
* test fix
* use hyphen
* testing reflex build size
* ls for temp debug
* fix typo in command
* possible fix
* possible fix for windows
* remove dead code
* remove dead code
* remove unwanted comments
* refactor
* rebase on main
* pr_title
* remove pr_title from args
* debug
* should work now
* precommit fix
* print out package size for
* add shell
* test
* trying again
* dont use cached poetry to have accurate measurement of deps
* remove reflex deps calculation step from integration job
* fix script path
* precommit fix
* no real difference on different python versions so use 3.11.5
* remove ls keyword
* Benchmark add extra info on publishing data
* fix typo
* get file name for simplicity
* precommit fix
* removesuffix not in python3.8
* add pr_id in case the pr title is changed
* precommit fix