reflex 0.6.0a1__py3-none-any.whl → 0.6.0a2__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.

Files changed (249) hide show
  1. reflex/.templates/jinja/web/pages/_app.js.jinja2 +1 -1
  2. reflex/.templates/jinja/web/pages/utils.js.jinja2 +2 -2
  3. reflex/__init__.py +8 -2
  4. reflex/__init__.pyi +2 -1
  5. reflex/app.py +4 -2
  6. reflex/base.py +1 -1
  7. reflex/compiler/compiler.py +2 -2
  8. reflex/compiler/utils.py +3 -3
  9. reflex/components/base/app_wrap.py +2 -2
  10. reflex/components/base/app_wrap.pyi +17 -27
  11. reflex/components/base/bare.py +4 -5
  12. reflex/components/base/body.pyi +17 -27
  13. reflex/components/base/document.pyi +81 -131
  14. reflex/components/base/error_boundary.py +6 -7
  15. reflex/components/base/error_boundary.pyi +20 -33
  16. reflex/components/base/fragment.pyi +17 -27
  17. reflex/components/base/head.pyi +33 -53
  18. reflex/components/base/link.py +1 -1
  19. reflex/components/base/link.pyi +33 -54
  20. reflex/components/base/meta.pyi +65 -105
  21. reflex/components/base/script.py +1 -2
  22. reflex/components/base/script.pyi +21 -38
  23. reflex/components/component.py +48 -47
  24. reflex/components/core/banner.py +23 -27
  25. reflex/components/core/banner.pyi +134 -171
  26. reflex/components/core/client_side_routing.py +2 -3
  27. reflex/components/core/client_side_routing.pyi +33 -54
  28. reflex/components/core/clipboard.py +2 -1
  29. reflex/components/core/clipboard.pyi +20 -33
  30. reflex/components/core/cond.py +5 -5
  31. reflex/components/core/debounce.py +5 -5
  32. reflex/components/core/debounce.pyi +20 -33
  33. reflex/components/core/foreach.py +3 -4
  34. reflex/components/core/html.py +1 -1
  35. reflex/components/core/html.pyi +35 -46
  36. reflex/components/core/match.py +17 -17
  37. reflex/components/core/upload.py +17 -23
  38. reflex/components/core/upload.pyi +78 -124
  39. reflex/components/datadisplay/code.py +9 -10
  40. reflex/components/datadisplay/code.pyi +302 -412
  41. reflex/components/datadisplay/dataeditor.py +8 -10
  42. reflex/components/datadisplay/dataeditor.pyi +40 -53
  43. reflex/components/el/element.pyi +17 -27
  44. reflex/components/el/elements/base.py +1 -1
  45. reflex/components/el/elements/base.pyi +34 -45
  46. reflex/components/el/elements/forms.py +16 -16
  47. reflex/components/el/elements/forms.pyi +554 -707
  48. reflex/components/el/elements/inline.py +1 -1
  49. reflex/components/el/elements/inline.pyi +937 -1218
  50. reflex/components/el/elements/media.py +1 -1
  51. reflex/components/el/elements/media.pyi +786 -997
  52. reflex/components/el/elements/metadata.py +3 -6
  53. reflex/components/el/elements/metadata.pyi +181 -242
  54. reflex/components/el/elements/other.py +1 -1
  55. reflex/components/el/elements/other.pyi +235 -306
  56. reflex/components/el/elements/scripts.py +1 -1
  57. reflex/components/el/elements/scripts.pyi +109 -140
  58. reflex/components/el/elements/sectioning.py +0 -2
  59. reflex/components/el/elements/sectioning.pyi +496 -647
  60. reflex/components/el/elements/tables.py +1 -1
  61. reflex/components/el/elements/tables.pyi +351 -452
  62. reflex/components/el/elements/typography.py +1 -1
  63. reflex/components/el/elements/typography.pyi +506 -657
  64. reflex/components/gridjs/datatable.py +6 -9
  65. reflex/components/gridjs/datatable.pyi +35 -56
  66. reflex/components/lucide/icon.py +1 -1
  67. reflex/components/lucide/icon.pyi +33 -54
  68. reflex/components/markdown/markdown.py +26 -31
  69. reflex/components/markdown/markdown.pyi +27 -37
  70. reflex/components/moment/moment.py +13 -12
  71. reflex/components/moment/moment.pyi +23 -35
  72. reflex/components/next/base.pyi +17 -27
  73. reflex/components/next/image.py +1 -1
  74. reflex/components/next/image.pyi +22 -37
  75. reflex/components/next/link.py +1 -1
  76. reflex/components/next/link.pyi +17 -28
  77. reflex/components/next/video.py +1 -1
  78. reflex/components/next/video.pyi +17 -28
  79. reflex/components/plotly/plotly.py +12 -13
  80. reflex/components/plotly/plotly.pyi +39 -54
  81. reflex/components/props.py +1 -1
  82. reflex/components/radix/__init__.pyi +1 -0
  83. reflex/components/radix/primitives/__init__.pyi +1 -0
  84. reflex/components/radix/primitives/accordion.py +4 -4
  85. reflex/components/radix/primitives/accordion.pyi +424 -495
  86. reflex/components/radix/primitives/base.py +1 -1
  87. reflex/components/radix/primitives/base.pyi +33 -54
  88. reflex/components/radix/primitives/drawer.py +1 -1
  89. reflex/components/radix/primitives/drawer.pyi +172 -273
  90. reflex/components/radix/primitives/form.py +1 -1
  91. reflex/components/radix/primitives/form.pyi +257 -364
  92. reflex/components/radix/primitives/progress.py +1 -1
  93. reflex/components/radix/primitives/progress.pyi +231 -282
  94. reflex/components/radix/primitives/slider.py +1 -1
  95. reflex/components/radix/primitives/slider.pyi +87 -138
  96. reflex/components/radix/themes/base.py +3 -24
  97. reflex/components/radix/themes/base.pyi +178 -250
  98. reflex/components/radix/themes/color_mode.py +5 -5
  99. reflex/components/radix/themes/color_mode.pyi +187 -220
  100. reflex/components/radix/themes/components/alert_dialog.py +1 -1
  101. reflex/components/radix/themes/components/alert_dialog.pyi +136 -207
  102. reflex/components/radix/themes/components/aspect_ratio.py +1 -1
  103. reflex/components/radix/themes/components/aspect_ratio.pyi +17 -28
  104. reflex/components/radix/themes/components/avatar.py +1 -1
  105. reflex/components/radix/themes/components/avatar.pyi +70 -81
  106. reflex/components/radix/themes/components/badge.py +1 -1
  107. reflex/components/radix/themes/components/badge.pyi +88 -99
  108. reflex/components/radix/themes/components/button.py +1 -1
  109. reflex/components/radix/themes/components/button.pyi +98 -109
  110. reflex/components/radix/themes/components/callout.py +1 -1
  111. reflex/components/radix/themes/components/callout.pyi +322 -373
  112. reflex/components/radix/themes/components/card.py +1 -1
  113. reflex/components/radix/themes/components/card.pyi +38 -49
  114. reflex/components/radix/themes/components/checkbox.py +1 -2
  115. reflex/components/radix/themes/components/checkbox.pyi +208 -245
  116. reflex/components/radix/themes/components/checkbox_cards.py +1 -1
  117. reflex/components/radix/themes/components/checkbox_cards.pyi +94 -115
  118. reflex/components/radix/themes/components/checkbox_group.py +1 -1
  119. reflex/components/radix/themes/components/checkbox_group.pyi +86 -107
  120. reflex/components/radix/themes/components/context_menu.py +1 -1
  121. reflex/components/radix/themes/components/context_menu.pyi +238 -319
  122. reflex/components/radix/themes/components/data_list.py +1 -1
  123. reflex/components/radix/themes/components/data_list.pyi +130 -171
  124. reflex/components/radix/themes/components/dialog.py +1 -1
  125. reflex/components/radix/themes/components/dialog.pyi +139 -210
  126. reflex/components/radix/themes/components/dropdown_menu.py +1 -1
  127. reflex/components/radix/themes/components/dropdown_menu.pyi +249 -332
  128. reflex/components/radix/themes/components/hover_card.py +1 -1
  129. reflex/components/radix/themes/components/hover_card.pyi +90 -131
  130. reflex/components/radix/themes/components/icon_button.py +2 -3
  131. reflex/components/radix/themes/components/icon_button.pyi +98 -109
  132. reflex/components/radix/themes/components/inset.py +1 -1
  133. reflex/components/radix/themes/components/inset.pyi +47 -58
  134. reflex/components/radix/themes/components/popover.py +1 -1
  135. reflex/components/radix/themes/components/popover.pyi +95 -136
  136. reflex/components/radix/themes/components/progress.py +1 -1
  137. reflex/components/radix/themes/components/progress.pyi +71 -82
  138. reflex/components/radix/themes/components/radio.py +1 -1
  139. reflex/components/radix/themes/components/radio.pyi +69 -80
  140. reflex/components/radix/themes/components/radio_cards.py +1 -1
  141. reflex/components/radix/themes/components/radio_cards.pyi +98 -119
  142. reflex/components/radix/themes/components/radio_group.py +8 -11
  143. reflex/components/radix/themes/components/radio_group.pyi +228 -271
  144. reflex/components/radix/themes/components/scroll_area.py +1 -1
  145. reflex/components/radix/themes/components/scroll_area.pyi +21 -32
  146. reflex/components/radix/themes/components/segmented_control.py +1 -1
  147. reflex/components/radix/themes/components/segmented_control.pyi +90 -113
  148. reflex/components/radix/themes/components/select.py +2 -3
  149. reflex/components/radix/themes/components/select.pyi +374 -471
  150. reflex/components/radix/themes/components/separator.py +1 -2
  151. reflex/components/radix/themes/components/separator.pyi +69 -80
  152. reflex/components/radix/themes/components/skeleton.py +1 -1
  153. reflex/components/radix/themes/components/skeleton.pyi +23 -34
  154. reflex/components/radix/themes/components/slider.py +2 -3
  155. reflex/components/radix/themes/components/slider.pyi +75 -88
  156. reflex/components/radix/themes/components/spinner.py +1 -1
  157. reflex/components/radix/themes/components/spinner.pyi +19 -30
  158. reflex/components/radix/themes/components/switch.py +1 -1
  159. reflex/components/radix/themes/components/switch.pyi +71 -84
  160. reflex/components/radix/themes/components/table.py +1 -1
  161. reflex/components/radix/themes/components/table.pyi +261 -332
  162. reflex/components/radix/themes/components/tabs.py +1 -1
  163. reflex/components/radix/themes/components/tabs.pyi +139 -194
  164. reflex/components/radix/themes/components/text_area.py +1 -1
  165. reflex/components/radix/themes/components/text_area.pyi +96 -111
  166. reflex/components/radix/themes/components/text_field.py +1 -1
  167. reflex/components/radix/themes/components/text_field.pyi +247 -286
  168. reflex/components/radix/themes/components/tooltip.py +1 -1
  169. reflex/components/radix/themes/components/tooltip.pyi +26 -37
  170. reflex/components/radix/themes/layout/__init__.pyi +1 -0
  171. reflex/components/radix/themes/layout/base.py +1 -1
  172. reflex/components/radix/themes/layout/base.pyi +56 -67
  173. reflex/components/radix/themes/layout/box.pyi +34 -45
  174. reflex/components/radix/themes/layout/center.pyi +56 -67
  175. reflex/components/radix/themes/layout/container.py +1 -2
  176. reflex/components/radix/themes/layout/container.pyi +36 -47
  177. reflex/components/radix/themes/layout/flex.py +1 -1
  178. reflex/components/radix/themes/layout/flex.pyi +56 -67
  179. reflex/components/radix/themes/layout/grid.py +1 -1
  180. reflex/components/radix/themes/layout/grid.pyi +64 -75
  181. reflex/components/radix/themes/layout/list.py +5 -6
  182. reflex/components/radix/themes/layout/list.pyi +193 -244
  183. reflex/components/radix/themes/layout/section.py +1 -2
  184. reflex/components/radix/themes/layout/section.pyi +36 -47
  185. reflex/components/radix/themes/layout/spacer.pyi +56 -67
  186. reflex/components/radix/themes/layout/stack.py +1 -1
  187. reflex/components/radix/themes/layout/stack.pyi +128 -159
  188. reflex/components/radix/themes/typography/blockquote.py +1 -1
  189. reflex/components/radix/themes/typography/blockquote.pyi +89 -100
  190. reflex/components/radix/themes/typography/code.py +1 -1
  191. reflex/components/radix/themes/typography/code.pyi +90 -101
  192. reflex/components/radix/themes/typography/heading.py +1 -1
  193. reflex/components/radix/themes/typography/heading.pyi +96 -107
  194. reflex/components/radix/themes/typography/link.py +1 -1
  195. reflex/components/radix/themes/typography/link.pyi +102 -113
  196. reflex/components/radix/themes/typography/text.py +1 -1
  197. reflex/components/radix/themes/typography/text.pyi +501 -572
  198. reflex/components/react_player/audio.pyi +33 -60
  199. reflex/components/react_player/react_player.py +1 -1
  200. reflex/components/react_player/react_player.pyi +33 -60
  201. reflex/components/react_player/video.pyi +33 -60
  202. reflex/components/recharts/cartesian.py +2 -3
  203. reflex/components/recharts/cartesian.pyi +678 -861
  204. reflex/components/recharts/charts.py +4 -5
  205. reflex/components/recharts/charts.pyi +252 -357
  206. reflex/components/recharts/general.py +1 -2
  207. reflex/components/recharts/general.pyi +180 -231
  208. reflex/components/recharts/polar.py +4 -5
  209. reflex/components/recharts/polar.pyi +144 -181
  210. reflex/components/recharts/recharts.pyi +33 -53
  211. reflex/components/sonner/toast.py +16 -17
  212. reflex/components/sonner/toast.pyi +36 -47
  213. reflex/components/suneditor/editor.py +2 -3
  214. reflex/components/suneditor/editor.pyi +55 -78
  215. reflex/components/tags/cond_tag.py +6 -4
  216. reflex/components/tags/iter_tag.py +28 -16
  217. reflex/components/tags/match_tag.py +6 -4
  218. reflex/components/tags/tag.py +40 -23
  219. reflex/event.py +113 -65
  220. reflex/experimental/client_state.py +18 -18
  221. reflex/experimental/hooks.py +16 -16
  222. reflex/experimental/layout.py +5 -5
  223. reflex/experimental/layout.pyi +136 -187
  224. reflex/middleware/hydrate_middleware.py +2 -0
  225. reflex/middleware/middleware.py +3 -3
  226. reflex/state.py +148 -82
  227. reflex/style.py +21 -22
  228. reflex/utils/exceptions.py +16 -0
  229. reflex/utils/format.py +22 -34
  230. reflex/utils/imports.py +16 -73
  231. reflex/utils/prerequisites.py +15 -8
  232. reflex/utils/pyi_generator.py +13 -8
  233. reflex/utils/serializers.py +12 -22
  234. reflex/utils/telemetry.py +2 -1
  235. reflex/utils/types.py +10 -5
  236. reflex/{ivars → vars}/__init__.py +6 -2
  237. reflex/{ivars → vars}/base.py +567 -206
  238. reflex/{ivars → vars}/function.py +15 -19
  239. reflex/{ivars → vars}/number.py +16 -18
  240. reflex/{ivars → vars}/object.py +28 -30
  241. reflex/{ivars → vars}/sequence.py +53 -42
  242. {reflex-0.6.0a1.dist-info → reflex-0.6.0a2.dist-info}/METADATA +2 -2
  243. reflex-0.6.0a2.dist-info/RECORD +382 -0
  244. reflex/.templates/web/components/reflex/chakra_color_mode_provider.js +0 -36
  245. reflex/vars.py +0 -501
  246. reflex-0.6.0a1.dist-info/RECORD +0 -384
  247. {reflex-0.6.0a1.dist-info → reflex-0.6.0a2.dist-info}/LICENSE +0 -0
  248. {reflex-0.6.0a1.dist-info → reflex-0.6.0a2.dist-info}/WHEEL +0 -0
  249. {reflex-0.6.0a1.dist-info → reflex-0.6.0a2.dist-info}/entry_points.txt +0 -0
@@ -7,21 +7,21 @@ import sys
7
7
  from typing import Any, Callable, ClassVar, Optional, Tuple, Type, Union
8
8
 
9
9
  from reflex.utils.types import GenericType
10
- from reflex.vars import VarData
11
10
 
12
11
  from .base import (
13
12
  CachedVarOperation,
14
- ImmutableVar,
15
13
  LiteralVar,
16
14
  ToOperation,
15
+ Var,
16
+ VarData,
17
17
  cached_property_no_lock,
18
18
  )
19
19
 
20
20
 
21
- class FunctionVar(ImmutableVar[Callable]):
21
+ class FunctionVar(Var[Callable]):
22
22
  """Base class for immutable function vars."""
23
23
 
24
- def __call__(self, *args: ImmutableVar | Any) -> ArgsFunctionOperation:
24
+ def __call__(self, *args: Var | Any) -> ArgsFunctionOperation:
25
25
  """Call the function with the given arguments.
26
26
 
27
27
  Args:
@@ -32,10 +32,10 @@ class FunctionVar(ImmutableVar[Callable]):
32
32
  """
33
33
  return ArgsFunctionOperation.create(
34
34
  ("...args",),
35
- VarOperationCall.create(self, *args, ImmutableVar.create_safe("...args")),
35
+ VarOperationCall.create(self, *args, Var(_js_expr="...args")),
36
36
  )
37
37
 
38
- def call(self, *args: ImmutableVar | Any) -> VarOperationCall:
38
+ def call(self, *args: Var | Any) -> VarOperationCall:
39
39
  """Call the function with the given arguments.
40
40
 
41
41
  Args:
@@ -67,7 +67,7 @@ class FunctionStringVar(FunctionVar):
67
67
  The function var.
68
68
  """
69
69
  return cls(
70
- _var_name=func,
70
+ _js_expr=func,
71
71
  _var_type=_var_type,
72
72
  _var_data=_var_data,
73
73
  )
@@ -78,13 +78,11 @@ class FunctionStringVar(FunctionVar):
78
78
  frozen=True,
79
79
  **{"slots": True} if sys.version_info >= (3, 10) else {},
80
80
  )
81
- class VarOperationCall(CachedVarOperation, ImmutableVar):
81
+ class VarOperationCall(CachedVarOperation, Var):
82
82
  """Base class for immutable vars that are the result of a function call."""
83
83
 
84
84
  _func: Optional[FunctionVar] = dataclasses.field(default=None)
85
- _args: Tuple[Union[ImmutableVar, Any], ...] = dataclasses.field(
86
- default_factory=tuple
87
- )
85
+ _args: Tuple[Union[Var, Any], ...] = dataclasses.field(default_factory=tuple)
88
86
 
89
87
  @cached_property_no_lock
90
88
  def _cached_var_name(self) -> str:
@@ -112,7 +110,7 @@ class VarOperationCall(CachedVarOperation, ImmutableVar):
112
110
  def create(
113
111
  cls,
114
112
  func: FunctionVar,
115
- *args: ImmutableVar | Any,
113
+ *args: Var | Any,
116
114
  _var_type: GenericType = Any,
117
115
  _var_data: VarData | None = None,
118
116
  ) -> VarOperationCall:
@@ -127,7 +125,7 @@ class VarOperationCall(CachedVarOperation, ImmutableVar):
127
125
  The function call var.
128
126
  """
129
127
  return cls(
130
- _var_name="",
128
+ _js_expr="",
131
129
  _var_type=_var_type,
132
130
  _var_data=_var_data,
133
131
  _func=func,
@@ -144,7 +142,7 @@ class ArgsFunctionOperation(CachedVarOperation, FunctionVar):
144
142
  """Base class for immutable function defined via arguments and return expression."""
145
143
 
146
144
  _args_names: Tuple[str, ...] = dataclasses.field(default_factory=tuple)
147
- _return_expr: Union[ImmutableVar, Any] = dataclasses.field(default=None)
145
+ _return_expr: Union[Var, Any] = dataclasses.field(default=None)
148
146
 
149
147
  @cached_property_no_lock
150
148
  def _cached_var_name(self) -> str:
@@ -159,7 +157,7 @@ class ArgsFunctionOperation(CachedVarOperation, FunctionVar):
159
157
  def create(
160
158
  cls,
161
159
  args_names: Tuple[str, ...],
162
- return_expr: ImmutableVar | Any,
160
+ return_expr: Var | Any,
163
161
  _var_type: GenericType = Callable,
164
162
  _var_data: VarData | None = None,
165
163
  ) -> ArgsFunctionOperation:
@@ -174,7 +172,7 @@ class ArgsFunctionOperation(CachedVarOperation, FunctionVar):
174
172
  The function var.
175
173
  """
176
174
  return cls(
177
- _var_name="",
175
+ _js_expr="",
178
176
  _var_type=_var_type,
179
177
  _var_data=_var_data,
180
178
  _args_names=args_names,
@@ -190,9 +188,7 @@ class ArgsFunctionOperation(CachedVarOperation, FunctionVar):
190
188
  class ToFunctionOperation(ToOperation, FunctionVar):
191
189
  """Base class of converting a var to a function."""
192
190
 
193
- _original: ImmutableVar = dataclasses.field(
194
- default_factory=lambda: LiteralVar.create(None)
195
- )
191
+ _original: Var = dataclasses.field(default_factory=lambda: LiteralVar.create(None))
196
192
 
197
193
  _default_var_type: ClassVar[GenericType] = Callable
198
194
 
@@ -18,14 +18,14 @@ from typing import (
18
18
  )
19
19
 
20
20
  from reflex.utils.exceptions import VarTypeError
21
- from reflex.vars import Var, VarData
22
21
 
23
22
  from .base import (
24
23
  CustomVarOperationReturn,
25
- ImmutableVar,
26
24
  LiteralNoneVar,
27
25
  LiteralVar,
28
26
  ToOperation,
27
+ Var,
28
+ VarData,
29
29
  unionize,
30
30
  var_operation,
31
31
  var_operation_return,
@@ -54,7 +54,7 @@ def raise_unsupported_operand_types(
54
54
  )
55
55
 
56
56
 
57
- class NumberVar(ImmutableVar[NUMBER_T]):
57
+ class NumberVar(Var[NUMBER_T]):
58
58
  """Base class for immutable number vars."""
59
59
 
60
60
  @overload
@@ -848,8 +848,8 @@ def boolean_to_number_operation(value: BooleanVar):
848
848
 
849
849
 
850
850
  def comparison_operator(
851
- func: Callable[[ImmutableVar, ImmutableVar], str],
852
- ) -> Callable[[ImmutableVar | Any, ImmutableVar | Any], BooleanVar]:
851
+ func: Callable[[Var, Var], str],
852
+ ) -> Callable[[Var | Any, Var | Any], BooleanVar]:
853
853
  """Decorator to create a comparison operation.
854
854
 
855
855
  Args:
@@ -860,13 +860,13 @@ def comparison_operator(
860
860
  """
861
861
 
862
862
  @var_operation
863
- def operation(lhs: ImmutableVar, rhs: ImmutableVar):
863
+ def operation(lhs: Var, rhs: Var):
864
864
  return var_operation_return(
865
865
  js_expression=func(lhs, rhs),
866
866
  var_type=bool,
867
867
  )
868
868
 
869
- def wrapper(lhs: ImmutableVar | Any, rhs: ImmutableVar | Any) -> BooleanVar:
869
+ def wrapper(lhs: Var | Any, rhs: Var | Any) -> BooleanVar:
870
870
  """Create the comparison operation.
871
871
 
872
872
  Args:
@@ -882,7 +882,7 @@ def comparison_operator(
882
882
 
883
883
 
884
884
  @comparison_operator
885
- def greater_than_operation(lhs: ImmutableVar, rhs: ImmutableVar):
885
+ def greater_than_operation(lhs: Var, rhs: Var):
886
886
  """Greater than comparison.
887
887
 
888
888
  Args:
@@ -896,7 +896,7 @@ def greater_than_operation(lhs: ImmutableVar, rhs: ImmutableVar):
896
896
 
897
897
 
898
898
  @comparison_operator
899
- def greater_than_or_equal_operation(lhs: ImmutableVar, rhs: ImmutableVar):
899
+ def greater_than_or_equal_operation(lhs: Var, rhs: Var):
900
900
  """Greater than or equal comparison.
901
901
 
902
902
  Args:
@@ -910,7 +910,7 @@ def greater_than_or_equal_operation(lhs: ImmutableVar, rhs: ImmutableVar):
910
910
 
911
911
 
912
912
  @comparison_operator
913
- def less_than_operation(lhs: ImmutableVar, rhs: ImmutableVar):
913
+ def less_than_operation(lhs: Var, rhs: Var):
914
914
  """Less than comparison.
915
915
 
916
916
  Args:
@@ -924,7 +924,7 @@ def less_than_operation(lhs: ImmutableVar, rhs: ImmutableVar):
924
924
 
925
925
 
926
926
  @comparison_operator
927
- def less_than_or_equal_operation(lhs: ImmutableVar, rhs: ImmutableVar):
927
+ def less_than_or_equal_operation(lhs: Var, rhs: Var):
928
928
  """Less than or equal comparison.
929
929
 
930
930
  Args:
@@ -938,7 +938,7 @@ def less_than_or_equal_operation(lhs: ImmutableVar, rhs: ImmutableVar):
938
938
 
939
939
 
940
940
  @comparison_operator
941
- def equal_operation(lhs: ImmutableVar, rhs: ImmutableVar):
941
+ def equal_operation(lhs: Var, rhs: Var):
942
942
  """Equal comparison.
943
943
 
944
944
  Args:
@@ -952,7 +952,7 @@ def equal_operation(lhs: ImmutableVar, rhs: ImmutableVar):
952
952
 
953
953
 
954
954
  @comparison_operator
955
- def not_equal_operation(lhs: ImmutableVar, rhs: ImmutableVar):
955
+ def not_equal_operation(lhs: Var, rhs: Var):
956
956
  """Not equal comparison.
957
957
 
958
958
  Args:
@@ -1016,7 +1016,7 @@ class LiteralBooleanVar(LiteralVar, BooleanVar):
1016
1016
  The boolean var.
1017
1017
  """
1018
1018
  return cls(
1019
- _var_name="true" if value else "false",
1019
+ _js_expr="true" if value else "false",
1020
1020
  _var_type=bool,
1021
1021
  _var_data=_var_data,
1022
1022
  _var_value=value,
@@ -1061,7 +1061,7 @@ class LiteralNumberVar(LiteralVar, NumberVar):
1061
1061
  The number var.
1062
1062
  """
1063
1063
  return cls(
1064
- _var_name=str(value),
1064
+ _js_expr=str(value),
1065
1065
  _var_type=type(value),
1066
1066
  _var_data=_var_data,
1067
1067
  _var_value=value,
@@ -1115,9 +1115,7 @@ def boolify(value: Var):
1115
1115
 
1116
1116
 
1117
1117
  @var_operation
1118
- def ternary_operation(
1119
- condition: BooleanVar, if_true: ImmutableVar, if_false: ImmutableVar
1120
- ):
1118
+ def ternary_operation(condition: BooleanVar, if_true: Var, if_false: Var):
1121
1119
  """Create a ternary operation.
1122
1120
 
1123
1121
  Args:
@@ -23,13 +23,13 @@ from typing import (
23
23
  from reflex.utils import types
24
24
  from reflex.utils.exceptions import VarAttributeError
25
25
  from reflex.utils.types import GenericType, get_attribute_access_type, get_origin
26
- from reflex.vars import VarData
27
26
 
28
27
  from .base import (
29
28
  CachedVarOperation,
30
- ImmutableVar,
31
29
  LiteralVar,
32
30
  ToOperation,
31
+ Var,
32
+ VarData,
33
33
  cached_property_no_lock,
34
34
  figure_out_type,
35
35
  var_operation,
@@ -48,7 +48,7 @@ ARRAY_INNER_TYPE = TypeVar("ARRAY_INNER_TYPE")
48
48
  OTHER_KEY_TYPE = TypeVar("OTHER_KEY_TYPE")
49
49
 
50
50
 
51
- class ObjectVar(ImmutableVar[OBJECT_TYPE]):
51
+ class ObjectVar(Var[OBJECT_TYPE]):
52
52
  """Base class for immutable object vars."""
53
53
 
54
54
  def _key_type(self) -> Type:
@@ -134,8 +134,8 @@ class ObjectVar(ImmutableVar[OBJECT_TYPE]):
134
134
  @overload
135
135
  def __getitem__(
136
136
  self: ObjectVar[Dict[KEY_TYPE, NoReturn]],
137
- key: ImmutableVar | Any,
138
- ) -> ImmutableVar: ...
137
+ key: Var | Any,
138
+ ) -> Var: ...
139
139
 
140
140
  @overload
141
141
  def __getitem__(
@@ -144,40 +144,40 @@ class ObjectVar(ImmutableVar[OBJECT_TYPE]):
144
144
  | ObjectVar[Dict[KEY_TYPE, float]]
145
145
  | ObjectVar[Dict[KEY_TYPE, int | float]]
146
146
  ),
147
- key: ImmutableVar | Any,
147
+ key: Var | Any,
148
148
  ) -> NumberVar: ...
149
149
 
150
150
  @overload
151
151
  def __getitem__(
152
152
  self: ObjectVar[Dict[KEY_TYPE, str]],
153
- key: ImmutableVar | Any,
153
+ key: Var | Any,
154
154
  ) -> StringVar: ...
155
155
 
156
156
  @overload
157
157
  def __getitem__(
158
158
  self: ObjectVar[Dict[KEY_TYPE, list[ARRAY_INNER_TYPE]]],
159
- key: ImmutableVar | Any,
159
+ key: Var | Any,
160
160
  ) -> ArrayVar[list[ARRAY_INNER_TYPE]]: ...
161
161
 
162
162
  @overload
163
163
  def __getitem__(
164
164
  self: ObjectVar[Dict[KEY_TYPE, set[ARRAY_INNER_TYPE]]],
165
- key: ImmutableVar | Any,
165
+ key: Var | Any,
166
166
  ) -> ArrayVar[set[ARRAY_INNER_TYPE]]: ...
167
167
 
168
168
  @overload
169
169
  def __getitem__(
170
170
  self: ObjectVar[Dict[KEY_TYPE, tuple[ARRAY_INNER_TYPE, ...]]],
171
- key: ImmutableVar | Any,
171
+ key: Var | Any,
172
172
  ) -> ArrayVar[tuple[ARRAY_INNER_TYPE, ...]]: ...
173
173
 
174
174
  @overload
175
175
  def __getitem__(
176
176
  self: ObjectVar[Dict[KEY_TYPE, dict[OTHER_KEY_TYPE, VALUE_TYPE]]],
177
- key: ImmutableVar | Any,
177
+ key: Var | Any,
178
178
  ) -> ObjectVar[dict[OTHER_KEY_TYPE, VALUE_TYPE]]: ...
179
179
 
180
- def __getitem__(self, key: ImmutableVar | Any) -> ImmutableVar:
180
+ def __getitem__(self, key: Var | Any) -> Var:
181
181
  """Get an item from the object.
182
182
 
183
183
  Args:
@@ -197,7 +197,7 @@ class ObjectVar(ImmutableVar[OBJECT_TYPE]):
197
197
  def __getattr__(
198
198
  self: ObjectVar[Dict[KEY_TYPE, NoReturn]],
199
199
  name: str,
200
- ) -> ImmutableVar: ...
200
+ ) -> Var: ...
201
201
 
202
202
  @overload
203
203
  def __getattr__(
@@ -239,7 +239,7 @@ class ObjectVar(ImmutableVar[OBJECT_TYPE]):
239
239
  name: str,
240
240
  ) -> ObjectVar[dict[OTHER_KEY_TYPE, VALUE_TYPE]]: ...
241
241
 
242
- def __getattr__(self, name) -> ImmutableVar:
242
+ def __getattr__(self, name) -> Var:
243
243
  """Get an attribute of the var.
244
244
 
245
245
  Args:
@@ -271,7 +271,7 @@ class ObjectVar(ImmutableVar[OBJECT_TYPE]):
271
271
  else:
272
272
  return ObjectItemOperation.create(self, name).guess_type()
273
273
 
274
- def contains(self, key: ImmutableVar | Any) -> BooleanVar:
274
+ def contains(self, key: Var | Any) -> BooleanVar:
275
275
  """Check if the object contains a key.
276
276
 
277
277
  Args:
@@ -291,8 +291,8 @@ class ObjectVar(ImmutableVar[OBJECT_TYPE]):
291
291
  class LiteralObjectVar(CachedVarOperation, ObjectVar[OBJECT_TYPE], LiteralVar):
292
292
  """Base class for immutable literal object vars."""
293
293
 
294
- _var_value: Dict[Union[ImmutableVar, Any], Union[ImmutableVar, Any]] = (
295
- dataclasses.field(default_factory=dict)
294
+ _var_value: Dict[Union[Var, Any], Union[Var, Any]] = dataclasses.field(
295
+ default_factory=dict
296
296
  )
297
297
 
298
298
  def _key_type(self) -> Type:
@@ -354,7 +354,7 @@ class LiteralObjectVar(CachedVarOperation, ObjectVar[OBJECT_TYPE], LiteralVar):
354
354
  Returns:
355
355
  The hash of the var.
356
356
  """
357
- return hash((self.__class__.__name__, self._var_name))
357
+ return hash((self.__class__.__name__, self._js_expr))
358
358
 
359
359
  @cached_property_no_lock
360
360
  def _cached_get_all_var_data(self) -> VarData | None:
@@ -390,7 +390,7 @@ class LiteralObjectVar(CachedVarOperation, ObjectVar[OBJECT_TYPE], LiteralVar):
390
390
  The literal object var.
391
391
  """
392
392
  return LiteralObjectVar(
393
- _var_name="",
393
+ _js_expr="",
394
394
  _var_type=(figure_out_type(_var_value) if _var_type is None else _var_type),
395
395
  _var_data=_var_data,
396
396
  _var_value=_var_value,
@@ -470,15 +470,13 @@ def object_merge_operation(lhs: ObjectVar, rhs: ObjectVar):
470
470
  frozen=True,
471
471
  **{"slots": True} if sys.version_info >= (3, 10) else {},
472
472
  )
473
- class ObjectItemOperation(CachedVarOperation, ImmutableVar):
473
+ class ObjectItemOperation(CachedVarOperation, Var):
474
474
  """Operation to get an item from an object."""
475
475
 
476
476
  _object: ObjectVar = dataclasses.field(
477
477
  default_factory=lambda: LiteralObjectVar.create({})
478
478
  )
479
- _key: ImmutableVar | Any = dataclasses.field(
480
- default_factory=lambda: LiteralVar.create(None)
481
- )
479
+ _key: Var | Any = dataclasses.field(default_factory=lambda: LiteralVar.create(None))
482
480
 
483
481
  @cached_property_no_lock
484
482
  def _cached_var_name(self) -> str:
@@ -495,7 +493,7 @@ class ObjectItemOperation(CachedVarOperation, ImmutableVar):
495
493
  def create(
496
494
  cls,
497
495
  object: ObjectVar,
498
- key: ImmutableVar | Any,
496
+ key: Var | Any,
499
497
  _var_type: GenericType | None = None,
500
498
  _var_data: VarData | None = None,
501
499
  ) -> ObjectItemOperation:
@@ -511,11 +509,11 @@ class ObjectItemOperation(CachedVarOperation, ImmutableVar):
511
509
  The object item operation.
512
510
  """
513
511
  return cls(
514
- _var_name="",
512
+ _js_expr="",
515
513
  _var_type=object._value_type() if _var_type is None else _var_type,
516
514
  _var_data=_var_data,
517
515
  _object=object,
518
- _key=key if isinstance(key, ImmutableVar) else LiteralVar.create(key),
516
+ _key=key if isinstance(key, Var) else LiteralVar.create(key),
519
517
  )
520
518
 
521
519
 
@@ -527,7 +525,7 @@ class ObjectItemOperation(CachedVarOperation, ImmutableVar):
527
525
  class ToObjectOperation(ToOperation, ObjectVar):
528
526
  """Operation to convert a var to an object."""
529
527
 
530
- _original: ImmutableVar = dataclasses.field(
528
+ _original: Var = dataclasses.field(
531
529
  default_factory=lambda: LiteralObjectVar.create({})
532
530
  )
533
531
 
@@ -542,13 +540,13 @@ class ToObjectOperation(ToOperation, ObjectVar):
542
540
  Returns:
543
541
  The attribute of the var.
544
542
  """
545
- if name == "_var_name":
546
- return self._original._var_name
543
+ if name == "_js_expr":
544
+ return self._original._js_expr
547
545
  return ObjectVar.__getattr__(self, name)
548
546
 
549
547
 
550
548
  @var_operation
551
- def object_has_own_property_operation(object: ObjectVar, key: ImmutableVar):
549
+ def object_has_own_property_operation(object: ObjectVar, key: Var):
552
550
  """Check if an object has a key.
553
551
 
554
552
  Args: