reflex 0.6.2__py3-none-any.whl → 0.6.2a1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of reflex might be problematic. Click here for more details.
- reflex/custom_components/custom_components.py +1 -1
- reflex/state.py +11 -40
- reflex/utils/compat.py +4 -7
- reflex/vars/base.py +0 -4
- {reflex-0.6.2.dist-info → reflex-0.6.2a1.dist-info}/METADATA +1 -1
- {reflex-0.6.2.dist-info → reflex-0.6.2a1.dist-info}/RECORD +9 -9
- {reflex-0.6.2.dist-info → reflex-0.6.2a1.dist-info}/LICENSE +0 -0
- {reflex-0.6.2.dist-info → reflex-0.6.2a1.dist-info}/WHEEL +0 -0
- {reflex-0.6.2.dist-info → reflex-0.6.2a1.dist-info}/entry_points.txt +0 -0
|
@@ -260,7 +260,7 @@ def _validate_library_name(library_name: str | None) -> NameVariants:
|
|
|
260
260
|
# Module name is the snake case.
|
|
261
261
|
module_name = "_".join(name_parts)
|
|
262
262
|
|
|
263
|
-
custom_component_module_dir =
|
|
263
|
+
custom_component_module_dir = f"reflex_{module_name}"
|
|
264
264
|
console.debug(f"Custom component source directory: {custom_component_module_dir}")
|
|
265
265
|
|
|
266
266
|
# Use the same name for the directory and the app.
|
reflex/state.py
CHANGED
|
@@ -461,10 +461,10 @@ class BaseState(Base, ABC, extra=pydantic.Extra.allow):
|
|
|
461
461
|
for name, value in cls.__dict__.items()
|
|
462
462
|
if types.is_backend_base_variable(name, cls)
|
|
463
463
|
}
|
|
464
|
-
# Add annotated backend vars that
|
|
464
|
+
# Add annotated backend vars that do not have a default value.
|
|
465
465
|
new_backend_vars.update(
|
|
466
466
|
{
|
|
467
|
-
name:
|
|
467
|
+
name: Var("", _var_type=annotation_value).get_default_value()
|
|
468
468
|
for name, annotation_value in get_type_hints(cls).items()
|
|
469
469
|
if name not in new_backend_vars
|
|
470
470
|
and types.is_backend_base_variable(name, cls)
|
|
@@ -990,26 +990,6 @@ class BaseState(Base, ABC, extra=pydantic.Extra.allow):
|
|
|
990
990
|
# Ensure frontend uses null coalescing when accessing.
|
|
991
991
|
object.__setattr__(prop, "_var_type", Optional[prop._var_type])
|
|
992
992
|
|
|
993
|
-
@classmethod
|
|
994
|
-
def _get_var_default(cls, name: str, annotation_value: Any) -> Any:
|
|
995
|
-
"""Get the default value of a (backend) var.
|
|
996
|
-
|
|
997
|
-
Args:
|
|
998
|
-
name: The name of the var.
|
|
999
|
-
annotation_value: The annotation value of the var.
|
|
1000
|
-
|
|
1001
|
-
Returns:
|
|
1002
|
-
The default value of the var or None.
|
|
1003
|
-
"""
|
|
1004
|
-
try:
|
|
1005
|
-
return getattr(cls, name)
|
|
1006
|
-
except AttributeError:
|
|
1007
|
-
try:
|
|
1008
|
-
return Var("", _var_type=annotation_value).get_default_value()
|
|
1009
|
-
except TypeError:
|
|
1010
|
-
pass
|
|
1011
|
-
return None
|
|
1012
|
-
|
|
1013
993
|
@staticmethod
|
|
1014
994
|
def _get_base_functions() -> dict[str, FunctionType]:
|
|
1015
995
|
"""Get all functions of the state class excluding dunder methods.
|
|
@@ -1958,14 +1938,7 @@ class BaseState(Base, ABC, extra=pydantic.Extra.allow):
|
|
|
1958
1938
|
Returns:
|
|
1959
1939
|
The serialized state.
|
|
1960
1940
|
"""
|
|
1961
|
-
|
|
1962
|
-
return pickle.dumps((state_to_schema(self), self))
|
|
1963
|
-
except pickle.PicklingError:
|
|
1964
|
-
console.warn(
|
|
1965
|
-
f"Failed to serialize state {self.get_full_name()} due to unpicklable object. "
|
|
1966
|
-
"This state will not be persisted."
|
|
1967
|
-
)
|
|
1968
|
-
return b""
|
|
1941
|
+
return pickle.dumps((state_to_schema(self), self))
|
|
1969
1942
|
|
|
1970
1943
|
@classmethod
|
|
1971
1944
|
def _deserialize(
|
|
@@ -2819,10 +2792,9 @@ class StateManagerDisk(StateManager):
|
|
|
2819
2792
|
self.states[substate_token] = substate
|
|
2820
2793
|
|
|
2821
2794
|
state_dilled = substate._serialize()
|
|
2822
|
-
if
|
|
2823
|
-
|
|
2824
|
-
|
|
2825
|
-
self.token_path(substate_token).write_bytes(state_dilled)
|
|
2795
|
+
if not self.states_directory.exists():
|
|
2796
|
+
self.states_directory.mkdir(parents=True, exist_ok=True)
|
|
2797
|
+
self.token_path(substate_token).write_bytes(state_dilled)
|
|
2826
2798
|
|
|
2827
2799
|
for substate_substate in substate.substates.values():
|
|
2828
2800
|
await self.set_state_for_substate(client_token, substate_substate)
|
|
@@ -3115,12 +3087,11 @@ class StateManagerRedis(StateManager):
|
|
|
3115
3087
|
if state._get_was_touched():
|
|
3116
3088
|
pickle_state = state._serialize()
|
|
3117
3089
|
self._warn_if_too_large(state, len(pickle_state))
|
|
3118
|
-
|
|
3119
|
-
|
|
3120
|
-
|
|
3121
|
-
|
|
3122
|
-
|
|
3123
|
-
)
|
|
3090
|
+
await self.redis.set(
|
|
3091
|
+
_substate_key(client_token, state),
|
|
3092
|
+
pickle_state,
|
|
3093
|
+
ex=self.token_expiration,
|
|
3094
|
+
)
|
|
3124
3095
|
|
|
3125
3096
|
# Wait for substates to be persisted.
|
|
3126
3097
|
for t in tasks:
|
reflex/utils/compat.py
CHANGED
|
@@ -19,13 +19,10 @@ async def windows_hot_reload_lifespan_hack():
|
|
|
19
19
|
import asyncio
|
|
20
20
|
import sys
|
|
21
21
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
await asyncio.sleep(0.5)
|
|
27
|
-
except asyncio.CancelledError:
|
|
28
|
-
pass
|
|
22
|
+
while True:
|
|
23
|
+
sys.stderr.write("\0")
|
|
24
|
+
sys.stderr.flush()
|
|
25
|
+
await asyncio.sleep(0.5)
|
|
29
26
|
|
|
30
27
|
|
|
31
28
|
@contextlib.contextmanager
|
reflex/vars/base.py
CHANGED
|
@@ -547,10 +547,6 @@ class Var(Generic[VAR_TYPE]):
|
|
|
547
547
|
|
|
548
548
|
return self
|
|
549
549
|
|
|
550
|
-
if fixed_type is Literal:
|
|
551
|
-
args = get_args(var_type)
|
|
552
|
-
fixed_type = unionize(*(type(arg) for arg in args))
|
|
553
|
-
|
|
554
550
|
if not inspect.isclass(fixed_type):
|
|
555
551
|
raise TypeError(f"Unsupported type {var_type} for guess_type.")
|
|
556
552
|
|
|
@@ -330,7 +330,7 @@ reflex/constants/installer.py,sha256=XamyG7xDBVDg1sx1_EToQYHXeoEoK3-XbStX9Rd3Qv8
|
|
|
330
330
|
reflex/constants/route.py,sha256=fu1jp9MoIriUJ8Cu4gLeinTxkyVBbRPs8Bkt35vqYOM,2144
|
|
331
331
|
reflex/constants/style.py,sha256=sJ6LuPY1OWemwMXnI1Htm-pa087HWT6PWljUeyokcUI,474
|
|
332
332
|
reflex/custom_components/__init__.py,sha256=R4zsvOi4dfPmHc18KEphohXnQFBPnUCb50cMR5hSLDE,36
|
|
333
|
-
reflex/custom_components/custom_components.py,sha256=
|
|
333
|
+
reflex/custom_components/custom_components.py,sha256=S3F83_0TvCEVJMEBhfW44MCOL3IyKUsj_tslZK1IfXk,32994
|
|
334
334
|
reflex/event.py,sha256=cVvsiKBQnL8-UjFmiVtEaZXbmYgx6YkuT-4bTEiI8fE,38139
|
|
335
335
|
reflex/experimental/__init__.py,sha256=usDkf5yRMHKHjdRa_KfedFeD-urOMAKBuNfsghzvre4,1974
|
|
336
336
|
reflex/experimental/assets.py,sha256=GZRdfIs03HXCSShyvdztu6vFsJ9Z8W4ZFCjJGZrNURY,1837
|
|
@@ -347,13 +347,13 @@ reflex/model.py,sha256=I102SQwtUaidue0JZLJD3QJRoTPYvqKaT7U9yKUIH9s,14176
|
|
|
347
347
|
reflex/page.py,sha256=25dKsOqVcY1Pz05T0gjUEk8zKHcfyd1c0nYIXW7jY5A,2332
|
|
348
348
|
reflex/reflex.py,sha256=qlyEkg5ZqaYpKalNf2QIsAiPBIuQCxIyPjLCSedAUpU,18793
|
|
349
349
|
reflex/route.py,sha256=WZS7stKgO94nekFFYHaOqNgN3zZGpJb3YpGF4ViTHmw,4198
|
|
350
|
-
reflex/state.py,sha256=
|
|
350
|
+
reflex/state.py,sha256=Y3DK2Z3AdkgJv-v83yXrIuKHqPK7axamIwOZ7Gp8ask,126653
|
|
351
351
|
reflex/style.py,sha256=MxZyxvU0g6Vf_kWhsD5RFJRD6NjmJgfrlOclc53lSIw,12487
|
|
352
352
|
reflex/testing.py,sha256=Iy_0AlpKXsLJINz02bb4u_I6TYAVs24a1TbhOGQ8PV8,34762
|
|
353
353
|
reflex/utils/__init__.py,sha256=y-AHKiRQAhk2oAkvn7W8cRVTZVK625ff8tTwvZtO7S4,24
|
|
354
354
|
reflex/utils/build.py,sha256=llkaIPC9o-SIY83ThUMEDIDpWaCDpaUNJdog0u_5tPM,8632
|
|
355
355
|
reflex/utils/codespaces.py,sha256=tKmju4aGzDMPy76_eQSzJd3RYmVmiiNZy3Yc0e3zG_w,2856
|
|
356
|
-
reflex/utils/compat.py,sha256=
|
|
356
|
+
reflex/utils/compat.py,sha256=x6jZUcl-62AxUtO4HQMBI1xJzq_CJcJoObISbeTp4HU,2490
|
|
357
357
|
reflex/utils/console.py,sha256=H6x6oUIT4T1ndfWaXRtr8jS1WcD71yo3m8JQbC-y-Qc,5481
|
|
358
358
|
reflex/utils/exceptions.py,sha256=exOZJ8WLo-aXcXQQ_E3bohifO1axBMqp2DsF2Rolhpc,3995
|
|
359
359
|
reflex/utils/exec.py,sha256=4n6UpvxDIWgO5qx6ZwIBh9g3lFerIA6ytsINMJG2bBM,14934
|
|
@@ -372,13 +372,13 @@ reflex/utils/serializers.py,sha256=v377C_EcuAyrt6RddAijVXDnTdO0k3pLlXzQ-NfhdBg,1
|
|
|
372
372
|
reflex/utils/telemetry.py,sha256=zyy-bQjf18qQM-iTACIA9T7VBWRpm-DNES7iNJLrieo,5596
|
|
373
373
|
reflex/utils/types.py,sha256=ByFCOk3WNvTuijj8foyGIdslRsMXb0oNHP3Tgw0RkPE,19043
|
|
374
374
|
reflex/vars/__init__.py,sha256=OdCzmDFGMbCoy5VN4xQ3DaLpHck7npuLz7OUYvsN6Xw,1128
|
|
375
|
-
reflex/vars/base.py,sha256=
|
|
375
|
+
reflex/vars/base.py,sha256=CTwfvccbJ7HBn7KrwafUUEma3Ry7_NSa9hn82Hx2KjU,85687
|
|
376
376
|
reflex/vars/function.py,sha256=GjTGRjDhMRACSPBIGNYgQzjKI2WgfhSluAWCm1mJQnU,5478
|
|
377
377
|
reflex/vars/number.py,sha256=U9n61-zBIIPUDNy_exbvXuuJraCYmD489gjeU2OwAis,28091
|
|
378
378
|
reflex/vars/object.py,sha256=wOq74_nDNAhqgT21HkHGfRukGdLjWoLprHjFNy1hjy8,14988
|
|
379
379
|
reflex/vars/sequence.py,sha256=SCtuo4Nohsfg5y-r5RyyYYThNIk9znkPUC_bLg5XGd8,45881
|
|
380
|
-
reflex-0.6.
|
|
381
|
-
reflex-0.6.
|
|
382
|
-
reflex-0.6.
|
|
383
|
-
reflex-0.6.
|
|
384
|
-
reflex-0.6.
|
|
380
|
+
reflex-0.6.2a1.dist-info/LICENSE,sha256=dw3zLrp9f5ObD7kqS32vWfhcImfO52PMmRqvtxq_YEE,11358
|
|
381
|
+
reflex-0.6.2a1.dist-info/METADATA,sha256=_Nn2vMhO0FNCXk8X8Q8SD2uM-qUedgl2oVdPRdroOLc,11980
|
|
382
|
+
reflex-0.6.2a1.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
|
383
|
+
reflex-0.6.2a1.dist-info/entry_points.txt,sha256=H1Z5Yat_xJfy0dRT1Frk2PkO_p41Xy7fCKlj4FcdL9o,44
|
|
384
|
+
reflex-0.6.2a1.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|