Commit Graph

2059 Commits

Author SHA1 Message Date
Thomas Brandého
7168b42bab
versions bump before 0.6.4 (#4208) 2024-10-21 12:56:36 -07:00
benedikt-bartscher
7560bf6429
allow setting run mode via env, add helpers to determine it (#4168) 2024-10-21 12:26:09 -07:00
Khaleel Al-Adhami
fcc97b0402
upgrade node to latest lts (#4191) 2024-10-21 12:11:00 -07:00
Masen Furer
6cb87a812f
Fix runtime error on python 3.11.0 (#4197)
All generic types present in a Union must be parametrized on 3.11.0 if any
other generic types in the union are parametrized.

This appears to be a bug in 3.11.0, as the behavior is not observed in 3.11.1
or 3.10; fixing here as this is technically more correct anyway and avoids a
crash.
2024-10-17 19:21:43 -07:00
Masen Furer
330c280c78
When REDIS_URL is set, use redis, regardless of config preference. (#4196)
We might change this down the road, but we don't want to introduce a breaking
change at this time.
2024-10-17 16:54:36 -07:00
Masen Furer
e14c79d57d
[ENG-3954] Treat ArrayVar.foreach index as int (#4193)
* [ENG-3954] Treat ArrayVar.foreach index as int

* foreach: convert return value to a Var

When the value returned from the foreach is not hashable (mutable type), then
it will raise an exception if it is not first converted to a LiteralVar.
2024-10-17 16:16:24 -07:00
Khaleel Al-Adhami
101fb1b540
check for none before returning which (#4187) 2024-10-16 15:21:47 -07:00
Khaleel Al-Adhami
35810fe1bd
use larger or equal for node version check (#4189) 2024-10-16 15:20:51 -07:00
Khaleel Al-Adhami
d8ea2fc795
fix pyi for untyped event handlers (#4186)
* fix pyi for untyped event handlers

* no more empty lambdas
2024-10-16 13:39:49 -07:00
Alek Petuskey
13c9094343
Remove demo command (#4176)
* Remove demo command

* Format

---------

Co-authored-by: Alek Petuskey <alekpetuskey@Aleks-MacBook-Pro.local>
2024-10-16 11:35:56 -07:00
Masen Furer
da9d7eabdd
Arbitrary arg access two levels deep for untyped handler (#4180)
* Arbitrary arg access two levels deep for untyped handler

Provide drop-in compatibility with existing component wrapping code
that was accessing attributes on the default handler arg type.

* py3.9 compat
2024-10-16 11:35:27 -07:00
Masen Furer
4422515f4b
LiteralEventChainVar becomes an ArgsFunctionOperation (#4174)
* LiteralEventChainVar becomes an ArgsFunctionOperation

Instead of using the ArgsFunctionOperation to create the string representation
of the _js_expr, make the identity of the var an ArgsFunctionOperation so the
_args_names and _return_expr remain accessible.

Rely on the default behavior of ArgsFunctionOperation to create the
_cached_var_name / _js_expr value.

This allows the compat shim in `format_event_chain` to remain functional, as it
does special handling for ArgsFunctionOperation to retain the previous behavior
of that function (this was a regression introduced in 0.6.2).

* _var_type is EventChain; fix parent class order

* Re-fix LiteralEventChainVar inheritence list w/ comment

* [ENG-3942] LiteralEventVar becomes VarCallOperation

instead of using `.call` when constructing the `_js_expr`, have the identity of
a LiteralEventVar as a VarCallOperation to take advantage of the _var_data
carrying.

* add event overlords

* EventCallback descriptor always returns EventSpec from class

Relax actual `__get__` definition to support the multitude of overloads

* test case for event related vars carrying _var_data

---------

Co-authored-by: Khaleel Al-Adhami <khaleel.aladhami@gmail.com>
2024-10-16 11:35:09 -07:00
Khaleel Al-Adhami
7565ae15ef
disk is memory is disk (#4185) 2024-10-16 11:31:05 -07:00
Khaleel Al-Adhami
2018be8e08
only treat dict object vars as key value mapping (#4177) 2024-10-15 12:21:03 -07:00
Masen Furer
5b802c2c9e
bump version to 0.6.4dev1 for further development (#4178) 2024-10-15 10:54:14 -07:00
Masen Furer
3a14025999
pin AppHarness tests to ubuntu-22.04 runner (#4173) 2024-10-14 15:36:30 -07:00
Manoj Bhat
d6797a1f1d
Change the defalut direction of radio group (#4070). (#4146)
- The default direction of radio groups is column.
- Since most use cases are horizontal, change the default direction from
  column to row.
2024-10-14 08:47:38 -07:00
Masen Furer
1d268f8b13
Support aria and data props (#4149)
* Support aria and data props

* Fix busted docstring

* Ignore special_attributes logic for defined props

* simplify special attribute checking logic

avoid special cases in the special case handling code 🙄
2024-10-14 08:45:25 -07:00
Khaleel Al-Adhami
b2d2719f90
add type hinting to events (#4145)
* add type hinting to events

* fix pyi

* make it a list

* add on change

* dang it darglintz

* add future annotations

* add try except becuse i hate this

* add check for class

* aaaa

* sometimes you need to make hard decisions

* ono

* i hate unions

* add rx event

* move stuff around

* maybe

* special case osmething

* i don't need no test

* remove stray print

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

* remove another stray print

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

* add rx event

---------

Co-authored-by: Masen Furer <m_github@0x26.net>
2024-10-14 08:44:31 -07:00
Khaleel Al-Adhami
b1d449897a
unionize base var fields types (#4153)
* unionize base var fields types

* add tests

* fix union types for vars (#4152)

* remove 3.11 special casing

* special case on version

* fix old versions of python

---------

Co-authored-by: Masen Furer <m_github@0x26.net>
2024-10-11 17:27:15 -07:00
benedikt-bartscher
0889276e24
Do not auto-determine generic args if already supplied (#4148)
* add failing test for figure_out_type

* do not auto-determine generic args if already supplied

* move has_args to utils.types, add tests for it
2024-10-11 17:08:39 -07:00
Masen Furer
736b2a6ea9
Handle rx.State subclasses defined in function (#4129)
* Handle rx.State subclasses defined in function

* create a new container module: `reflex.istate.dynamic` to save references to
  dynamically generated substates.
* for substates with `<locals>` in the name, copy these to the container module
  and update the name to avoid duplication.
* add test for "poor man" ComponentState

Fix #4128

* test_state: disable local def handling for dupe-detection test

* Track the original module and name for type hint evaluation

Also use the original name when checking for the "mangled name" pattern when
doing undeclared Var assignment checking.
2024-10-11 16:51:10 -07:00
Masen Furer
a2862bd102
Allow setting a different invocation function for EventChain (#4160)
In rx.call_script scenario, the EventChain must call `queueEvents` and
`processEvent` instead of `addEvents`, because the former are in scope in the
call_script eval environment where `addEvents` is not.

This is an escape hatch for certain wrapping scenarios.
2024-10-11 16:49:40 -07:00
Khaleel Al-Adhami
0311dae568
only read if it's *not* empty (#4165) 2024-10-11 16:49:01 -07:00
Khaleel Al-Adhami
1eb92fa39b
change bun install link to main (#4164) 2024-10-11 15:51:30 -07:00
Khaleel Al-Adhami
189700ecb3
Change bun link (#4162)
* change bun to download from us

* make it use branch
2024-10-11 15:43:54 -07:00
Khaleel Al-Adhami
210c1ed902
fix union types for vars (#4152) 2024-10-11 11:39:31 -07:00
Carlos
3da1a8d082
default props comment for Axis (#4109)
* default props comment for Axis

* update
2024-10-10 15:10:42 -07:00
Carlos
efd633e76a
default props comment for Pie (#4103) 2024-10-10 15:10:28 -07:00
Carlos
c3d7cd0da1
default props comment for PolarRadiusAxis (#4108)
* default props comment for PolarRadiusAxis

* update
2024-10-10 15:10:11 -07:00
Carlos
ec6990fb71
default props comment for RadialBar (#4105)
* default props comment for RadialBar

* update
2024-10-10 13:04:49 -07:00
Carlos
ee3182a2df
default props comment for Cartesian (#4114)
* default props comment for Cartesian

* add animation events

* update
2024-10-10 13:00:23 -07:00
Carlos
4a314394fd
default props comment for ErrorBar (#4120)
* default props comment for ErrorBar

* union int float

* update
2024-10-10 12:59:38 -07:00
Carlos
132a3d4d1d
default props comment for Funnel (#4119)
* default props comment for Funnel

* update
2024-10-10 12:58:38 -07:00
Carlos
11abaf8055
default props comment for Grid (#4125) 2024-10-10 12:57:46 -07:00
Thomas Brandého
6f586c8b8f
let users pick state manager mode (#4041) 2024-10-10 12:22:35 -07:00
benedikt-bartscher
1aed39a848
catch ValueError("I/O operation on closed file.") if frontend crashes (#4150) 2024-10-10 12:18:57 -07:00
Khaleel Al-Adhami
8ec3cf6157
remove dictify from state dict (#4141) 2024-10-10 12:18:18 -07:00
abulvenz
87648af3ee
fix: Determine var type from value. (#4143) 2024-10-09 17:33:34 -07:00
benedikt-bartscher
7a971e5842
fix docstring (#4140) 2024-10-09 13:42:44 -07:00
Khaleel Al-Adhami
91ab8ac574
Remove wrong event handlers (#4136)
* remove wrong target value

* add keyboard event

* simplify empty ones

* remove events from text_area

* empty tuples are empty bruh

* dangit darglint
2024-10-09 13:25:41 -07:00
Thomas Brandého
60b6d4e7f2
only run macOS job on merge (#4139)
* update workflow

* skip more in unit tests

* try something else to prevent adding macos job to pool

* exclude too much

* fix units-text with macOS excluded

* also drop macOS job in integration tests

* readd macos job separately to only run on merge
2024-10-09 13:24:03 -07:00
ruhz3
f3b8b2e336
First use environment variable as npm registry (#4082)
* First use environment variable as npm registry

* use NPM_CONFIG_REGISTRY as env variable

---------

Co-authored-by: 류형주/인공지능팀 <hyungju.ryu@ahnlab.com>
2024-10-09 11:36:33 -07:00
Nguyễn Minh Phú
0e7627d1c4
Add Vietnamese README docs (#4138) 2024-10-09 08:58:08 -07:00
Carlos
ffcf87d587
default props comment for Radar (#4104) 2024-10-08 17:00:42 -07:00
Carlos
535c8f904d
default props comment for funnelchart (#4097) 2024-10-08 16:54:45 -07:00
Carlos
c244418aaa
default props comment for Reference (#4121) 2024-10-08 16:51:36 -07:00
Carlos
4a3fd592e9
default props comment for PolarGrid (#4107) 2024-10-08 16:51:26 -07:00
Carlos
ce8695c14c
default props comment for categoricalchartbase (#4091) 2024-10-08 16:45:43 -07:00
Carlos
65c174ed78
areachart default value for base_value (#4090) 2024-10-08 16:45:29 -07:00