Commit Graph

2156 Commits

Author SHA1 Message Date
Masen Furer
24ff29f74d
bump to 0.6.7dev1 for further development (#4434) 2024-11-26 14:04:36 -08:00
Elijah Ahianyo
80696fec63
Remove invitation code logic from reflex logoutv2 (#4433)
* what happened there?

* we should do this for v2 instead
2024-11-25 12:14:50 -08:00
Thomas Brandého
f490643b25
follow up to #4426 (#4436) 2024-11-25 11:27:07 -08:00
Thomas Brandého
51ca89bc5c
allow for 'go.Figure | None' annotation in State (#4426) 2024-11-25 19:45:29 +01:00
benedikt-bartscher
d7d46e431b
fix: state size was not checked for dill (#4431) 2024-11-25 10:38:52 -08:00
Thomas Brandého
697e26c25b
fix mutable default in EventNamespace (#4420) 2024-11-23 10:51:07 -08:00
Masen Furer
c7d3876fe6
[ENG-4137] Handle generic alias passing inspect.isclass check (#4427)
On py3.9 and py3.10, `dict[str, str]` and other typing forms are kinda
considered classes, but they still fail when doing `issubclass`, so
specifically exclude generic aliases before calling issubclass.

Fix #4424

Bonus fix: support upcasting of pydantic v1 and v2 models
2024-11-23 10:48:50 -08:00
Masen Furer
000938414f
Avoid set_log_level foot gun (#4422) 2024-11-22 12:31:59 -08:00
Simon Young
c29c6b657a
Simon/hosting cli upgrades (#4417)
* update cli version

* little change man

* thats ruff

* v bump

---------

Co-authored-by: simon <simon@reflex.dev>
2024-11-21 17:50:35 -08:00
benedikt-bartscher
a5486335a3
rx._x.asset improvements (#3624)
* wip rx._x.asset improvements

* only add symlink if it doesn't already exist

* minor improvements, add more tests

* use deprecated Generator for python3.8 support

* improve docstring

* only allow explicit shared, only validate local assets if not backend_only

* fix darglint

* allow setting backend only env to false.

* use new is_backend_only in assets

* ruffing

* Move to `rx.asset`, retain old API in `rx._x.asset`

---------

Co-authored-by: Masen Furer <m_github@0x26.net>
2024-11-21 17:16:43 -08:00
Masen Furer
a6b324bd3e
[ENG-3953] Support pydantic BaseModel (v1 and v2) as state var (#4338)
* [ENG-3953] Support pydantic BaseModel (v1 and v2) as state var

Provide serializers and mutable proxy tracking for pydantic models directly.

* conditionally define v2 serializer

Co-authored-by: Khaleel Al-Adhami <khaleel.aladhami@gmail.com>

* Add `MutableProxy._is_mutable_value` to avoid duplicate logic

* Conditionally import BaseModel to handle older pydantic v1 versions

* pre-commit fu

---------

Co-authored-by: Khaleel Al-Adhami <khaleel.aladhami@gmail.com>
2024-11-21 17:01:14 -08:00
Elijah Ahianyo
5702a18502
[GTM-836]Rework Init workflow (#4377)
* Rework Init workflow

* minor format

* refactor

* add comments

* fix pyright alongside some improvements

* add demolink for blank template

* fix darglint

* Add more templates and keep template name in kebab case

* revert getting other templates since we'll use the submodules approach

* remove debug statement

* Improvements based on standup comments

* Add redirect logic

* changes based on new flow

---------

Co-authored-by: Masen Furer <m_github@0x26.net>
2024-11-21 16:58:12 -08:00
Elijah Ahianyo
9faa5d6fd9
Downgrade syntax highlighter to fix wrapLongLines (#4368) 2024-11-21 16:54:15 -08:00
benedikt-bartscher
c13cec3d8a
implement performance mode for existing state size check (#4392) 2024-11-21 16:33:47 -08:00
Masen Furer
b5e4b02d9c
New Event Action: temporal (#4404)
When an event/event spec is marked as "temporal", it will not be queued unless
the backend is up. This can be used to prevent periodic events (like from
`rx.moment`) from queueing up while the backend is down, and then stampeding
when the backend comes up and the queue is drained. It can be used to avoid
processing many periodic events at once when the app is only expecting to
process such an event every so often.
2024-11-21 16:32:38 -08:00
Masen Furer
bbfbc82c9d
Handle Var passed to rx.toast (#4405)
* Handle Var passed to `rx.toast`

If the user provides a `Var` for `message` then apply it as `props["title"]` to
avoid a var operations error.

* remove unnecessary parentheses

* remove weird hacks

* get it right pyright

---------

Co-authored-by: Khaleel Al-Adhami <khaleel.aladhami@gmail.com>
2024-11-21 16:15:01 -08:00
Thomas Brandého
d4b197b517
fix for event handlers in py3.9 (#4416) 2024-11-21 12:41:48 -08:00
benedikt-bartscher
e0984aa834
Allow bound method as event handler (#4348)
* subtract 1 arg if the method is a bound method

* fix it early in user_args

* only bound methods pls

* add test
2024-11-21 11:53:50 -08:00
benedikt-bartscher
ecb52651c3
allow to disable checking for the latest package version via env (#4407) 2024-11-21 11:06:47 -08:00
Thomas Brandého
095c1e5b7f
remove deprecation for these events (#4415) 2024-11-21 11:05:02 -08:00
Masen Furer
05956c84a7
protect sys.path manipulation with a mutex (#4408)
Compiling pages in separate threads can result in `sys.path` being cleared,
which breaks subsequent imports.
2024-11-21 10:29:40 -08:00
Masen Furer
81583d45ca
[HOS-313] state.js: when a routing error occurs, delete it (#4410)
In some cases, a routing failure can cause the failure to be cached. When the
router has a cached failure, pushing such a route will never call
routeChangeComplete, and thus on_load event will never be fired for that route.

Purposely clearing the error from the router allows the page to properly load
on subsequent attempts without refreshing the app.
2024-11-21 10:27:44 -08:00
Masen Furer
4571524e1c
[ENG-4130] Disable typer/rich integration appropriately (#4412)
The `rich` module should be set to `None`, indicating that rich should not be used.

Setting it to `False` worked before, but recently added code in typer fails
when checking `if rich is not None`.

ref: https://github.com/fastapi/typer/pull/847
2024-11-21 13:11:34 +01:00
Thomas Brandého
681b616000
fix appearance broken by #3812 (#4403)
* fix appearance broken by #3812

* fix again to pass tests
2024-11-20 11:12:52 -08:00
Khaleel Al-Adhami
229df1ce09
ignore rxconfig not in cwd (#4398)
* ignore rxconfig not in cwd

* no type ignore

* resolve paths

* Remove rxconfig module from sys.modules cache when reloading

* modify sys path

* add try except

* refactor inner function

---------

Co-authored-by: Masen Furer <m_github@0x26.net>
2024-11-19 16:46:55 -08:00
Masen Furer
67296d43c0
Don't skip serialization when Var is callable (#4399) 2024-11-19 16:33:27 -08:00
Alek Petuskey
bffff01acb
Add datetime to moment (#4381)
* Add datetime to moment

* Remove recharts update

* Support other formats

* simplify

* Precommit

* PYI

* change imports for pyi compat

---------

Co-authored-by: Alek Petuskey <alekpetuskey@Aleks-MacBook-Pro.local>
Co-authored-by: Masen Furer <m_github@0x26.net>
2024-11-19 09:29:11 -08:00
Khaleel Al-Adhami
bcea79cd45
add typed dict type checking (#4340)
* add typed dict type checking

* technically it has to be a mapping, not specifically a dict
2024-11-18 19:28:38 -08:00
benedikt-bartscher
1f9a17539c
fix: do not allow instantiation of State mixins (#4347)
* fix: do not allow instantiation of State mixins
Closes #4343

* improve error message for ComponentState mixins

* fix typo

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

---------

Co-authored-by: Masen Furer <m_github@0x26.net>
2024-11-18 19:15:01 -08:00
Thomas Brandého
af4fe48428
[maintenance] bump some packages versions (#4385)
* bump some versions

* update ruff to 0.7.4

* bump tailwind version

* relock deps

---------

Co-authored-by: Masen Furer <m_github@0x26.net>
2024-11-18 18:56:28 -08:00
Thomas Brandého
adaf49e4f9
make list suggestions work in rx.input (#4391)
* make list suggestions work

* fix pyi
2024-11-18 18:22:01 -08:00
Khaleel Al-Adhami
22329e592e
add debug statement to evaluate page (#4396) 2024-11-18 18:21:45 -08:00
Simon Young
3f58ceef95
update cli version (#4394)
Co-authored-by: simon <simon@reflex.dev>
2024-11-18 16:59:54 -08:00
Masen Furer
6494683c27
Fix ternary logic when printing template name (#4393) 2024-11-19 00:11:04 +01:00
Masen Furer
34c11fdf10
require typing_extensions >= 4.6.0 (#4373)
* require typing_extensions >= 4.6.0

TypeAliasType was added in 4.6

https://github.com/python/typing_extensions/blob/main/CHANGELOG.md#release-460-may-22-2023

* update lock file, even though nothing has changed
2024-11-18 10:31:11 -08:00
benedikt-bartscher
dc347d10b3
fix: Failed to CreateArtifact (#4339) 2024-11-15 16:27:05 -08:00
Thomas Brandého
e45b76c01e
fix noSSRComponent imports (#4386) 2024-11-15 21:43:55 +01:00
Alek Petuskey
79a5409a8e
Update bug_report.md (#4382) 2024-11-13 20:42:29 -08:00
Elijah Ahianyo
853a9d8614
Add template name to reflex init success msg (#4349)
* Add template name to reflex init success msg

* fix pyright message
2024-11-13 10:24:36 +00:00
Khaleel Al-Adhami
27c1a7e94d
add typing to function vars (#4372)
* add typing to function vars

* import ParamSpec from typing_extensions

* remove ellipsis as they are not supported in 3.9

* try importing everything from extensions

* special case 3.9

* don't use Any from extensions

* get typevar from extensions
2024-11-12 20:00:02 -08:00
Masen Furer
5d88263cd8
[ENG-4098] Deconfuse key/value of State.get_value / dict / get_delta (#4371)
Because of some dodgy logic in Base.get_value and State.dict / State.get_delta
when the value of some state var X happened to be the name of another var in
the state Y, then the value for X would be returned as the value of Y.

wat.

Fixes #4369
2024-11-12 13:24:06 -08:00
Masen Furer
2b7ef0dccc
Temporarily downpin @radix-ui/themes <3.1.5 (#4370)
* Temporarily downpin @radix-ui/themes <3.1.5

A visual/style regression was introduced in @radix-ui/themes 3.1.5
as described in radix-ui/themes#627 which reflex needs to avoid.

* Get expected radix library version from component
2024-11-12 12:44:59 -08:00
Khaleel Al-Adhami
a1158cdb1c
redesign error boundary screen (#4329)
* redesign error boundary screen

* pyi time

* add color

* i hate python 3.9
2024-11-12 12:36:42 -08:00
1Codev
7cf3050da0
Path change after Astral 0.5.0 update (#4336)
* Astral 0.5.0 path change

https://github.com/astral-sh/uv/releases

Use XDG (i.e. ~/.local/bin) instead of the Cargo home directory in the installer

* Fix path in production-app-platform example

---------

Co-authored-by: Masen Furer <m_github@0x26.net>
2024-11-12 09:57:58 -08:00
Masen Furer
686548cbb1
Only pass Model.__fields__ when casting event args (#4356)
Attempting to initialize relationship fields in a sqlmodel model throws an
error, so only pass defined pydantic __fields__ if the type is a Model.
2024-11-11 16:14:08 -08:00
Masen Furer
35c8afd8c8
Bump reflex-hosting-cli dep to 0.1.15 for v2 (#4355) 2024-11-11 16:12:01 -08:00
Masen Furer
082f9a0bd1
export Color and ImportDict in top-level namespace (#4352)
These are useful for typing purposes and should be exposed at the top level to
avoid requiring deep imports from subpackages that we may need to change later.
2024-11-11 14:41:31 -08:00
Masen Furer
f78e3f54ef
bump to 0.6.6dev1 for further development (#4351) 2024-11-11 14:41:18 -08:00
Khaleel Al-Adhami
e0d1a58496
fix upload argspec being missing (#4335) 2024-11-08 10:12:29 -08:00
Elijah Ahianyo
cd59ab5406
[ENG-4010]Codeblock cleanup in markdown (#4233)
* Codeblock cleanup in markdown

* Initial approach to getting this working with rx.memo and reflex web

* abstract the map var logic

* the tests are not valid + pyright fix

* darglint fix

* Add unit tests plus mix components

* pyi run

* rebase on main

* fix darglint

* testing different OS

* revert

* This should fix it. Right?

* Fix tests

* minor fn signature fix

* use ArgsFunctionOperation

* use destructured args and pass the tests

* fix remaining unit tests

* fix pyi files

* rebase on main

* move language regex on codeblock to markdown

* fix tests

---------

Co-authored-by: Khaleel Al-Adhami <khaleel.aladhami@gmail.com>
2024-11-07 19:18:14 -08:00