reflex 0.5.6__py3-none-any.whl → 0.5.6a1__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/__init__.py CHANGED
@@ -84,18 +84,12 @@ In the example above, you will be able to do `rx.list`
84
84
 
85
85
  from __future__ import annotations
86
86
 
87
- from reflex.utils import (
88
- compat, # for side-effects
89
- lazy_loader,
90
- )
87
+ from reflex.utils import lazy_loader
91
88
 
92
89
  # import this here explicitly to avoid returning the page module since page attr has the
93
90
  # same name as page module(page.py)
94
91
  from .page import page as page
95
92
 
96
- # Remove the `compat` name from the namespace, it was imported for side-effects only.
97
- del compat
98
-
99
93
  RADIX_THEMES_MAPPING: dict = {
100
94
  "components.radix.themes.base": ["color_mode", "theme", "theme_panel"],
101
95
  "components.radix.themes.color_mode": ["color_mode"],
reflex/__init__.pyi CHANGED
@@ -3,8 +3,6 @@
3
3
  # This file was generated by `reflex/utils/pyi_generator.py`!
4
4
  # ------------------------------------------------------
5
5
 
6
- from reflex.utils import compat
7
-
8
6
  from . import admin as admin
9
7
  from . import app as app
10
8
  from . import base as base
@@ -192,7 +190,6 @@ from .utils.serializers import serializer as serializer
192
190
  from .vars import Var as Var
193
191
  from .vars import cached_var as cached_var
194
192
 
195
- del compat
196
193
  RADIX_THEMES_MAPPING: dict
197
194
  RADIX_THEMES_COMPONENTS_MAPPING: dict
198
195
  RADIX_THEMES_LAYOUT_MAPPING: dict
@@ -66,7 +66,7 @@ class Foreach(Component):
66
66
  raise ForeachVarError(
67
67
  f"Could not foreach over var `{iterable._var_full_name}` of type Any. "
68
68
  "(If you are trying to foreach over a state var, add a type annotation to the var). "
69
- "See https://reflex.dev/docs/library/dynamic-rendering/foreach/"
69
+ "See https://reflex.dev/docs/library/layout/foreach/"
70
70
  )
71
71
 
72
72
  if (
@@ -95,8 +95,7 @@ class Foreach(Component):
95
95
  if len(params) == 0 or len(params) > 2:
96
96
  raise ForeachRenderError(
97
97
  "Expected 1 or 2 parameters in foreach render function, got "
98
- f"{[p.name for p in params]}. See "
99
- "https://reflex.dev/docs/library/dynamic-rendering/foreach/"
98
+ f"{[p.name for p in params]}. See https://reflex.dev/docs/library/layout/foreach/"
100
99
  )
101
100
 
102
101
  if len(params) >= 1:
@@ -107,7 +107,7 @@ def cancel_upload(upload_id: str) -> EventSpec:
107
107
  An event spec that cancels the upload when triggered.
108
108
  """
109
109
  return call_script(
110
- f"upload_controllers[{Var.create_safe(upload_id, _var_is_string=True)._var_name_unwrapped}]?.abort()"
110
+ f"upload_controllers[{Var.create_safe(upload_id, _var_is_string=True)._var_name_unwrapped!r}]?.abort()"
111
111
  )
112
112
 
113
113
 
reflex/state.py CHANGED
@@ -61,6 +61,7 @@ if TYPE_CHECKING:
61
61
 
62
62
  Delta = Dict[str, Any]
63
63
  var = computed_var
64
+ config = get_config()
64
65
 
65
66
 
66
67
  # If the state is this large, it's considered a performance issue.
@@ -2318,24 +2319,6 @@ def _dill_reduce_state(pickler, obj):
2318
2319
  dill.Pickler.dispatch[type](pickler, obj)
2319
2320
 
2320
2321
 
2321
- def _default_lock_expiration() -> int:
2322
- """Get the default lock expiration time.
2323
-
2324
- Returns:
2325
- The default lock expiration time.
2326
- """
2327
- return get_config().redis_lock_expiration
2328
-
2329
-
2330
- def _default_token_expiration() -> int:
2331
- """Get the default token expiration time.
2332
-
2333
- Returns:
2334
- The default token expiration time.
2335
- """
2336
- return get_config().redis_token_expiration
2337
-
2338
-
2339
2322
  class StateManagerRedis(StateManager):
2340
2323
  """A state manager that stores states in redis."""
2341
2324
 
@@ -2343,10 +2326,10 @@ class StateManagerRedis(StateManager):
2343
2326
  redis: Redis
2344
2327
 
2345
2328
  # The token expiration time (s).
2346
- token_expiration: int = pydantic.Field(default_factory=_default_token_expiration)
2329
+ token_expiration: int = config.redis_token_expiration
2347
2330
 
2348
2331
  # The maximum time to hold a lock (ms).
2349
- lock_expiration: int = pydantic.Field(default_factory=_default_lock_expiration)
2332
+ lock_expiration: int = config.redis_lock_expiration
2350
2333
 
2351
2334
  # The keyspace subscription string when redis is waiting for lock to be released
2352
2335
  _redis_notify_keyspace_events: str = (
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: reflex
3
- Version: 0.5.6
3
+ Version: 0.5.6a1
4
4
  Summary: Web apps in pure Python.
5
5
  Home-page: https://reflex.dev
6
6
  License: Apache-2.0
@@ -63,8 +63,8 @@ reflex/.templates/web/utils/helpers/paste.js,sha256=ef30HsR83jRzzvZnl8yV79yqFP8T
63
63
  reflex/.templates/web/utils/helpers/range.js,sha256=FevdZzCVxjF57ullfjpcUpeOXRxh5v09YnBB0jPbrS4,1152
64
64
  reflex/.templates/web/utils/helpers/throttle.js,sha256=qxeyaEojaTeX36FPGftzVWrzDsRQU4iqg3U9RJz9Vj4,566
65
65
  reflex/.templates/web/utils/state.js,sha256=dAGKAnhloEE5ldQ2n21k95br9djexy-CscZNQG-Remc,25021
66
- reflex/__init__.py,sha256=ODbR-WJ4-ugGhepPf34fUy2GZdkxo3TpZaca1tpD7kw,9728
67
- reflex/__init__.pyi,sha256=brBPyevzsUhaSKKgJVkXmm8VmXy8umVIIBjjV4IwcTI,10751
66
+ reflex/__init__.py,sha256=1HO-TJ-wapnytmaQXmSvkPoL8HKld-CvvvMnns7XIA8,9589
67
+ reflex/__init__.pyi,sha256=z4t-OZKh68rAfHohp8g0qzeb0sxx3dvIznoyOuIijVg,10707
68
68
  reflex/__main__.py,sha256=6cVrGEyT3j3tEvlEVUatpaYfbB5EF3UVY-6vc_Z7-hw,108
69
69
  reflex/admin.py,sha256=_3pkkauMiTGJJ0kwAEBnsUWAgZZ_1WNnCaaObbhpmUI,374
70
70
  reflex/app.py,sha256=wzBA0yrRc4CTuPttTBHtcI-pVLxaEZH3vzYHtgvwu54,46985
@@ -254,13 +254,13 @@ reflex/components/core/colors.py,sha256=-hzVGLEq3TiqroqzMi_YzGBCPXMvkNsen3pS_NzI
254
254
  reflex/components/core/cond.py,sha256=wLHkGlp47FXk_VlzXx4n8k8xcLleWQsiWgIoNyUpuBE,6369
255
255
  reflex/components/core/debounce.py,sha256=KFyfnvnaevSWrj04Uehh2w8guV2VM9oGx_ApuhP8q9M,4660
256
256
  reflex/components/core/debounce.pyi,sha256=DBRFYOemKi_YYZRzRef7iQ9CSrchhPkVLlNGLDXdwUc,4038
257
- reflex/components/core/foreach.py,sha256=iTJMVHTUsWZzPN1xVT4CBsRHzDKv9bfLbUQkZM9tPV4,4823
257
+ reflex/components/core/foreach.py,sha256=MXFXWS-sMoELEGocYB2mXVu4DVJzdgDjKaj8R3UrrxI,4782
258
258
  reflex/components/core/html.py,sha256=iSeKFcld5m4zoXOGq0QEaKKtgTUUVLrIEVsP3cyYCxE,1305
259
259
  reflex/components/core/html.pyi,sha256=184TSzJ6NnxJuLBZWI4VSiWH_9Orc3zEHlIcu539Otw,6274
260
260
  reflex/components/core/layout/__init__.py,sha256=znldZaj_NGt8qCZDG70GMwjMTskcvCf_2N_EjCAHwdc,30
261
261
  reflex/components/core/match.py,sha256=y7sBAwTJPLsfjNo6fmPykRaKUyuMa8orG6lwOvRt68c,9558
262
262
  reflex/components/core/responsive.py,sha256=ACZdtJ4a4F8B3dm1k8h6J2_UJx0Z5LDB7XHQ2ty4wAc,1911
263
- reflex/components/core/upload.py,sha256=nTXUE_4of_NeP5ghe6kysrQz2EJdCVJkXAwG0XKIEQU,10220
263
+ reflex/components/core/upload.py,sha256=2cWj9iYOfwfH0fUWFzhS3b2fUl0J_a1Na9-Ri8rl0ls,10222
264
264
  reflex/components/core/upload.pyi,sha256=tFo0VYlQ2eEL-QhQrAKiTSD-a3GwcRAs2XMzfPtYT6A,16582
265
265
  reflex/components/datadisplay/__init__.py,sha256=Uxq0V74orISXh6woTNQXgOUrKMSf0bi6Aytsh7G59yw,471
266
266
  reflex/components/datadisplay/__init__.pyi,sha256=qBAk9Dsp7woSrOChcQ1YsXdGNYuJv-jCZpKSsEwMiIQ,653
@@ -515,7 +515,7 @@ reflex/model.py,sha256=f9F3J3JZX_NmUCU5mN4Lh7afclq9fikPUB1K2FmNlhU,13545
515
515
  reflex/page.py,sha256=NPT0xMownZGTiYiRtrUJnvAe_4oEvlzEJEkG-vrGhqI,2077
516
516
  reflex/reflex.py,sha256=1wJX6casYE_sAc1JCo4vng9gsyAeiYsG2Yw7itk5Abs,17874
517
517
  reflex/route.py,sha256=WZS7stKgO94nekFFYHaOqNgN3zZGpJb3YpGF4ViTHmw,4198
518
- reflex/state.py,sha256=U4_vbalL6_oLFxFjpBojipXPb6OX5iTKAziOXAMn-ZE,110504
518
+ reflex/state.py,sha256=PkXPoPR9Shn2aOf2zzJOhfyWGrLM3F87yJ0pJDlGV1c,110074
519
519
  reflex/style.py,sha256=sLeIKBKUpZV1q1QwexVyckqFphjoxsPqCstVQf-D0Ak,11703
520
520
  reflex/testing.py,sha256=S2fE4rFPart_sBDw0P0YFyhTRS__bErwEYdZ4r9OSXo,33175
521
521
  reflex/utils/__init__.py,sha256=y-AHKiRQAhk2oAkvn7W8cRVTZVK625ff8tTwvZtO7S4,24
@@ -539,8 +539,8 @@ reflex/utils/types.py,sha256=A8JepoRbONeo3cRIiLd08yUAo_To34UvU-t_S2P3UBA,17491
539
539
  reflex/utils/watch.py,sha256=ukPT3YrvqsXYN6BInWiO_RPry5osSch9lOomQhxDyk0,2685
540
540
  reflex/vars.py,sha256=CNNEAa0VHvx03FIP2YPJqXb8lGP0OjC_EjQl73x4v0A,77066
541
541
  reflex/vars.pyi,sha256=8jzIgkRVcYY0MMZ6Ol9EUhw8dtaxCzGRsnxWxZAGc1U,6477
542
- reflex-0.5.6.dist-info/LICENSE,sha256=dw3zLrp9f5ObD7kqS32vWfhcImfO52PMmRqvtxq_YEE,11358
543
- reflex-0.5.6.dist-info/METADATA,sha256=b5ZRhAEmlW-l3kR3hvy1gaD9wGgqlXbULZJT709Fv_M,12097
544
- reflex-0.5.6.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
545
- reflex-0.5.6.dist-info/entry_points.txt,sha256=H1Z5Yat_xJfy0dRT1Frk2PkO_p41Xy7fCKlj4FcdL9o,44
546
- reflex-0.5.6.dist-info/RECORD,,
542
+ reflex-0.5.6a1.dist-info/LICENSE,sha256=dw3zLrp9f5ObD7kqS32vWfhcImfO52PMmRqvtxq_YEE,11358
543
+ reflex-0.5.6a1.dist-info/METADATA,sha256=mKQW4NG6KUOfbkP1I4ThN8LcTDWUX2TPajEACyeeFUk,12099
544
+ reflex-0.5.6a1.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
545
+ reflex-0.5.6a1.dist-info/entry_points.txt,sha256=H1Z5Yat_xJfy0dRT1Frk2PkO_p41Xy7fCKlj4FcdL9o,44
546
+ reflex-0.5.6a1.dist-info/RECORD,,