Commit Graph

587 Commits

Author SHA1 Message Date
benedikt-bartscher
656914edef
fix rx.cond with ComputedVars and use union type (#3336) 2024-05-19 12:14:46 -07:00
Masen Furer
bc6f0f70cb
Support replacing route on redirect (#3072)
* Support replacing route on redirect

Support next/router `.replace` interface to change page without creating a
history entry.

* test_event: include test cases for new "replace" kwarg
2024-05-16 13:21:40 -07:00
Thomas Brandého
47043ae787
throw error for componentstate in foreach (#3243) 2024-05-15 17:59:23 -07:00
Masen Furer
c5f32db756
[REF-2787] add_hooks supports Var-wrapped hooks (#3248)
* [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
Masen Furer
3715462eb4
Allow Component.add_style to return a regular dict (#3264)
* Allow `Component.add_style` to return a regular dict

It's more convenient to allow returning a regular dict without having to import
and wrap the value in `rx.style.Style`.

If the dict contains any Var or encoded VarData f-strings, these will be picked
up when the plain dicts are passed to Style.update().

Because Style.update already merges VarData, there is no reason to explicitly
merge it again in this function; this change keeps the merging logic inside the
Style class.

* Test for Style.update with existing Style with _var_data and kwargs

Should retain the _var_data from the original Style instance

* style: Avoid losing VarData in Style.update

If a Style class with _var_data is passed to `Style.update` along with kwargs,
then the _var_data was lost in the double-splat dictionary expansion.

Instead, only apply the kwargs to an existing or new Style instance to retain
_var_data and properly convert values.

* add_style return annotation is Dict[str, Any]

* nit: use lowercase dict in annotation
2024-05-10 20:25:04 -07:00
Masen Furer
d767dc5fc7
[REF-2802] Foreach should respect modifications to children (#3263)
* Unit tests for add_style and component styles with foreach

The styles should be correctly applied for components that are rendered as part
of a foreach.

* [REF-2802] Foreach should respect modifications to children

Components are mutable, and there is logic that depends on walking through the
component tree and making modifications to components along the way. These
modifications _must_ be respected by foreach for consistency.

Modifications necessary to fix the bug:

* Change the hash function in `_render` to get a hash over the render_fn's
  `__code__` object. This way we get a stable hash without having to call the
  render function with bogus values.
* Call the render function once during `create` and save the result as a child
  of the Foreach component (tree walks will modify this instance).
* Directly render the original (and possibly modified) child component instead
  of calling the render_fn again and creating a new component instance at
  render time.

Additional changes because they're nice:

* Deprecate passing `**props` to `rx.foreach`. No one should have been
  doing this anyway, because it just does not work in any reasonable way.
* Raise `ForeachVarError` when the iterable type is Any
* Raise `ForeachRenderError` when the render function does not take 1 or 2 args.
* Link to the foreach component docs when either of those errors are hit.
* Change the `iterable` arg in `create` to accept `Var[Iterable] | Iterable`
  for better typing support (and remove some type: ignore comments)
* Simplify `_render` and `render` methods -- remove unused and potentially
  confusing code.

* Fixup: `to_bytes` requires `byteorder` arg before py3.11
2024-05-09 15:04:26 -07:00
Nikhil Rao
940afb2c92
Remove deprecations for 0.5.0 (#3222) 2024-05-07 08:55:42 -07:00
Masen Furer
83371d51d3
[REF-2658] Alembic should use batch mode for autogenerate (#3223) 2024-05-06 18:34:55 -07:00
Thomas Brandého
57476966f3
add_style api (#3202) 2024-05-06 16:59:11 -07:00
Elijah Ahianyo
0838e5ac6a
[REF-2676][REF-2751] Windows Skip ARM devices on bun install + Telemetry (#3212) 2024-05-06 09:50:05 -07:00
Elijah Ahianyo
9c7dbdbc72
[REF-2643] Throw Errors for duplicate Routes (#3155) 2024-05-03 12:15:40 -07:00
Nikhil Rao
7903a1020d
Clean up config and app API (#3197) 2024-05-02 18:15:28 -07:00
Masen Furer
c636c91c9c
[REF-2273] Implement .setvar special EventHandler (#3163)
* Allow EventHandler args to be partially applied

When an EventHandler is called with an incomplete set of args it creates a
partial EventSpec. This change allows Component._create_event_chain to apply
remaining args from an args_spec to an existing EventSpec to make it
functional.

Instead of requiring the use of `lambda` functions to pass arguments to an
EventHandler, they can now be passed directly and any remaining args defined in
the event trigger will be applied after those.

* [REF-2273] Implement `.setvar` special EventHandler

All State subclasses will now have a special `setvar` EventHandler which
appears in the autocomplete drop down, passes static analysis, and canbe used
to set State Vars in response to event triggers.

Before:
    rx.input(value=State.a, on_change=State.set_a)

After:
    rx.input(value=State.a, on_change=State.setvar("a"))

This reduces the "magic" because `setvar` is statically defined on all State
subclasses.

* Catch invalid Var names and types at compile time

* Add test cases for State.setvar

* Use a proper redis-compatible token
2024-05-01 17:13:55 -07:00
benedikt-bartscher
9ead091fec
Improved get_attribute_access_type tests (#3180)
* test get_attribute_access_type against attrs

* add union and hybrid_property tests
2024-05-01 17:13:23 -07:00
khhan0130
be93b1280c
Update CodeBlock class to accept rx.color in custom_style (#3168) 2024-05-01 14:48:33 -07:00
Masen Furer
19d8f6c752
[REF-2523] Implement new public Component API (#3203) 2024-05-01 14:46:27 -07:00
benedikt-bartscher
e31b458a69
allow optional props with None default value (#3179) 2024-05-01 13:33:38 -07:00
Masen Furer
b7e85ecec4
[REF-2574] Default width for Stack (+children) and default padding for container (#3104) 2024-04-30 13:15:57 -07:00
Masen Furer
3564df7620
Implement throttle and debounce as event actions (#3091) 2024-04-26 17:28:51 -07:00
benedikt-bartscher
c2017b295e
Improved get_attribute_access_type (#3156) 2024-04-26 17:28:30 -07:00
Masen Furer
0a8aaea599
[REF-2682] Foreach over dict uses Tuple arg value (#3160)
* test_foreach: assert on arg _var_type

* [REF-2682] Foreach over dict uses Tuple arg value

When iterating over a Var with _var_type dict, the resulting arg value
_var_type should be Tuple[key, value] so it can be correctly used with other
var operations.

Fix #3157

* Correct _var_type for iteration over Tuple of multiple types

The arg value when iterating over a tuple could be any of the possible values
mentioned in the annotation.

When only one type is used, the Union collapses to the base type, at least in py3.11

* Add comments
2024-04-25 09:10:55 -07:00
Thomas Brandého
ac36bfc6ea
Radix 3.0 (#3159) 2024-04-25 08:33:29 -07:00
Ogidi Ifechukwu
ce2bd2286e
Refactor upload component and add styled upload component (#3035) 2024-04-24 13:45:22 -07:00
Jirka Borovec
4d567b7ec1
ruff-format: unify Black with Ruff v0.1 (#2837)
* ruff-format: unify Black with Ruff

* ruff lint.

* v0.1.0

* run precommit

* hand fixing

* fix `not isinstance(...)`

Co-authored-by: Thomas Brandého <thomas.brandeho@gmail.com>

* rev isinstance(...) with noqa

* exclude = ["*.pyi"]

* apply precommit

* apply format

* revert pyi

* fixing

* Fix or

Co-authored-by: Thomas Brandého <thomas.brandeho@gmail.com>

* Update reflex/components/datadisplay/code.pyi

* Apply suggestions from code review

Co-authored-by: Thomas Brandého <thomas.brandeho@gmail.com>

* Update tests/components/core/test_colors.py

* Update reflex/app.py

* Update reflex/app.py

* Update benchmarks/test_benchmark_compile_pages.py

* Update benchmarks/test_benchmark_compile_pages.py

* Update benchmarks/test_benchmark_compile_pages.py

---------

Co-authored-by: Thomas Brandého <thomas.brandeho@gmail.com>
2024-04-23 14:40:06 -07:00
Elijah Ahianyo
8e4d6a4781
[REF-2636]Improve Error message for unsupported event trigger (#3147)
* Improve Error message for unsupported event trigger

* typo fix

* fix ci

* add tests

* Update reflex/components/component.py

Co-authored-by: Masen Furer <m_github@0x26.net>

* fix typo

---------

Co-authored-by: Masen Furer <m_github@0x26.net>
2024-04-23 14:36:26 -07:00
Martin Xu
c567334c92
allow set in var.contains (#3113)
* allow set in var.contains

* fix UT
2024-04-18 20:00:18 -07:00
Masen Furer
fc0be257a3
Fix annotated EventHandler (#3076) 2024-04-11 15:34:00 -07:00
Elijah Ahianyo
04ab2b9a71
[REF-2524] Tuple unpacking should apply at component level (#3062) 2024-04-11 14:04:19 -07:00
Masen Furer
1a11941577
[REF-2392] Expose next.config.js transpilePackages key (#3006) 2024-04-11 13:50:42 -07:00
Masen Furer
d7abcd45de
Force pydantic v1 for sqlmodel compatibility (#3026) 2024-04-11 13:42:30 -07:00
wassaf shahzad
9073a2781b
added serializer for enums (#3058) 2024-04-09 21:13:43 -07:00
Elijah Ahianyo
fdc944e002
Literal Error Formatting (#3037) 2024-04-08 11:29:40 -07:00
Martin Xu
5274f04b66
[REF-2296] Rename recursive functions (#2999) 2024-04-04 09:26:31 -07:00
Thomas Brandého
bf0ebb8d09
Lendemor/improve coverage (#2988)
* 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
2024-04-04 14:31:43 +02:00
Thomas Brandého
34ee07ecd1
use dict instead of set to store hooks (#2995) 2024-04-03 17:13:42 -07:00
Elijah Ahianyo
d43a85bab2
Unpack component tuples in a fragment (#2985) 2024-04-03 10:44:04 -07:00
Aman Salwan
0e221f0984
Logic for removing the 'None' property along with its corresponding test case. (#2969) 2024-04-02 11:37:05 -07:00
Martin Xu
6d400eddc9
Revert "[REF-2269] Add add_imports API for component class (#2937)" (#2978)
This reverts commit 8edd1dfdc9.
2024-04-01 15:57:03 -07:00
Thomas Brandého
0af4770180
generate pyi files when building/publishing 3rd party component (#2945)
* 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>
2024-03-29 09:54:21 -07:00
Masen Furer
55b0fb36e8
[REF-2219] Avoid refetching states that are already cached (#2953)
* 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
2024-03-29 09:42:25 -07:00
Malte Klemm
86526cba51
[REF-2127] Loosen requirements (#2796)
* 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>
2024-03-29 09:26:53 -07:00
Masen Furer
5510eaf820
[REF-2265] ComponentState: scaffold for copying State per Component instance (#2923)
* [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
2024-03-29 09:22:25 -07:00
Martin Xu
f372402ee4
[REF-2272] Support declaring EventHandlers directly in component (#2952) 2024-03-29 06:26:07 -07:00
Martin Xu
68c56a9811
[REF-2168] Add share options to custom component commands (#2883)
* 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>
2024-03-28 15:13:37 -07:00
Martin Xu
8edd1dfdc9
[REF-2269] Add add_imports API for component class (#2937) 2024-03-28 11:03:26 -07:00
Thomas Brandého
1810288007
remove inheritance from Flex for list components (#2936) 2024-03-28 10:58:36 -07:00
Masen Furer
b788890696
[REF-2089] Use dill instead of cloudpickle for serialization (#2922)
* 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
2024-03-27 13:47:33 -07:00
Thomas Brandého
f19a6a8c8d
use radix box instead of chakra one for responsive elements (#2921) 2024-03-25 15:16:48 -07:00
Masen Furer
432fcd4a5b
Account for imports of @rx.memo components for frontend package installation (#2863)
* CustomComponent ignores the annotation type in favor of the passed value

Do not require rx.memo wrapped functions to have 100% correct annotations.

* test_custom_component_get_imports: test imports from wrapped custom components

* Account for imports of custom components for frontend installation

Create new ImportVar that only install the package to avoid rendering the
imports in the page that contains the custom component itself.

* Handle Imports that should never be installed

* Fix up double negative logic

* Perf Optimization: use the imports we already calculate during compile

Instead of augmenting _get_imports with a weird, slow, recursive crawl and
dictionary reconstruction, just use the imports that we compile into the
components.js file to install frontend packages needed by the custom
components.

Same effect, but adds essentially zero overhead to the compilation.
2024-03-15 09:59:59 -07:00
Thomas Brandého
92db402539
telemetry refactor + unit tests (#2786) 2024-03-13 12:38:54 -07:00
Masen Furer
c809107d09
[REF-2158] Enable state when on_load or event_triggers are set. (#2815)
* [REF-2158] Enable state when `on_load` or event_triggers are set.

Basically all events in a reflex app require the backend to be up, even the
built-in server side events round trip to the backend and require "state" even
if no user-defined state classes are declared.

test_app_state_determination: checking that state is enabled at the right time

* Clear out DECORATED_PAGES when initializing a new app
2024-03-08 17:34:09 -08:00
Martin Xu
bf297e2f5b
[REF-2141] Custom component command improvements (#2807)
* add custom component command improvements

* fix test

* fix regex to include both single/double quotes
2024-03-07 20:42:22 -08:00
benedikt-bartscher
19a5cdd408
Track state usage (#2441)
* 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
4f12d2e269
Fix infinite recursion when a substate named "state" has a computed var (#2778)
* test_potentially_dirty_substates: when a state named State should be computed

Catch a regression introduced in 0.4.3a1

* _potentially_dirty_substates: qualify substate name

When looking up substate classes, ensure the qualified name is used to avoid
issues with same-named substates.
2024-03-04 13:13:08 -08:00
macmoritz
9e0452beb0
pass lang and custom_attrs from app to html root (#2697)
* pass lang and custom_attrs from app to html root

* fix some pre-commit errors and try adding lang

* fix tests

* really fix test

* cleanup with @benedikt-bartscher

* fix props and tests

* use str instead of var

* change typing of html_custom_attrs to not allow Vars
2024-03-03 13:51:20 -08:00
wassaf shahzad
0a18eaa28b
DRAFT PR - Added code for computed backend vars (#2540)
* added code for computed backend vars

* fixed formatting issues

* fix small bug

* fixes ruff issue

* fixed black issue

* augment test for backend computed var

---------

Co-authored-by: Masen Furer <m_github@0x26.net>
2024-02-29 13:00:41 -08:00
benedikt-bartscher
2d56441a28
fix black+ruff (#2750) 2024-02-28 14:51:50 -08:00
Amir Molavi
842c7e6882
Add config to rx.plotly component (#2745) 2024-02-28 12:44:33 -08:00
Masen Furer
deae662e2a
[REF-1988] API to Get instance of Arbitrary State class (#2678)
* WiP get_state

* Refactor get_state fast path

Rudimentary protection for state instance access from a background task
(StateProxy)

* retain dirty substate marking per `_mark_dirty` call to avoid test changes

* Find common ancestor by part instead of by character

Fix StateProxy for substates and parent_state attributes (have to handle in
__getattr__, not property)

Fix type annotation for `get_state`

* test_state: workflow test for `get_state` functionality

* Do not reset _always_dirty_substates when adding vars

Reset the substate tracking only when the class is instantiated.

* test_state_tree: test substate access in a larger state tree

Ensure that `get_state` returns the proper "branch" of the state tree depending
on what substate is requested.

* test_format: fixup broken tests from adding substates of TestState

* Fix flaky integration tests with more polling

* AppHarness: reset _always_dirty_substates on rx.State

* RuntimeError unless State is instantiated with _reflex_internal_init=True

Avoid user errors trying to directly instantiate State classes

* Helper functions for _substate_key and _split_substate_key

Unify the implementation of generating and decoding the token + state name
format used for redis state sharding.

* StateManagerRedis: use create_task in get_state and set_state

read and write substates concurrently (allow redis to shine)

* test_state_inheritance: use polling cuz life too short for flaky tests

kthnxbai ❤️

* Move _is_testing_env to reflex.utils.exec.is_testing_env

Reuse the code in app.py

* Break up `BaseState.get_state` and friends into separate methods

* Add test case for pre-fetching cached var dependency

* Move on_load_internal and update_vars_internal to substates

Avoid loading the entire state tree to process these common internal events. If
the state tree is very large, this allow page navigation to occur more quickly.

Pre-fetch substates that contain cached vars, as they may need to be recomputed
if certain vars change.

* Do not copy ROUTER_DATA into all substates.

This is a waste of time and memory, and can be handled via a special case in
__getattribute__

* Track whether State instance _was_touched

Avoid wasting time serializing states that have no modifications

* Do not persist states in `StateManagerRedis.get_state`

Wait until the state is actually modified, and then persist it as part of `set_state`.

Factor out common logic into helper methods for readability and to reduce
duplication of common logic.

To avoid having to recursively call `get_state`, which would require persisting
the instance and then getting it again, some of the initialization logic
regarding parent_state and substates is duplicated when creating a new
instance. This is for performance reasons.

* Remove stray print()

* context.js.jinja2: fix check for empty local storage / cookie vars

* Add comments for onLoadInternalEvent and initialEvents

* nit: typo

* split _get_was_touched into _update_was_touched

Improve clarity in cases where _get_was_touched was being called for its side
effects only.

* Remove extraneous information from incorrect State instantiation error

* Update missing redis exception message
2024-02-27 13:02:08 -08:00
Masen Furer
350a051a45
[REF-1741] Disallow routes with /api prefix (#2711) 2024-02-26 19:34:51 -08:00
Thomas Brandého
0464a7723e
remove chakra from markdown component_map (#2709) 2024-02-26 19:34:22 -08:00
wassaf shahzad
4d3d9aa717
added accent option in color (#2713) 2024-02-25 19:47:56 -08:00
benedikt-bartscher
95287e7a98
fix type of value2 (#2708) 2024-02-24 13:56:48 -08:00
benedikt-bartscher
93f402c773
Initial values for computed vars (#2670)
* initial values for computed vars draft

* add tests, add computed_var overloads

* fix darglint

* pass initial to substates when calling dict

* add tests for for child states

* format black

* allow None as initial value

* rename runtime_only to raises_at_runtime

* cleanup unused arguments of ComputedVars

* refactor cached_var to be partial of computed_var
2024-02-24 13:45:07 -08:00
Masen Furer
953495775d
[REF-2045] Implement __reduce_ex__ for MutableProxy (#2688)
* test_state: augment modify_state test for writing MutableProxy

If the object contains a MutableProxy inside of it, then we get a pickling
error.

* Implement __reduce_ex__ for MutableProxy

Pass through `__reduce_ex__` onto the wrapped instance to strip it off when
cloudpickling to redis.

* base: get_value actually works with a str key

Unless the key isn't a field on the model, then it falls back to the previous
behavior of just returning the given key as is... why does it do this? I don't
know.
2024-02-22 10:14:14 -08:00
Masen Furer
756bf9b0f4
[REF-1885] Shard Substates when serializing to Redis (#2574)
* Move sharding internal to StateManager

Avoid leaking sharding implementation details all over the State class and
breaking the API

* WiP StateManager based sharding

* Copy the state __dict__ when serializing to avoid breaking the instance

* State tests need to pass the correct substate token for redis

* state: when getting parent_state, set top_level=False

ensure that we don't end up with a broken tree

* test_app: get tests passing with redis by passing the correct token

refactor upload tests to suck less

* test_client_storage: look up substate key

* state.py: pass static checks

* test_dynamic_routes: working with redis state shard

* Update the remaining AppHarness tests to pass {token}_{state.get_full_name()}

* test_app: pass all tokens with state suffix

* StateManagerRedis: clean up commentary
2024-02-21 01:50:25 -08:00
wassaf shahzad
0b771db10a
fixed bug in var type for iterable types (#2617)
* fixed bug in var type for iterable types

* added test cases

* formatting issue

* fixed black formatting  issues
2024-02-20 15:02:20 -08:00
Masen Furer
3350fa0388
Component: translate underscore suffix for props supported by chakra (#2636)
* Component: translate underscore suffix for props supported by chakra

type_ becomes type
min_ becomes min
max_ becomes max
id_ becomes id

The deprecation warning is only displayed when the underscore suffix prop is
passed and the non-underscore suffix prop is defined on the given component.

* Rename type_ to type in accordion and scroll_area

All of the new radix components avoid the underscore suffix names where
possible.

* Update deprecation warning wording

* Refactor for readability

* Do not raise deprecation warning for `id_`

id is kind of a special prop because it exists on all components

* Add test case for deprecating underscore suffix props
2024-02-15 20:46:06 -08:00
Nikhil Rao
7240f8ee6f
Handle component namespaces in global styles (#2630) 2024-02-15 16:03:10 -08:00
Masen Furer
f12746d859
Inherit _rename_props from parent classes (#2613)
Ensure that _rename_props from base classes add to the list of _rename_props in subclasses.

Add a test case to validate this behavior.
2024-02-14 14:36:01 -08:00
invrainbow
e729a315f8
Fix fstrings being escaped improperly (#2571) 2024-02-13 14:32:44 -08:00
Elijah Ahianyo
5e9b472d1b
[REF-1919] Valid Children/parents to allow Foreach,Cond,Match and Fragment (#2591) 2024-02-13 14:22:22 -08:00
Masen Furer
4206afeb7b
[REF-1958] Remove shadowed radix css props (#2590)
* style: shorthand replacements need camelCase

Avoid warning on terminal and in browser console from using kebab-case CSS
props with emotion.

* _rename_props only replace prop name once

In case the value also contains the prop name, we don't want to replace it
multiple times.

* pyi_generator: ignore _rename_props in create signature

* Avoid shadowing CSS prop `display` and `gap`

Replace usages of `gap` with `spacing` to retain Radix sizing number system,
while allowing users to specify a responsive `gap` using CSS units.

Remove `display` props from radix components, allowing `display` to accept
responsive lists.

* checkbox: apply `gap` to `flex` if provided

* Remove _rename_props from .create signatures

* Fix spacing prop in blank template

* Fixup tests after changing style shorthand to return camelCase
2024-02-13 10:06:28 -08:00
invrainbow
61234ae164
Fix operator precedence (#2573) 2024-02-12 19:30:25 -08:00
Masen Furer
58b5e2f5bd
Merge remote-tracking branch 'origin/main' into reflex-0.4.0 2024-02-09 19:38:35 -08:00
Elijah Ahianyo
ccc9c32c95
Get rx.color working with fstrings (#2562)
* fix for rx.color working with fstrings

* Fix fstrings issues
2024-02-09 17:06:55 -08:00
Masen Furer
78c54b3486
Use rx.el.img as rx.image (#2558)
* Use rx.el.img as rx.image

* Update test_image to work with plain rx.el.img
2024-02-08 14:44:53 -08:00
Masen Furer
d28109f4c4
Merge remote-tracking branch 'origin/main' into reflex-0.4.0 2024-02-08 11:54:02 -08:00
Elijah Ahianyo
601dd34792
rx.color to work with conditional vars (#2546) 2024-02-08 11:45:15 -08:00
Masen Furer
b607531318
Unbreak tests after recent changes in main (p2) 2024-02-08 10:46:40 -08:00
Masen Furer
c596651de6
Fix pre-commit issues introduced from merging origin/main 2024-02-08 10:28:45 -08:00
Masen Furer
c124650082
Merge remote-tracking branch 'origin/main' into reflex-0.4.0 2024-02-07 13:53:39 -08:00
Elijah Ahianyo
ce867d2f81
Support for Shorthand css props. (#2547) 2024-02-07 12:05:04 -08:00
Nikhil Rao
eacd534137
Increase debounce timeout to 300ms (#2541) 2024-02-07 11:55:43 -08:00
Nikhil Rao
e2c3081d1e
Remove focus-visible package (#2535) 2024-02-06 11:36:12 -08:00
Masen Furer
660113fcf9
Merge remote-tracking branch 'origin/main' into reflex-0.4.0 2024-02-05 11:41:40 -08:00
Masen Furer
f99c48806a
Top-level namespace tweaks (#2523)
* pyi_generator: always ignore files starting with `tests`

* Move CodeBlock out of chakra namespace

* Expose additional names in the top-level namespace

* code pyi fixup

* expose input and quote at the top-level

* add text_field to top-level namespace (maybe)

* fixup chakra code.pyi

* Remove `text_field` from top level namespace

* Remove top-level big C Cond

* fixup top level pyi
2024-02-05 11:14:02 -08:00
Alek Petuskey
5589cbbfc2
Refactor rx.color (#2522)
* Refactor

* Lint

* Change name space to top level

* Update test

* Lint

* Fix pyright

* Update pyi

---------

Co-authored-by: Alek Petuskey <alekpetuskey@aleks-mbp.lan>
Co-authored-by: Nikhil Rao <nikhil@reflex.dev>
2024-02-04 15:39:07 -08:00
Nikhil Rao
05d1be2182
Move core components to radix namespace (#2506) 2024-02-02 14:26:46 -08:00
Nikhil Rao
5176a7cb14
Support component create methods as keys in global styles (#2498) 2024-01-31 12:25:18 -08:00
jackie-pc
80c9eb34e4
Rework telemetry to support installation_id (#2480) 2024-01-31 11:39:48 -08:00
wassaf shahzad
84a2bb9671
Added Environmental variable REFLEX_DIR (#2457) 2024-01-30 18:18:29 -08:00
Elijah Ahianyo
d2fd0d3b92
[REF-1742] Radio group prop types fix (#2452) 2024-01-30 18:14:20 -08:00
Tianze
209c5fab7b
Tabs validate parent is proper tab container (#2463) 2024-01-30 11:45:00 -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
Nikhil Rao
01c2a1ed7d
Set correct type when indexing into Var[str] (#2469)
* Index into strings

* Write tests
2024-01-28 21:57:02 -08:00
Nikhil Rao
d68de02bc8
Revert "Individually Import Chakra Packages (#2405)" (#2472) 2024-01-28 15:39:59 -08:00
Alek Petuskey
670faf291a
[WIP] rx.color (#2443)
* Color module intial commit

* Improvments

* Update reflex/constants/colors.py

Co-authored-by: Masen Furer <m_github@0x26.net>

* Comments+tests

* Fix import

---------

Co-authored-by: Alek Petuskey <alekpetuskey@aleks-mbp.lan>
Co-authored-by: Masen Furer <m_github@0x26.net>
Co-authored-by: Alek Petuskey <alekpetuskey@Aleks-MacBook-Pro.local>
2024-01-28 14:06:08 -08:00
wassaf shahzad
069892d8ee
fixed issue with hypens (#2450) 2024-01-26 14:14:46 -08:00
Alek Petuskey
00a8054850
Individually Import Chakra Packages (#2405)
* Base lib switch

Co-authored-by: Alek Petuskey <alekpetuskey@aleks-mbp.lan>
2024-01-25 10:22:46 -08:00
Elijah Ahianyo
5f1751acc2
Vardata for rx.Match (#2439) 2024-01-24 14:55:49 -08:00
Yummy-Yums
82aca76cd3
test_telemetry fails for Python Version 3.11.0rc1 (#2431)
* initial commit

* ruff updated formatting
2024-01-24 12:30:22 -08:00
Masen Furer
9446a1e99f
[REF-1705] Do not overwrite Var attributes during format (#2421) 2024-01-19 15:17:00 -08:00
Alek Petuskey
d466c2aaa2
Radix Accordion (#2310) 2024-01-18 14:20:21 -08:00
jackie-pc
2c270585ab
Skip frontend packages install if previously done (#2400) 2024-01-16 17:52:28 -08:00
benedikt-bartscher
1aca1b677f
fix is_backend_variable for dunder prefixed variables (#2391) 2024-01-16 17:37:05 -08:00
Elijah Ahianyo
abfc099779
rx.match component (#2318)
* initial commit

* add more tests

* refactor match jinja template

* add docstrings

* cleanup

* possible fix for pyright

* fix conflicts

* fix conflicts again

* comments

* fixed bug from review

* fix tests

* address PR comment

* fix tests

* type error improvement

* formatting

* darglint fix

* more tests

* stringify switch condition and cases as js doesnt support complex types(lists and dicts) in switch cases.

* Update reflex/vars.py

Co-authored-by: Masen Furer <m_github@0x26.net>

* change usages

* Precommit fix

---------

Co-authored-by: Alek Petuskey <alek@pynecone.io>
Co-authored-by: Masen Furer <m_github@0x26.net>
Co-authored-by: Alek Petuskey <alekpetuskey@aleks-mbp.lan>
2024-01-04 09:48:18 -08:00
Masen Furer
414a879879
Handle VarData roundtrip when encoded value contains newline (#2350) 2024-01-03 09:46:22 -08:00
Jishnu N
c5c42665eb
add: reflex init app name validator (#2336) 2023-12-28 00:07:55 -08:00
Masen Furer
0211e9a0e5
Avoid passing props to lists and list items (#2326) 2023-12-21 15:58:45 -08:00
Nikhil Rao
93c97383d9
Refactor chakra components into separate folder (#2315) 2023-12-21 09:52:08 -08:00
Nikhil Rao
cfb9d44e0c
Apply default theme to apps (#2320) 2023-12-20 15:17:49 -08:00
Nikhil Rao
5d21f0ca60
Add high-level API for accordion (#2285) 2023-12-18 17:21:49 -08:00
jackie-pc
7388617b72
apps should no longer call "app.compile()" (#2291) 2023-12-18 16:06:21 -08:00
Martin Xu
9da65b9a9a
[REF-1464] Handle requirements.txt encoding (#2284) 2023-12-14 14:25:40 -08:00
Elijah Ahianyo
9629b59617
DataFrame Serializer fix (#2281) 2023-12-12 14:03:40 -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
e52267477c
[REF-1417] Convert underscore-prefixed style props to pseudo selector (#2266) 2023-12-11 13:37:57 -08:00
Thomas Brandého
caf32605ca
add next/image and next-video in next namespace (#2223) 2023-12-07 10:38:47 -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
Martin Xu
f8395b1fd6
Separate out the hosting CLI from main repo (#2165) 2023-11-28 15:20:06 -08:00
Masen Furer
3deb2cec93
code_block responds to color mode by default (#2228) 2023-11-28 13:24:38 -08:00
Masen Furer
0c55723df4
[REF-1158] Move chakra-only deps to chakra lib (#2171) 2023-11-28 00:04:07 -08:00
Masen Furer
ee87e62efa
[REF-1035] Track ComputedVar dependency per class (#2067) 2023-11-27 18:17:53 -08:00
Masen Furer
527437cf23
[REF-144] Add context in each component to prevent rerenders (#2198) 2023-11-27 16:05:59 -08:00
Thomas Brandého
8fc254041b
fix name for import var when is default and add tests (#2214) 2023-11-26 12:46:43 -08:00
Masen Furer
1603144c7d
[REF-889] useContext per substate (#2149) 2023-11-21 11:52:06 -08:00
Nikhil Rao
e9437ad941
Use singleton app provider to speed up compiles (#2172) 2023-11-20 18:11:24 -08:00
Elijah Ahianyo
714edb3cde
REF-1202: Upgrade bun version if it differs from reflex set version (#2206) 2023-11-20 15:21:17 -08:00
Elijah Ahianyo
7f810ece21
To camel case fix (#2205) 2023-11-20 11:33:48 -08:00
Nikhil Rao
c3e652b8c1
Speed up reflex CLI imports (#2185) 2023-11-17 12:31:07 -08:00
Thomas Brandého
1a83f85783
_valid_children and _invalid_children accessible from class (#2192) 2023-11-17 12:30:18 -08:00
Masen Furer
7eccc6d988
[REF-723+] Upload with progress and cancellation (#1899) 2023-11-16 15:46:13 -08:00
Martin Xu
adb26787c8
Hosting CLI: remove requirements generation when init, add back timeout for deploy command, remove deploy legacy command (#2179) 2023-11-15 16:23:34 -08:00
Masen Furer
f3929f47e3
form: only pass handleSubmit when on_submit is defined (#2162) 2023-11-13 23:27:42 -08:00
Nikhil Rao
33e4816950
Lazy import modules in reflex (#2144) 2023-11-13 19:48:12 -08:00
Elijah Ahianyo
ea22452b27
Reduce Syntax highlighter footprint (#2037) 2023-11-13 12:47:55 -08:00
Thomas Brandého
39cc1b2f12
Upgrade to NextJS 14 (#2142) 2023-11-13 09:52:51 -08:00
Elijah Ahianyo
7a04652a6a
Revert "Bun as runtime on Mac and Linux (#2138)" (#2153) 2023-11-09 13:01:48 -08:00
Elijah Ahianyo
4d6fa9b823
Bun as runtime on Mac and Linux (#2138) 2023-11-08 16:22:02 -08:00
Thomas Brandého
c835ad0737
fix to_snake_case and add tests (#2133) 2023-11-06 12:13:28 -08:00
Nikhil Rao
e703d87450
Set unique index vars in rx.foreach (#2126) 2023-11-03 16:20:42 -07:00
Martin Xu
4c97b4c4c0
Hosting CLI: use http endpoint to return deploy milestones (#2085) 2023-11-03 12:13:46 -07:00
Martin Xu
4a526620ac
[REF-1042] Hosting CLI: check the user selected app name (#2102) 2023-11-02 14:34:10 -07:00
SandeshPyakurel
5e2ce46ddb
Typos fixed in multiple files (#2090) 2023-10-31 13:43:25 -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
Martin Xu
e9cf822460
CLI will not set auto/stop setting for deployment (#2040)
* do not set autostart/autostop as default on CLI

* cli feedback

* fix test

* clean up last few messages

* catch general exception for export and exit
2023-10-26 17:47:22 -07:00
Alek Petuskey
70a6b5f2d3
Autogenerating Dependencies During Deployment (#2033) 2023-10-26 17:32:58 -07:00
Martin Xu
fe01f0cf11
add region check upfront when user deploys interactively (#2030) 2023-10-26 10:07:49 -07: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
Martin Xu
81053618c9
CLI switch to prod server (#2016) 2023-10-24 09:43:20 -07:00
Martin Xu
07ca8fcb3b
[REF-99] Add first version of CLI for hosting service (#1810) 2023-10-21 13:09:56 -07:00
Masen Furer
cbf5b61a23
Drop python3.7 support (#2003)
* Drop python3.7 support

* poetry.lock: relock without py3.7

* Update README/CONTRIBUTING to say 3.8+
2023-10-19 22:21:29 +02:00
Elijah Ahianyo
06bdf9ed8a
Remove 0.3.0 deprecated features (#1947) 2023-10-19 09:44:32 -07:00
Elijah Ahianyo
b652d40ee5
Remove Default state (#1978) 2023-10-18 09:57:27 -07:00
Masen Furer
e15710de17
test_app: cleanup state_name logic and fixup get_sid() call (#1993) 2023-10-18 12:29:24 +02: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
df09c716c6
fix serialization as a whole for list/dict/Base containing custom items to serialize (#1984) 2023-10-17 10:44:54 -07:00
Masen Furer
d1d5812602
format: event arg values use backticks (#1926) 2023-10-17 10:42:35 -07:00
Thomas Brandého
b1bab1206d
deprecate get_ methods for router_data, use BaseVars instead (#1967) 2023-10-17 09:59:44 -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
Elijah Ahianyo
c6abeb31a5
Props as Literals (#1921) 2023-10-15 20:16:39 -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
684912e33b
[REF-843] Automatically update api_url and deploy_url (#1954) 2023-10-13 12:59:19 -07:00
Alek Petuskey
67eb661704
Core Graphing -> Recharts (#1878) 2023-10-04 15:05:08 -07:00
Thomas Brandého
58933278ad
fix rx.image src not working with state (#1915) 2023-10-04 14:15:18 -07:00
Masen Furer
43cc8d4f6c
test_state: assert popped value is the actual value (#1906) 2023-10-02 17:43:05 -07:00
Nikhil Rao
53d205ad9f
Improve default rx.markdown styling (#1904) 2023-10-02 11:52:16 -07:00
Masen Furer
4b84c2a471
state: subclass of MutableState must return _mark_dirty return value (#1898) 2023-10-02 11:17:45 -07:00
Thomas Brandého
7df3f2f621
allow external link for redirect (#1902) 2023-10-02 09:37:46 -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
Elijah Ahianyo
26885d98cf
rx.table __bool__ regression fix (#1828) 2023-09-28 09:31:01 -07:00
Nikhil Rao
89404e0b4a
Add head components to app (#1868) 2023-09-25 16:53:15 -07:00
Nikhil Rao
8231993e5a
Improvements to custom styles in rx.markdown (#1852) 2023-09-25 15:59:48 -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
Thomas Brandého
211dc15995
New API to define triggers (#1820) 2023-09-21 09:47:22 -07:00
Nikhil Rao
ac8dfc5f91
Format component as React string (#1848) 2023-09-20 19:30:38 -07:00
Elijah Ahianyo
d81d544b97
add option to disable Tailwind (#1842) 2023-09-20 16:47:58 -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
Nikhil Rao
264c44e630
Disable metrics in CI (#1822) 2023-09-15 18:15:25 -07:00
Nikhil Rao
1938a6cc58
Add serializers for different var types (#1816) 2023-09-15 17:19:26 -07:00
Elijah Ahianyo
74d227d2fd
Move custom styles to root App file(_app.js) (#1764) 2023-09-15 13:18:35 -07:00
Elijah Ahianyo
f2b0915aff
Type Validation for Var Operations and Enhanced Compatibility (#1674) 2023-09-12 15:57:40 -07:00
Elijah Ahianyo
06a110a07d
Style props with Callable Values (#1751) 2023-09-12 11:26:53 -07:00
Martin Xu
3406be3ff8
supply default for sqlmodel PK for both DB and python to work (#1788) 2023-09-08 14:51:57 -07:00
Elijah Ahianyo
891e6a4736
Allow underscores in routes (#1713) 2023-09-08 12:18:33 -07:00
Thomas Brandého
043648da07
improve pyi files generation (#1765) 2023-09-07 00:23:17 -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
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
Nev Delap
41e97bbc46
Issues 1633 Add frontend_path to config to support running multiple reflex apps off the same domain, and 1583 Show the correct info on where the site is being served. (#1724)
* Support setting Next.js basePath in Reflex config. (#1633)

- Tests.
- And sorted config in next.config.js template.

* Display the correct running at url with basePath if it is set. (#1583)

* Formatting, fixed by black.

* Fix indenting in test data.

* Fixed that conflict resolution shouldnt have included console.debug line.

* Rmove use of :=. Add http:// to url. Use urljoin to build url.
2023-09-02 06:38:22 -07:00
Elijah Ahianyo
829a7751b5
Refactor: Move format_prop Static Method for Improved Reusability (#1714) 2023-09-01 13:01:11 -07:00
Masen Furer
ca4724cec8
AppHarness: disable telemetry for test apps (#1733) 2023-08-31 14:57:28 -07:00
Masen Furer
cc89f2b6e7
Proper serialization for chained Event payloads (#1725) 2023-08-31 09:50:15 -07:00
Masen Furer
2392c52928
Implement on_mount and on_unmount for all components. (#1636) 2023-08-30 09:50:39 -07:00
Thomas Brandého
bb44fcdaa1
renamed reserved endpoints of Reflex (#1542) 2023-08-30 09:33:54 -07:00
Elijah Ahianyo
689f078aa3
Fix Node Installation on ARM-based Macs with FNM (#1701) 2023-08-29 14:59:56 -07:00
Martin Xu
2e1aea9713
Add contains, reverse operations for Var (#1679) 2023-08-28 14:59:50 -07:00
Masen Furer
12e516da64
state: _init_event_handlers recursively (#1640) 2023-08-25 13:28:58 -07:00
Elijah Ahianyo
dbaa6a1e56
Fnm and node for POSIX (#1606) 2023-08-25 13:04:10 -07:00
Martin Xu
82dc237f44
Revert "Use DebounceInput wrapper for fully controlled Editable" (#1670) 2023-08-23 17:16:03 -07:00
Elijah Ahianyo
217a5806ee
Validate component children (#1647) 2023-08-23 15:56:27 -07:00
Martin Xu
d884b7ba96
Use DebounceInput wrapper for fully controlled Editable (#1650) 2023-08-21 14:25:56 -07:00
Nikhil Rao
0beb7a409f
Clean up config parameters (#1591) 2023-08-18 14:22:20 -07:00
Masen Furer
042710ca91
Handle file uploads with component-local state (#1616) 2023-08-18 13:12:17 -07:00
Thomas Brandého
f771894077
add system infos to output when in loglevel debug (#1567) 2023-08-18 13:00:49 -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
98fae89319
Automatic Install FNM and Node for Windows: (#1566) 2023-08-17 11:23:09 -07:00
Masen Furer
26e45c1f18
format_dict: only unescape quotes when removing outer quotes (#1609) 2023-08-17 09:45:25 -07:00
Elijah Ahianyo
ed4de0d7ba
Reinstate bun path (#1552) 2023-08-15 17:39:43 -07:00
Nikhil Rao
6d15326abf
Support f-strings in component children and non-style props (#1575) 2023-08-14 11:33:16 -07:00
mat-mil
ebf6c7e35c
performance: change platform check fixture scope to session (#1569) 2023-08-11 13:55:12 -07:00
mat-mil
fa1642fd6b
chore: ignore all files with .db extensions in .gitignore (#1568)
* chore: ignore all files with .db extensions in .gitignore

* Fix unit tests for .gitignore
2023-08-11 13:29:58 -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
Masen Furer
4a658ef9be
Wrap Input and TextArea with DebounceInput for full control (#1484) 2023-08-07 14:27:42 -07:00
Elijah Ahianyo
a9b7394e0e
Remove Home folder for windows (#1502) 2023-08-03 14:27:38 -07:00
Thomas Brandého
9222bbbdf2
fix state reset() (#1501) 2023-08-02 11:02:05 -07:00
Nikhil Rao
91c0de4b5f
Use concurrent.futures for threading (#1483) 2023-07-31 17:45:40 -07:00
Nikhil Rao
f01eff5b29
Show status bar on reflex init (#1467)
* Show status bar on reflex init

* Fix tests

* Fix version

* Fix test
2023-07-30 20:45:34 -07:00
Nikhil Rao
068bcd906e
Add unified logging (#1462) 2023-07-30 19:58:48 -07:00
Nikhil Rao
e1cb09e9d4
Remove curl and parallelize node/bun install (#1458) 2023-07-28 17:53:24 -07:00
jackie-pc
e6f4bcdb95
Github action to run unit tests on windows (#1444) 2023-07-28 11:12:01 -07:00
Nikhil Rao
e26bba80a6
Create ~/.reflex directory and update integration tests (#1419) 2023-07-27 16:39:53 -07:00
Elijah Ahianyo
3fa33bd644
List and Dict mutation on setattr (#1428) 2023-07-27 12:45:57 -07:00
Elijah Ahianyo
d4abf5ff2b
Update tests for Foreach (#1394) 2023-07-21 11:49:55 -07:00
Elijah Ahianyo
549ab4e708
rx.App state arg should not be required (#1361) 2023-07-21 11:47:38 -07:00
Elijah Ahianyo
4505279d5d
Synchronize Event Namespace (#1370) 2023-07-19 18:05:42 -07:00
Masen Furer
bfec196d84
Expose Script component from next/script (#1355) 2023-07-18 18:57:50 -07:00
Elijah Ahianyo
ca11b82432
Yield with uploads (#1339) 2023-07-18 14:06:57 -07:00
Masen Furer
4a661a5395
reflex db migrate CLI and associated config (#1336) 2023-07-17 18:06:50 -07:00
Elijah Ahianyo
40953d05ac
Strict type checking for indexing with vars (#1333) 2023-07-13 15:46:15 -07:00
Masen Furer
2c97c1e7ca
reflex.testing.AppHarness: tools for testing reflex apps (#1326) 2023-07-13 15:45:57 -07:00
Masen Furer
5505d10989
rx.Model: automigrate using alembic (#1321) 2023-07-12 15:47:19 -07:00
Elijah Ahianyo
7f0fc86816
Computed vars tuple and str indexing support (#1322) 2023-07-12 15:26:34 -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
3b3fc4f965
Local storage clear and remove (#1222) 2023-06-28 11:59:27 -07:00