Commit Graph

1652 Commits

Author SHA1 Message Date
Khaleel Al-Adhami
9e1a35f514 use less boilerplate 2024-08-15 16:05:10 -07:00
Khaleel Al-Adhami
1603e0606d go back to passing test cases 2024-08-15 12:58:10 -07:00
Khaleel Al-Adhami
8de75b7d08 various optimizations 2024-08-14 18:51:56 -07:00
Khaleel Al-Adhami
75ef7737be use fixed_type logic 2024-08-14 17:17:03 -07:00
Khaleel Al-Adhami
777e8bc60e use get origin more 2024-08-14 16:07:35 -07:00
Khaleel Al-Adhami
1d45f70dfe reorder things 2024-08-14 15:19:06 -07:00
Khaleel Al-Adhami
e92218da94 fix pyright issues 2024-08-14 15:00:47 -07:00
Khaleel Al-Adhami
d516b3bfc4 pass all testcases 2024-08-14 14:36:37 -07:00
Khaleel Al-Adhami
39bc0c0b57 down to 13 errors 2024-08-13 17:13:43 -07:00
Khaleel Al-Adhami
82a3498d02 down to 20 errors 2024-08-13 17:02:50 -07:00
Khaleel Al-Adhami
2f49ce0201 solve more CI issues, down to 94 failures 2024-08-13 13:06:58 -07:00
Khaleel Al-Adhami
2c26dadacd improve test_cond 2024-08-12 16:07:06 -07:00
Khaleel Al-Adhami
0fd423712b overload equals to special case immutable var 2024-08-12 15:59:26 -07:00
Khaleel Al-Adhami
5bfc0c0446 fix silly mistake 2024-08-12 15:48:13 -07:00
Khaleel Al-Adhami
e0c4e971cd dicts are unusable sadly 2024-08-12 15:24:27 -07:00
Khaleel Al-Adhami
854d729ca6 put plotly inside of a catch 2024-08-12 15:20:40 -07:00
Khaleel Al-Adhami
4349d693ff use override from typing_extension 2024-08-12 15:17:32 -07:00
Khaleel Al-Adhami
0ae88314da fix pyi 2024-08-12 15:14:41 -07:00
Khaleel Al-Adhami
f6938cffa6 fix tests 2024-08-12 15:03:37 -07:00
Khaleel Al-Adhami
982e4c110d get it to compile reflex-web successfully 2024-08-09 15:35:17 -07:00
Khaleel Al-Adhami
ea33c3987a get reflex-web to compile 2024-08-08 17:33:12 -07:00
Khaleel Al-Adhami
81cd679802 implement hash for all functions 2024-08-05 17:12:35 -07:00
Khaleel Al-Adhami
c397cb2b04 create immutable callable var and get rid of more base vars 2024-08-05 16:56:29 -07:00
Khaleel Al-Adhami
da95d0f519 remove all instances of Var.create 2024-08-05 16:01:56 -07:00
Khaleel Al-Adhami
450610ac48 fix silly pright issues (except colormode and state) 2024-08-05 15:30:19 -07:00
Khaleel Al-Adhami
1eecd1f9a7 i hate rufffff (no i don't) 2024-08-05 15:20:21 -07:00
Khaleel Al-Adhami
de1fbdbe5b fully migrate vars into new system 2024-08-05 15:16:21 -07:00
Khaleel Al-Adhami
ad14f38329
add type hinting to existing types (#3729)
* add type hinting to existing types

* dang it darglint

* i cannot
2024-07-31 12:01:17 -07:00
benedikt-bartscher
129adc941a
add test for initial state dict (#3727) 2024-07-31 11:37:53 -07:00
benedikt-bartscher
2629366b23
fix initial_value for computed_var (#3726)
* fix initial_value for computed_var

* fix initial_value in pyi
2024-07-31 10:00:52 -07:00
Khaleel Al-Adhami
1c400043c6
[REF-3328] Implement __getitem__ for ArrayVar (#3705)
* half of the way there

* implement __getitem__ for array

* add some tests

* add fixes to pyright

* fix default factory

* implement array operations

* format code

* fix pyright issue

* give up

* add object operations

* add test for merge

* pyright 🥺

* use str isntead of _var_name

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

* wrong var_type

* make to much nicer

* add subclass checking

* enhance types

* use builtin list type

* improve typing even more

* i'm awaiting october

* use even better typing

* add hash, json, and guess type method

* fix pyright issues

* add a test and fix lots of errors

* fix pyright once again

* add type inference to list

---------

Co-authored-by: Masen Furer <m_github@0x26.net>
2024-07-30 15:38:32 -07:00
Masen Furer
06833f6d8d
[REF-3203] Find a DOM event-like object in addEvents (#3706) 2024-07-29 17:17:51 -07:00
Khaleel Al-Adhami
800685da68
fix silly bug when style is set directly to breakpoints (#3719)
* fix silly bug when style is set directly to breakpoints

* add helpful comment

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

---------

Co-authored-by: Masen Furer <m_github@0x26.net>
2024-07-29 16:57:33 -07:00
Masen Furer
4cdd87d851
Bump to v0.5.8 (#3716) 2024-07-29 09:52:45 -07:00
paoloemilioserra
2e726f1bb9
Update vars.py (#3659)
Prevent a validation error from pydantic/v1 that cannot find _var_name, etc. in __dataclass_fields__
2024-07-28 17:51:08 -07:00
Masen Furer
a4e3f05601
[REF-3375] useMemo on generateUUID props to maintain consistent value (#3708)
When using rx.vars.get_uuid_string_var, wrap the prop Var in `useMemo` so that
the value remains consistent across re-renders of the component.

Fix #3707
2024-07-26 17:10:08 -07:00
Thomas Brandého
c4346c2624
update init prompt to use new templates from reflex-dev/templates (#3677) 2024-07-25 10:51:44 -07:00
Thomas Brandého
d389f4b5ca
fix var warning (#3704) 2024-07-25 10:50:18 -07:00
Khaleel Al-Adhami
ede5cd1f2c
[REF-3321] implement var operation decorator (#3698)
* implement var operation decorator

* use older syntax

* use cast and older syntax

* use something even simpler

* add some tests

* use old union tactics

* that's not how you do things

* implement arithmetic operations while we're at it

* add test

* even more operations

* can't use __bool__

* thanos snap

* forgot ruff

* use default factory

* dang it darglint

* i know i should have done that but

* convert values into literalvars

* make test pass

* use older union tactics

* add test to string var

* pright why do you hate me 🥺
2024-07-25 09:34:14 -07:00
Masen Furer
0845d2ee76
[REF-3184] [REF-3339] Background task locking improvements (#3696)
* [REF-3184] Raise exception when encountering nested `async with self` blocks

Avoid deadlock when the background task already holds the mutation lock for a
given state.

* [REF-3339] get_state from background task links to StateProxy

When calling `get_state` from a background task, the resulting state instance
is wrapped in a StateProxy that is bound to the original StateProxy and shares
the same async context, lock, and mutability flag.

* If StateProxy has a _self_parent_state_proxy, retrieve the correct substate

* test_state fixup
2024-07-23 15:28:38 -07:00
Thomas Brandého
b9927b6f49
notifying frontend about backend error looks better (#3491) 2024-07-23 13:58:15 -07:00
Khaleel Al-Adhami
ea016314b0
[REF-3227] implement more literal vars (#3687)
* implement more literal vars

* fix super issue

* pyright has a bug i think

* oh we changed that

* fix docs

* literalize vars recursively

* do what masen told me :D

* use dynamic keys

* forgot .create

* adjust _var_value

* dang it darglint

* add test for serializing literal vars into js exprs

* fix silly mistake

* add  handling for var and none

* use create safe

* is none bruh

* implement function vars and do various modification

* fix None issue

* clear a lot of creates that did nothing

* add tests to function vars

* added simple fix smh

* use fconcat to make an even more complicated test
2024-07-22 12:45:23 -07:00
Elijah Ahianyo
9666244a87
[REF-3273] Add SVG circle, polygon and rect components (#3684) 2024-07-22 12:05:50 -07:00
Elijah Ahianyo
decdc857be
rx.list Dont set/hardcode list_style_position css prop (#3695) 2024-07-22 10:56:34 -07:00
Masen Furer
8b45d289bd
reflex init --ai fixups (#3691)
* reflex.build polling: catch exceptions and retry

Extend interval to 2 seconds to reduce server load.

* Add function to check if a string looks like a generation hash

* reflex init: allow --template to be a generation hash if --ai is specified
2024-07-19 14:05:53 -07:00
Thomas Brandého
921a5cd632
fix typo (#3689) 2024-07-19 18:02:50 +02:00
Masen Furer
1da606dd8e
[REF-3197] Browser init workflow (#3673) 2024-07-18 18:51:33 -07:00
Elijah Ahianyo
1bc1978c31
[REF-3135] Radix Primitive components should not ignore provided class_name prop (#3676) 2024-07-18 13:26:46 -07:00
Benyamin Zojaji
25aa0cbab1
add Persian translation and update the language links in the README.md files to include Persian (#3666) 2024-07-17 18:31:18 -07:00
Alek Petuskey
0a8b8a89b4
Benchmarking Updates (#3680)
* Benchmark test

* Lighthouse posthog

---------

Co-authored-by: Alek Petuskey <alekpetuskey@Aleks-MacBook-Pro.local>
2024-07-17 17:15:13 -07:00