Commit Graph

1576 Commits

Author SHA1 Message Date
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
benedikt-bartscher
a7e4594fdc
Deprecate cached var (#3582)
* deprecate cached_var partial

* migrate cached_var to var(cache=True)

* fix darglint (typo)
2024-06-28 10:14:55 -07:00
Masen Furer
1ca0a27d4d
[REF-3164] Hack to fix Windows hot reload + Uvicorn upgrade (#3584)
Now that we have a hack to work around hot reload issues in Uvicorn on Windows,
we can remove the pin and use the latest version.
2024-06-28 10:07:27 -07:00
benedikt-bartscher
44d27f9e4c
do not validate non-cached var deps (#3576)
* do not validate non-cached var deps

* further improve Exceptions for misconfigured var deps
2024-06-27 17:00:55 -07:00
benedikt-bartscher
8e66c9b3c7
classvars should not be backend vars (#3578)
* classvars should not be backend vars

* cleanup RESERVED_BACKEND_VAR_NAMES
2024-06-27 16:03:36 -07:00
benedikt-bartscher
2027a2f09f
order type annotations in pyi_generator (#3585)
* order type annotations in pyi_generator

* run pyi_generator
2024-06-27 15:58:11 -07:00
Masen Furer
8eb834f816
Add a link to backend in connection error (#3044)
* Automatic authentication for backend on Github Codespaces

When running reflex on Github codespaces, the port forwarding mechanism
requires authentication, which happens automatically when first accessing the
port via HTTPS; however since the backend connects over the WSS protocol
instead, it gets an access error with no way to redirect to Github's
authentication servers to get the port open.

This PR adds an automatic redirection mechanism to a backend route when there
is a connection error accessing the frontend. After the backend route loads, it
redirects back to the frontend, but now it can connect to the backend via
websocket because the port forward is authenticated.

* manually update .pyi file 🫨
2024-06-27 12:20:03 -07:00
Khaleel Al-Adhami
82a0d7f3fb
introduce customizable breakpoints (#3568)
* introduce customizable breakpoints
2024-06-27 01:34:49 +03:00
Thomas Brandého
6863e8ce8c
show the value causing problem in deprecation warning (#3558) 2024-06-26 13:25:23 -07:00
Thomas Brandého
cca037421b
add props for tabs (#3560) 2024-06-26 13:24:47 -07:00
Elijah Ahianyo
31bd75ff39
[REF-3185][REF-3180]Dont escape backticks in JS string interpolation (#3566)
* Dont escape backticks in JS string interpolation

* add unit tests

* Fix darglint

* add a note to re-visit after new Var API is implemented

* tests should have a good meaning
2024-06-26 13:23:07 -07:00
benedikt-bartscher
d425ede401
fix formatting (#3574) 2024-06-26 13:19:55 -07:00
Thomas Brandého
3c8179d987
add compilation time in log (#3563) 2024-06-26 09:58:35 -07:00
Thomas Brandého
237aa22306
update dependency pinning (#3556) 2024-06-26 09:53:12 -07:00
Elijah Ahianyo
28a72efc83
Radio group fix deprecation warning for creating vars with strings (#3567) 2024-06-26 09:52:56 -07:00
abulvenz
d90fa8a266
fix: Using default components instead of chakra. (#3570) 2024-06-26 09:23:53 -07:00
Thomas Brandého
764f723829
fix small typing issue (#3562) 2024-06-26 09:23:20 -07:00
Masen Furer
956bc0a397
Add Clipboard component for handling global on_paste event (#3513)
* Add Clipboard component for handling global on_paste event

* py3.8 compat

* py3.8 compat (p2)
2024-06-26 09:22:24 -07:00
benedikt-bartscher
9d71bcbbb5
bare sqlalchemy session + tests (#3522)
* add bare sqlalchemy session, Closes #3512

* expose sqla_session at module level, add tests, improve typing

* fix table name

* add model_registry fixture, improve typing

* did not meant to push this

* add docstring to model_registry

* do not expose sqla_session in reflex namespace
2024-06-25 15:29:01 +02:00
Emmanuel Onwuegbusi
e4c17deafb
Fix radix radio cards component (#3545)
* ruff format

* fix radio card component

* generated radio_cards.pyi

* ruff format
2024-06-25 15:23:30 +02:00
Masen Furer
0314d19e7e
Ensure rx.match gets memoized to avoid excessive re-rendering (#3552) 2024-06-25 15:20:04 +02:00
Masen Furer
6947ec3a28
bump to 0.5.5 (#3550) 2024-06-24 18:36:20 -07:00
benedikt-bartscher
41efe12e9a
Validate ComputedVar dependencies, add tests (#3527) 2024-06-24 16:11:42 -07:00
Elijah Ahianyo
f037df0977
[REF-3056] Config knob for redis StateManager expiration times (#3523) 2024-06-24 16:03:30 -07:00
alex
44233c9cd1
Added german translation and updated the language links in the README.md files to include german. (#3547)
Co-authored-by: alex <alex@alexdot.me>
2024-06-24 16:35:35 +02:00
Masen Furer
b2b0da036d
[REF-3149] Bring back py3.12 hot reload warning (#3537)
Warning for issue #3536

Co-authored-by: Lendemor <thomas.brandeho@gmail.com>
2024-06-24 16:24:42 +02:00
Thomas Brandého
046dbdef63
fix hydration error (#3542) 2024-06-21 21:34:47 +02:00
Masen Furer
1a74ff4d45
[REF-3079] state.js: disconnect websocket for window "pagehide" event (#3540)
All major browser use a "bfcache" to freeze pages when navigating away from the
domain, then they restore the page when going back.

However if the page uses websockets, these get kind of stuck unless you
disconnect them before freezing (and have a mechanism for reconnecting, which
we already do).

Ref: https://web.dev/articles/bfcache

Fix #3478
2024-06-21 18:28:29 +02:00