Commit Graph

1903 Commits

Author SHA1 Message Date
Carlos
9f11b83fa9
default props comment for treemap (#4098) 2024-10-08 16:25:47 -07:00
Carlos
f05da7cead
default props comment for LabelList (#4102) 2024-10-08 16:17:59 -07:00
Carlos
2718cb51eb
default props comment for PolarAgnleAxis (#4106) 2024-10-08 16:17:14 -07:00
Carlos
e633cd0385
default props comment for Legend (#4100) 2024-10-08 16:11:32 -07:00
Carlos
9c7de9b189
default props comment for XAxis (#4110)
* default props comment for XAxis

* axis id
2024-10-08 16:09:03 -07:00
Carlos
19df34d941
default props comment for YAxis (#4111)
* default props comment for YAxis

* axis id
2024-10-08 16:07:24 -07:00
Carlos
c3b7caaf13
default props comment for ZAxis (#4112) 2024-10-08 16:06:05 -07:00
Carlos
4843081089
default props comment for Brush (#4113) 2024-10-08 16:05:22 -07:00
Carlos
7b88c54d13
default props comment for Bar (#4116) 2024-10-08 15:58:22 -07:00
Carlos
2652a04be8
default props comment for Line (#4117) 2024-10-08 15:57:11 -07:00
Carlos
abf0329cd9
default props comment for Area (#4115) 2024-10-08 15:56:11 -07:00
Carlos
be980c6b1e
default props comment for Scatter (#4118) 2024-10-08 15:54:42 -07:00
Carlos
567cf7ea38
default props comment for ReferenceArea (#4124) 2024-10-08 15:49:30 -07:00
Khaleel Al-Adhami
c619c72211
use system npm when REFLEX_USE_SYSTEM_NODE is passed (#4133) 2024-10-08 13:25:49 -07:00
Carlos
cb4ff24dc0
default props comment for ReferenceLine (#4122) 2024-10-08 12:37:10 -07:00
Carlos
4982b450fe
default props comment for CartesianGrid (#4126) 2024-10-08 12:36:27 -07:00
Carlos
02d4428e39
default props comment for CartesianAxis (#4127) 2024-10-08 12:36:19 -07:00
Thomas Brandého
5e3cfecdea
fix custom component init (#4123) 2024-10-08 09:15:56 -07:00
Masen Furer
876426c581
test_dynamic_routes: log on_loads and poll for 60 seconds on order (#4089)
Assert on `list(...order)` so the error message prints actual value instead of
MutableProxy's repr.

Not sure if this fixes it...
2024-10-08 09:14:35 -07:00
Masen Furer
37508676cf
Revert Markdown-related frontend dep bumps (#4088)
* Revert markdown version bumps

* Ignore markdown related dependencies (these are pinned now)
2024-10-08 16:16:54 +02:00
Khaleel Al-Adhami
af83161fed
reset backend vars in state.reset() (#4087) 2024-10-07 15:04:01 -07:00
Khaleel Al-Adhami
8663d4f978
[ENG-3749] type safe vars (#4066)
* type safe vars

* fix behavior for dict and list
2024-10-07 14:59:02 -07:00
Masen Furer
7529bb0c64
[ENG-2287] Avoid fetching same state from redis multiple times (#4055)
* Avoid fetching substates multiple times

In the presence of computed vars, substates may be cached more than once.

* Consolidate logic in StateManagerRedis.get_state

* Suppress StateSchemaMismatchError and create a new state instance.

If the serialized state's schema does not match the current corresponding state
schema, then we have to create a new instance.
2024-10-07 14:58:41 -07:00
Thomas Brandého
0e99ce91c1
update ruff to latest version (#4081)
* update ruff to latest version

* fix pyi
2024-10-07 23:52:36 +02:00
Khaleel Al-Adhami
bec73109d6
upgrade default node to current lts (#4086) 2024-10-07 13:24:23 -07:00
Khaleel Al-Adhami
c7c830de80
fail safely when pickling (#4085)
* fail safely when pickling

* why did i do that
2024-10-07 11:59:33 -07:00
Thomas Brandého
59dd54c049
add workflow to check dependencies on release branch (#4050)
* add workflow to check dependencies on release branch

* rename action to follow convention of other actions

* update workflow

* bump poetry version

* relock deps

* update check to ignore pyright and ruff

* oops, you saw nothing

* split dep check in two job

* fix frontend dep check

* fix stuff

* hmm yeah

* nope nope nope

* sigh

* bump js versions for some packages

* fix some warnings in tests

* fix tests

* try some options

* try to set asyncio policy

* debug dep check

* fix attempt for backend dep

* clean up output for backend check

* run bun outdated on reflex-web to catch most of the packages

* fix python version

* fix python version

* add missing env

* fix bun command

* fix workdir of frontend check

* update packages version

* up-pin plotly.js version

* add debug ouput

* clean frontend dep check output

* fix output

* fix async tests for redis

* relock poetry.lock

* Non-async functions do not need pytest_asyncio.fixture

* test_state: close StateManagerRedis connection in test to avoid warning

---------

Co-authored-by: Masen Furer <m_github@0x26.net>
2024-10-07 20:57:02 +02:00
Khaleel Al-Adhami
7cd5c904cb
misc var improvements (#4068) 2024-10-07 09:37:44 -07:00
Khaleel Al-Adhami
47230198bb
bundle next link in window (#4064) 2024-10-07 09:36:22 -07:00
Masen Furer
edd17208c0
Reduce pickle size (#4063)
* Only serialize base vars
* Never serialize router/router_data in substates
* Hash the schema to reduce serialized size
* lru_cache the schema to avoid recomputing it
2024-10-07 09:34:36 -07:00
Masen Furer
5c0518053d
Get default for backend var defined in mixin (#4060)
* Get default for backend var defined in mixin

If the backend var is defined in a mixin class, it won't appear in
`cls.__dict__`, but the value is still retrievable via `getattr` on `cls`.
Prefer to use the actual defined default before using
`Var.get_default_value()`.

If `Var.get_default_value()` fails, set the default to `None` such that the
backend var still gets recognized as a backend var when it is used on `self`.

----

Update test_component_state to include backend vars

Extra coverage for backend vars with and without defaults, defined in a
ComponentState/mixin class.

* fix integration test
2024-10-07 09:33:44 -07:00
Masen Furer
aa69234b76
Optimize StateManagerDisk (#4056)
* Simplify StateManagerDisk implementation

* Act more like the memory state manager and only track the root state in self.states
* .load_state always loads a single state or returns None
* .populate_states is the new entry point in loading from disk and it only occurs
  when the root state is not known
* much fast

* StateManagerDisk now acts much more like StateManagerMemory

Treat StateManagerDisk like StateManagerMemory for AppHarness

* Handle root_state deserialized from disk

In this case, we need to initialize the whole state tree, so any non-persistent
states will still get default values, whereas on-disk states will overwrite the
defaults.

* Cache root_state under client_token for StateManagerMemory compatibility

Mainly this just makes it easier for us to write tests that work against either
Disk or Memory state managers.
2024-10-07 09:33:16 -07:00
Thomas Brandého
1f3be6340c
catch CancelledError in lifespan hack for windows (#4083) 2024-10-07 09:27:36 -07:00
Khaleel Al-Adhami
12b81ad754
convert literal type to its variants (#4062) 2024-10-04 13:56:25 -07:00
Masen Furer
9b5a36814a
bump version to 0.6.3dev1 (#4061) 2024-10-04 12:27:52 -07:00
Masen Furer
d77b900bd7
[ENG-3867] Garden Variety Pickle (#4054)
* Use regular `pickle` module from stdlib

* Avoid recreating the rx.State tree for every `get_state`

* Remove dill dependency

* relock deps
2024-10-03 19:19:06 -07:00
Khaleel Al-Adhami
fafdeb892e
Include emotion inside of dynamic components (#4052)
* bundle chakra in window for CSR

* remove repeated chakra ui reference

* use dynamically generated libraries

* remove js from it

* include emotion react for dynamic components

* make code more readable

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

* jsx yea

* what

---------

Co-authored-by: Thomas Brandého <thomas.brandeho@gmail.com>
2024-10-03 15:58:42 -07:00
Khaleel Al-Adhami
0f8630fb2d
remove var operation error (#4053)
* remove var operation error

* dang it darglint
2024-10-03 15:58:04 -07:00
Khaleel Al-Adhami
73e8a4e0ab
support eventspec/eventchain in var operations (#4038) 2024-10-03 15:33:51 -07:00
Khaleel Al-Adhami
ad0827c59c
bundle chakra in window for CSR (#4042)
* bundle chakra in window for CSR

* remove repeated chakra ui reference

* use dynamically generated libraries

* remove js from it
2024-10-03 14:25:21 -07:00
Masen Furer
a66e0f2e11
[ENG-3870] rx.call_script with f-string var produces incorrect code (#4039)
* Add additional test cases for rx.call_script

Include internal vars inside an f-string to be properly rendered on the backend
and frontend.

* [ENG-3870] rx.call_script with f-string var produces incorrect code

Avoid casting javascript code with embedded Var as LiteralStringVar

There are two cases that need to be handled:

1. The javascript code contains Vars with VarData, these can only be evaluated
   in the component context, since they may use hooks. Vars with VarData cannot be
   used from the backend. In this case, we cast the given code as a raw js
   expression and include the extracted VarData.

2. The javascript code has no VarData. In this case, we pass the code as the
   raw js expression and cast to a python str to get a js literal string to eval.

* use VarData.__bool__ instead of `is None`
2024-10-03 14:18:53 -07:00
Thomas Brandého
40f1880932
move router dataclasses in their own file (#4044) 2024-10-03 14:18:28 -07:00
Khaleel Al-Adhami
56709a210b
add of_type to _evaluate (#4051)
* add of_type to _evaluate

* get it right pyright
2024-10-03 13:01:19 -07:00
Khaleel Al-Adhami
27bb7179d6
default should be warning for subprocesses not info (#4049) 2024-10-03 12:24:56 -07:00
Elijah Ahianyo
4b3d056212
[ENG-3476] Setting State Vars that are not defined should raise an error (#4007) 2024-10-03 10:35:34 -07:00
Elijah Ahianyo
12d73e4167
Track the last reflex run time (#4045) 2024-10-03 09:48:50 -07:00
Thomas Brandého
3f51943162
use pathlib as much as possible (#3967)
* use pathlib as much as possible

* fixstuff

* break locally to unbreak in CI 🤷

* add type on env

* debug attempt 1

* debugged

* oops, there is the actual fix

* fix 3.9 compat
2024-10-03 17:50:39 +02:00
Thomas Brandého
f3be9a3305
fix granian message (#4037) 2024-10-03 15:04:44 +02:00
Khaleel Al-Adhami
6a9f83cc2d
set loglevel to info with hosting cli (#4043)
* set loglevel to info with hosting cli

* reduce reused logic
2024-10-02 18:04:04 -07:00
Masen Furer
c08720ed1a
Use an equality check instead of startswith (#4024) 2024-10-01 15:23:35 -07:00