Commit Graph

1859 Commits

Author SHA1 Message Date
Masen Furer
9308caa215
bump to v0.6.3.post1 2024-10-23 16:11:58 -07:00
Masen Furer
68de3f41c4
[ENG-3989] Ensure non-serialized states are present in StateManagerDisk (#4230)
If a non-root state was serialized, but its substates were not, then these
would not be populated when reloading the pickled state, because only substates
from the root were being populated with fresh versions.

Now, capture the substates from all fresh states and apply them to the
deserialized state for each substate to ensure that the entire state tree has
all substates instantiated after deserializing, even substates that were never
serialized originally.
2024-10-23 16:11:06 -07:00
Masen Furer
addf633692
pyproject.toml: bump to 0.6.3 2024-10-18 09:22:07 -07:00
Masen Furer
004518dd51
pyproject: bump to 0.6.3a4 2024-10-17 19:22:20 -07:00
Masen Furer
b112d35f62
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:22:12 -07:00
Masen Furer
2aea1f29b6
pyproject: bump to 0.6.3a3 2024-10-17 16:58:16 -07:00
Masen Furer
0457cbd747
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:58:08 -07:00
Masen Furer
a6b2e640ac
[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:58:07 -07:00
Masen Furer
542382c3e7
bump to 0.6.3a2 2024-10-16 15:15:08 -07:00
Khaleel Al-Adhami
20398c10f1
fix pyi for untyped event handlers (#4186)
* fix pyi for untyped event handlers

* no more empty lambdas
2024-10-16 15:14:58 -07:00
Masen Furer
f8881c391d
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 15:14:58 -07:00
Masen Furer
c460040040
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 15:14:58 -07:00
Khaleel Al-Adhami
19bfdc4035
disk is memory is disk (#4185) 2024-10-16 15:14:58 -07:00
Khaleel Al-Adhami
f133bf53cc
only treat dict object vars as key value mapping (#4177) 2024-10-16 15:14:58 -07:00
Masen Furer
11dcce3975
pin AppHarness tests to ubuntu-22.04 runner (#4173) 2024-10-16 15:14:57 -07:00
Masen Furer
3494a2d3f3
bump to 0.6.3a1 2024-10-14 08:57:37 -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