reflex 0.4.9a2__py3-none-any.whl → 0.4.9.post1__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/state.py CHANGED
@@ -1154,6 +1154,29 @@ class BaseState(Base, ABC, extra=pydantic.Extra.allow):
1154
1154
  for substate in self.substates.values():
1155
1155
  substate.reset()
1156
1156
 
1157
+ @classmethod
1158
+ @functools.lru_cache
1159
+ def _is_client_storage(cls, prop_name_or_field: str | ModelField) -> bool:
1160
+ """Check if the var is a client storage var.
1161
+
1162
+ Args:
1163
+ prop_name_or_field: The name of the var or the field itself.
1164
+
1165
+ Returns:
1166
+ Whether the var is a client storage var.
1167
+ """
1168
+ if isinstance(prop_name_or_field, str):
1169
+ field = cls.get_fields().get(prop_name_or_field)
1170
+ else:
1171
+ field = prop_name_or_field
1172
+ return field is not None and (
1173
+ isinstance(field.default, ClientStorageBase)
1174
+ or (
1175
+ isinstance(field.type_, type)
1176
+ and issubclass(field.type_, ClientStorageBase)
1177
+ )
1178
+ )
1179
+
1157
1180
  def _reset_client_storage(self):
1158
1181
  """Reset client storage base vars to their default values."""
1159
1182
  # Client-side storage is reset during hydrate so that clearing cookies
@@ -1161,10 +1184,7 @@ class BaseState(Base, ABC, extra=pydantic.Extra.allow):
1161
1184
  fields = self.get_fields()
1162
1185
  for prop_name in self.base_vars:
1163
1186
  field = fields[prop_name]
1164
- if isinstance(field.default, ClientStorageBase) or (
1165
- isinstance(field.type_, type)
1166
- and issubclass(field.type_, ClientStorageBase)
1167
- ):
1187
+ if self._is_client_storage(field):
1168
1188
  setattr(self, prop_name, copy.deepcopy(field.default))
1169
1189
 
1170
1190
  # Recursively reset the substate client storage.
@@ -1825,8 +1845,9 @@ class UpdateVarsInternalState(State):
1825
1845
  for var, value in vars.items():
1826
1846
  state_name, _, var_name = var.rpartition(".")
1827
1847
  var_state_cls = State.get_class_substate(state_name)
1828
- var_state = await self.get_state(var_state_cls)
1829
- setattr(var_state, var_name, value)
1848
+ if var_state_cls._is_client_storage(var_name):
1849
+ var_state = await self.get_state(var_state_cls)
1850
+ setattr(var_state, var_name, value)
1830
1851
 
1831
1852
 
1832
1853
  class OnLoadInternalState(State):
@@ -823,7 +823,7 @@ def install_frontend_packages(packages: set[str], config: Config):
823
823
  """
824
824
  # unsupported archs(arm and 32bit machines) will use npm anyway. so we dont have to run npm twice
825
825
  fallback_command = (
826
- get_install_package_manager()
826
+ get_package_manager()
827
827
  if not constants.IS_WINDOWS
828
828
  or constants.IS_WINDOWS
829
829
  and constants.IS_WINDOWS_BUN_SUPPORTED_MACHINE
@@ -1,8 +1,7 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.3
2
2
  Name: reflex
3
- Version: 0.4.9a2
3
+ Version: 0.4.9.post1
4
4
  Summary: Web apps in pure Python.
5
- Home-page: https://reflex.dev
6
5
  License: Apache-2.0
7
6
  Keywords: web,framework
8
7
  Author: Nikhil Rao
@@ -15,6 +14,8 @@ Classifier: Programming Language :: Python :: 3.8
15
14
  Classifier: Programming Language :: Python :: 3.9
16
15
  Classifier: Programming Language :: Python :: 3.10
17
16
  Classifier: Programming Language :: Python :: 3.11
17
+ Classifier: Programming Language :: Python :: 3.12
18
+ Classifier: Programming Language :: Python :: 3.13
18
19
  Requires-Dist: alembic (>=1.11.1,<2.0)
19
20
  Requires-Dist: build (>=1.0.3,<2.0)
20
21
  Requires-Dist: charset-normalizer (>=3.3.2,<4.0)
@@ -48,6 +49,7 @@ Requires-Dist: wheel (>=0.42.0,<1.0)
48
49
  Requires-Dist: wrapt (>=1.11.0,<2.0) ; python_version < "3.11"
49
50
  Requires-Dist: wrapt (>=1.14.0,<2.0) ; python_version >= "3.11"
50
51
  Project-URL: Documentation, https://reflex.dev/docs/getting-started/introduction
52
+ Project-URL: Homepage, https://reflex.dev
51
53
  Project-URL: Repository, https://github.com/reflex-dev/reflex
52
54
  Description-Content-Type: text/markdown
53
55
 
@@ -470,7 +470,7 @@ reflex/model.py,sha256=oenX-2waasLr637nUUeIBMPbV10Hhv13GrWUTyiytxk,13116
470
470
  reflex/page.py,sha256=4FYtFn52sMb0ZhR5xHWd559HmRcpsMAHx9jjKchiyGE,1921
471
471
  reflex/reflex.py,sha256=etDzJ7PzS5E7IGVdBiiPgFiG9z0xZkYwTWUJi9e8CU8,17828
472
472
  reflex/route.py,sha256=mRv4rHuSI6x-uWALujPfM5PNtoRea6cuThjchHtA2hQ,2908
473
- reflex/state.py,sha256=Crlh4A916t1dmURTD_ZvQz0ihhPxEaWswgY6rbgdBE0,105642
473
+ reflex/state.py,sha256=4dkHqnhXQMgyMCmQQm0LCv8sw4SokVBbg3PQ4jwJoa4,106321
474
474
  reflex/style.py,sha256=3gM5xJpn1yd5UnRDRKrJWgCd871Rj_ZnxhQyWCspx2Q,8834
475
475
  reflex/testing.py,sha256=WOTjpnOo0U8tJHl5ie7mWOD3Cucf7HyP2x9FGMkYc4c,30556
476
476
  reflex/utils/__init__.py,sha256=y-AHKiRQAhk2oAkvn7W8cRVTZVK625ff8tTwvZtO7S4,24
@@ -483,7 +483,7 @@ reflex/utils/export.py,sha256=UJd4BYFW9_eexhLCP4C5Ri8Cq2tWAPNVspq70lPLCyo,2270
483
483
  reflex/utils/format.py,sha256=4vY7NP-f7B2euJ5F5dM3yh5SYPzCY3bVZDATG2DMaMU,22648
484
484
  reflex/utils/imports.py,sha256=IRnSLA_LI0ougGpOT_smwVPDpfoPcC7t_tY4mnuhj6k,2277
485
485
  reflex/utils/path_ops.py,sha256=Vy6fU_bXvOcCvbXdTSmeLwy_C4h9seYU-3yIrVdZEZQ,4737
486
- reflex/utils/prerequisites.py,sha256=0zBpFhStKZ_wzL_fKKM9XTkerS3L0QYuUjTnSkehYSM,47242
486
+ reflex/utils/prerequisites.py,sha256=d1ec--4bVTie1zNtpl5W3cb8vxPA3oLwncd2Iotg-YY,47234
487
487
  reflex/utils/processes.py,sha256=9XIffdPsxe-RnaMB9Q_VyaXVJrXAx9OIjrExNYBl8x0,10730
488
488
  reflex/utils/pyi_generator.py,sha256=1X3nvR5qo7QnXmX4SJ8Jo3KL_ctS8oDVaLoWSh-9L4U,27795
489
489
  reflex/utils/serializers.py,sha256=AK3q6UqGwha21lz04c1rwlqlgbDkUMVpUG4Yf1sLmcs,9023
@@ -492,8 +492,8 @@ reflex/utils/types.py,sha256=QtsWi7ACjwHLfc7Wy72YU85bGUS3J-P_XlltYUAfnPk,13679
492
492
  reflex/utils/watch.py,sha256=HzGrHQIZ_62Di0BO46kd2AZktNA3A6nFIBuf8c6ip30,2609
493
493
  reflex/vars.py,sha256=45Ejn54a3BC1bXp5nzFDUjirgGRrHD-YX3rKiKVRL-g,67157
494
494
  reflex/vars.pyi,sha256=7sVCLoLg9Y7QAmXWz6FCtVmScpSV84u0yQ3ZBImb_Bk,5583
495
- reflex-0.4.9a2.dist-info/LICENSE,sha256=dw3zLrp9f5ObD7kqS32vWfhcImfO52PMmRqvtxq_YEE,11358
496
- reflex-0.4.9a2.dist-info/METADATA,sha256=JCmQ51jAG87KsWnF7XGMJK4_KCGPjIe93a-NAqauw4o,11764
497
- reflex-0.4.9a2.dist-info/WHEEL,sha256=Zb28QaM1gQi8f4VCBhsUklF61CTlNYfs9YAZn-TOGFk,88
498
- reflex-0.4.9a2.dist-info/entry_points.txt,sha256=H1Z5Yat_xJfy0dRT1Frk2PkO_p41Xy7fCKlj4FcdL9o,44
499
- reflex-0.4.9a2.dist-info/RECORD,,
495
+ reflex-0.4.9.post1.dist-info/LICENSE,sha256=dw3zLrp9f5ObD7kqS32vWfhcImfO52PMmRqvtxq_YEE,11358
496
+ reflex-0.4.9.post1.dist-info/METADATA,sha256=W_hgAg7kDnx8Qu4iahpN9s9R-maITI3gIbiwBmEwoU4,11882
497
+ reflex-0.4.9.post1.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
498
+ reflex-0.4.9.post1.dist-info/entry_points.txt,sha256=H1Z5Yat_xJfy0dRT1Frk2PkO_p41Xy7fCKlj4FcdL9o,44
499
+ reflex-0.4.9.post1.dist-info/RECORD,,
@@ -1,4 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: poetry-core 1.6.1
2
+ Generator: poetry-core 2.1.3
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any