Commit Graph

1603 Commits

Author SHA1 Message Date
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
Khaleel Al-Adhami
458cbfac59
[REF-3228] implement LiteralStringVar and format/retrieval mechanism (#3669)
* implement LiteralStringVar and format/retrieval mechanism

* use create safe

* add cached properties to ConcatVarOperation

* fix caches

* also include self

* fix inconsistencies in typings

* use default factory not default

* add missing docstring

* experiment with immutable var data

* solve pydantic issues

* add sorted function

* missing docs

* forgot ellipses

* give up on frozen

* dang it darglint

* fix string serialization bugs and remove unused code

* add returns statement

* whitespace moment

* add simple test for string concat

* export ConcatVarOperation
2024-07-17 17:01:27 -07:00
Masen Furer
94c4c2f29f
bump to 0.5.7 (#3678) 2024-07-16 11:38:56 -07:00
Alek Petuskey
93231f8168
Improve graphing asethetic (#3611)
* Improve graphing asthetic

* Few more updates

* More style updates

* Update reflex/components/recharts/polar.py

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

* Address pr comments

* fix precommit

* Fix types

* PYI

* PYI update

---------

Co-authored-by: Alek Petuskey <alekpetuskey@Aleks-MacBook-Pro.local>
Co-authored-by: Masen Furer <m_github@0x26.net>
2024-07-15 11:25:08 -07:00
lumin
ec35e4f256
feat: Improve documentation in Japanese README.md file (#3650) 2024-07-14 13:16:10 -07:00
Khaleel Al-Adhami
5b927f18d0
[REF-3222] define new JS-type var classes (#3668)
* define new JS-type var classes

* add docstring

* get rid of dataclass definitions and export all new vars

* order imports in the correct way

* only hash once
2024-07-12 14:42:08 -07:00
Manas Gupta
b04a7dab84
Update Radial Bar Component (#3662)
* add: radial bar properties

* add: generate new pyi file

* style: fix linting

---------

Co-authored-by: coolstorm <manas.gupta@fampay.in>
2024-07-12 13:29:21 -07:00
Masen Furer
0ed895cde7
debounce: pass through key and special_props (#3655)
These fields on the base Component were not being carried onto the
DebounceInput component (to be passed to the child).

Discovered while testing #3653
2024-07-12 13:27:19 -07:00
benedikt-bartscher
9663377374
cleanup unused useReducer import (#3667) 2024-07-12 12:55:25 -07:00
Elijah Ahianyo
eed0edc12a
Allow DebounceInput as child of FormControl Component (#3660) 2024-07-11 16:07:25 -07:00
benedikt-bartscher
dc33d208b4
fix Var.contains pyi (#3663) 2024-07-11 16:06:32 -07:00
benedikt-bartscher
86a2f923f6
Pkg resources deprecation (#3646)
* fix typo

* migrate pkg_resources to importlib
2024-07-11 11:22:03 -07:00
benedikt-bartscher
3c0cb3fd6a
migrate deprecated connections to net_connections (#3641)
* migrate deprecated connections to net_connections

* check for psutil version
2024-07-11 11:21:34 -07:00
benedikt-bartscher
460afc2e10
fix unclosed file (#3639) 2024-07-11 11:20:54 -07:00
Khaleel Al-Adhami
d4d077818c
[REF-3225] implement __format__ for immutable vars (#3617)
* implement format for immutable vars

* add some basic test

* make reference only after formatting

* win over pyright

* hopefully now pyright doesn't hate me

* forgot some _var_data

* i don't know how imports work

* use f_string var and remove assignments from pyi file

* override post_init to not break immutability

* add create_safe and test for it
2024-07-11 11:19:38 -07:00
benedikt-bartscher
3039b54a75
add module prefix to generated state names (#3214)
* add module prefix to state names

* fix state names in test_app

* update state names in test_state

* fix state names in test_var

* fix state name in test_component

* fix state names in test_format

* fix state names in test_foreach

* fix state names in test_cond

* fix state names in test_datatable

* fix state names in test_colors

* fix state names in test_script

* fix state names in test_match

* fix state name in event1 fixture

* fix pyright and darglint

* fix state names in state_tree

* fix state names in redis only test

* fix state names in test_client_storage

* fix state name in js template

* add `get_state_name` and `get_full_state_name` helpers for `AppHarness`

* fix state names in test_dynamic_routes

* use new state name helpers in test_client_storage

* fix state names in test_event_actions

* fix state names in test_event_chain

* fix state names in test_upload

* fix state name in test_login_flow

* fix state names in test_input

* fix state names in test_form_submit

* ruff

* validate state module names

* wtf is going on here?

* remove comments leftover from refactoring

* adjust new test_add_style_embedded_vars

* fix state name in state.js

* fix integration/test_client_state.py

new SessionStorage feature was added with more full state names that need to be formatted in

* fix pre-commit issues in test_client_storage.py

* adjust test_computed_vars

* adjust safe-guards

* fix redis tests with new exception state

---------

Co-authored-by: Masen Furer <m_github@0x26.net>
2024-07-11 11:13:57 -07:00
Masen Furer
d378e4a70c
benchmarks.yml: use node 18.x with reflex-web@main (#3657) 2024-07-11 10:43:09 -07:00
Thomas Brandého
7ba61ced14
Make domain props work for y_axis (#3652) 2024-07-11 10:35:34 -07:00
Thomas Brandého
4f9a75b390
add warning when using css props on recharts (#3651) 2024-07-11 10:34:39 -07:00
Masen Furer
1cfc811506
[REF-3266] Check for pydantic v1 outside of try/except (#3643)
If pydantic v1 is already installed, there is no reason to restore the original
pydantic modules, which seems to introduce subtle incompatibilities with some
pydantic versions.

Perform the pydantic version check early on and exit for v1 before doing
anything with the sys.modules.

Fix #3642
2024-07-10 12:28:39 -07:00
Tom Gotsman
4c61838608
Tom/recharts missing props (#3645)
* fix axis orientation prop

* add margin prop explanation

* active bar and on animation start

* remove data key from y-axis

* precommit and pyi generator

---------

Co-authored-by: Tom Gotsman <tomgotsman@Toms-MacBook-Pro.local>
Co-authored-by: Tom Gotsman <tomgotsman@toms-mbp.lan>
2024-07-09 18:10:51 -07:00
Jishnu N
690b719437
[REF-3160] fix rx.Var._replace raise TypeError on invalid kwargs (#3625)
* fix: unexpected kwargs raise type error, on _replace

* add: docstring for _replace, test for invalid kwargs replace

* add: parametrize var for replace test

* fix: computed_var _replace with invalid kwargs
2024-07-09 11:19:29 -07:00
Maxim Vlah
fa71edd224
Fix the error boundary (#3637)
* - added possibility to pass front- and backend exception handlers to rx.App
- wrapped the app with ErrorBoundary component to catch rendering errors

* added missing exception handler to reflex.app._process

* regenerated pyi

* fix unit tests for exception handler validation

* fix typing error in ErrorBoudary

* - fix error_bounday pyi
- minor refactoring of error boundary
- removed error boundary from 404 page

* added missing inspect module import after merging main

* fix typing error

* Clean up ErrorBoundary component

* Remove custom _render function
* Remove special imports in Component base class
* Simplify hooks for better composability

* test_exception_handlers: also test in prod mode

* fixed color prop

* fixed error boundary bug and removed hardcoding of the frontend event exception state

* formatted the code after conflict resolution

* fixed type of the error_boundary

* ruff format

---------

Co-authored-by: Maxim Vlah <m.vlah@senbax.de>
Co-authored-by: Masen Furer <m_github@0x26.net>
2024-07-09 11:19:14 -07:00
abulvenz
5071245127
feat: Adding an event to go back just as the user would. (#3636)
* feat: Adding an event to go back just as the user would.

* fix: Simplification suggested by masenf.

* fix: And now apply the fix to the right function.
2024-07-09 11:18:02 -07:00
benedikt-bartscher
d621115f9b
add Bare SQLAlchemy mutation tracking, improve typing (#3628) 2024-07-09 11:13:28 -07:00
Masen Furer
9e1789a6c2
[REF-3076] Do not purge .web/pages in dev mode (#3592)
* [REF-3067] Do not purge .web/pages in dev mode

Avoid race condition in hot reload that occurs when pages are removed before
they are recreated.

Fix #3416

* use constants instead of hardcoded string
2024-07-08 20:17:38 -07:00
Maxim Vlah
772a3ef893
Catch unhandled errors on both frontend and backend (#3572) 2024-07-08 19:26:11 -07:00
benedikt-bartscher
6d3321284c
fix sqla python_type issues, add tests (#3613) 2024-07-08 19:21:08 -07:00
benedikt-bartscher
09ff952d01
only write .gitignore if needed (#3618) 2024-07-08 19:19:19 -07:00
Masen Furer
e71acececc
pyproject.toml: bump to 0.5.6 (#3635) 2024-07-08 17:31:36 -07:00
benedikt-bartscher
f71400896b
gitignore external assets by default (#3621) 2024-07-08 12:30:56 -07:00
Tom Gotsman
b20f3ac29a
update graphing (#3606)
* update graphing

* fix pyi

* update graphing

rebase#

* fix pyi

* precommit fail

* fix pyi generator file

* update pyi again

* pyi

* fix pyi generator to have single line builtin check

* change dict to Dict

---------

Co-authored-by: Tom Gotsman <tomgotsman@toms-mbp.lan>
Co-authored-by: Tom Gotsman <tomgotsman@Toms-MacBook-Pro.local>
Co-authored-by: Lendemor <thomas.brandeho@gmail.com>
2024-07-04 14:03:47 +02:00
Alek Petuskey
efe6954552
minor chart clean up (#3551)
* minor chart clean up

* PYI

* fix base pyi

* fix pyi issues

* fix cartesian.pyi

---------

Co-authored-by: Alek Petuskey <alekpetuskey@Aleks-MacBook-Pro.local>
Co-authored-by: Lendemor <thomas.brandeho@gmail.com>
2024-07-04 03:27:07 +02:00
Khaleel Al-Adhami
046c0f9760
add immutable var class (#3607)
* add immutable var class

* add missing docs

* override _replace

* fix type imports

* override create as well

* remove deprecated properties and arguments

* remove unused code in ImmutableVar

* fix namespace issue

* no Self in 3.8
2024-07-03 11:23:04 -07:00
Tom Gotsman
59752d0cde
small update (#3612)
Co-authored-by: Tom Gotsman <tomgotsman@toms-mbp.lan>
2024-07-03 09:13:40 -07:00
benedikt-bartscher
8304886cac
dedupe config overrides (#3600) 2024-07-03 17:34:22 +02:00
Masen Furer
7cbd2848ce
[REF-3157] Avoid SQLModel metaclass conflict (#3610)
Ensure that reflex.utils.compat is loaded whenever `reflex` itself is imported
to try and avoid the sqlmodel metaclass conflict error that arises when
sqlmodel is imported first with pydantic v2, but reflex Model inherits from
rx.Base which is based on pydantic v1.

Fix #3515
2024-07-03 15:58:21 +02:00
Masen Furer
75c5fa2ffe
[REF-3220] Fix rx.cancel_upload EventSpec (#3608)
The formatting of the upload ID had extra single quotes that were not needed.
Now that `_var_name_unwrapped` is used, any `str`-like Vars will automatically
be formatted with backticks
2024-07-03 15:55:41 +02:00
Masen Furer
df7d7b0ba0
Update links to /docs/library/dynamic-rendering/foreach/ (#3609) 2024-07-02 13:41:26 -07:00
benedikt-bartscher
b742afb27f
do not get_config in global scope (#3597)
* do not get_config in global scope

* ruff fixes

* pydantic v1 compatibility
2024-07-01 10:17:40 -07:00
Thomas Brandého
f0bab665ce
split lifespan and middleware logic in separate mixin files (#3557)
* split lifespan and middleware logic in separate mixin files

* fix for 3.8

* fix for unit tests

* add missing sys import

---------

Co-authored-by: Masen Furer <m_github@0x26.net>
2024-06-29 08:50:04 -07:00
benedikt-bartscher
ad1d82f7ad
cleanup unused check (#3590) 2024-06-29 08:48:31 -07:00
Masen Furer
f1dafc0373
pyi_generator cleanup: ruff, remove fully qualified reflex. names (#3591)
* pyi_generator: avoid fully qualified names for reflex. types

The previous method added quite a large line diff to the pyi files, so for now,
lets just add the `Breakpoints` import to the default set along with Var,
EventHandler, Style and others.

* pyi_generator: fix generated files using ruff

also generate updated pyi files in reflex/experimental namespace

* remove black from dev dependencies

* poetry.lock: relock deps

* Update all pyi files with new formatting

* pre-commit fixes

* pyi_generator: fix __init__.pyi files again
2024-06-29 08:48:01 -07:00
Alek Petuskey
1c3d65dd52
Change Strategy Prop to Literal (#3575)
* Better type strategy prop

* Add beter description

* Pre commit

* fix pyi generation

* Default prop assignment must be Var to pass type checking

* fix script.pyi

---------

Co-authored-by: Alek Petuskey <alekpetuskey@Aleks-MacBook-Pro.local>
Co-authored-by: Masen Furer <m_github@0x26.net>
2024-06-28 18:02:37 -07:00
Khaleel Al-Adhami
d253fc4dcd
add responsive props to radix components (#3583)
* implement basic behavior to handle both radix and css

* add all components in theme, AND change pyi to include path of reflex types

* order type annotations in pyi_generator (#3585)

* order type annotations in pyi_generator

* run pyi_generator

* classvars should not be backend vars (#3578)

* classvars should not be backend vars

* cleanup RESERVED_BACKEND_VAR_NAMES

* order type annotations in pyi_generator (#3585)

* order type annotations in pyi_generator

* run pyi_generator

* do not validate non-cached var deps (#3576)

* do not validate non-cached var deps

* further improve Exceptions for misconfigured var deps

* order type annotations in pyi_generator (#3585)

* order type annotations in pyi_generator

* run pyi_generator

* fix git merge remains

* define function globally

* use more modern annotations

* only trigger when direct value and not state

* simplify unions

* accidentally removed avatar oop

---------

Co-authored-by: benedikt-bartscher <31854409+benedikt-bartscher@users.noreply.github.com>
2024-06-28 17:01:23 -07:00
benedikt-bartscher
b7651e214b
add computed backend vars (#3573)
* add computed backend vars

* finish computed backend vars, add tests

* fix token for AppHarness with redis state manager

* fix timing issues

* add unit tests for computed backend vars

* automagically mark cvs with _ prefix as backend var

* fully migrate backend computed vars

* rename is_backend_variable to is_backend_base_variable

* add integration test for implicit backend cv, adjust comments

* replace expensive backend var check at runtime

* keep stuff together

* simplify backend var check method, consistent naming, improve test typing

* fix: do not convert properties to cvs

* add test for property

* fix cached_properties with _ prefix in state cls
2024-06-28 17:01:07 -07:00
benedikt-bartscher
bcc7a61452
improve backend var determination (#3587)
* cleanup reserved backend var check

* cleanup backend var determination mess

* add tests for hidden and class methods
2024-06-28 14:07:39 -07:00
Elijah Ahianyo
8f2cbb5ea1
[REF-2588]Clear color mode local storage for dev mode (#3548)
* Clear color mode local storage

* use the last compiled time logic to determine when to clear local storage

* precommit fix

* app harness fix

* run prettier on reflex/.templates/web/utils/helpers/color_mode.js

* make sure last_compiled_time is updated for stateless apps as well.

* set the chkara-ui-color-mode cookie instead of clearing it, so it is integrated in the app's useEffect cycle

* fix CI

* fix import formatting

---------

Co-authored-by: Masen Furer <m_github@0x26.net>
2024-06-28 13:57:34 -07:00
benedikt-bartscher
a6bdaf1bbe
fix var dependency over properties (#3588) 2024-06-28 12:48:28 -07:00
benedikt-bartscher
33d7ec1f04
copy backend vars from mixins (#3580)
* copy backend vars from mixins

* fix and improve backend var mixin test
2024-06-28 10:42:41 -07:00