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.
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.
* [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.
* 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
* 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>
* 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 🙄
* 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>
* 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>
* 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.
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.
* 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
* First use environment variable as npm registry
* use NPM_CONFIG_REGISTRY as env variable
---------
Co-authored-by: 류형주/인공지능팀 <hyungju.ryu@ahnlab.com>