reflex 0.8.4a1__py3-none-any.whl → 0.8.5__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 (147) hide show
  1. reflex/.templates/web/utils/react-theme.js +12 -17
  2. reflex/__init__.py +2 -9
  3. reflex/__init__.pyi +4 -2
  4. reflex/app.py +16 -10
  5. reflex/compiler/compiler.py +10 -3
  6. reflex/compiler/utils.py +6 -12
  7. reflex/components/base/app_wrap.pyi +0 -1
  8. reflex/components/base/body.pyi +0 -2
  9. reflex/components/base/document.pyi +0 -12
  10. reflex/components/base/error_boundary.pyi +0 -2
  11. reflex/components/base/fragment.pyi +0 -2
  12. reflex/components/base/link.pyi +0 -4
  13. reflex/components/base/meta.pyi +0 -6
  14. reflex/components/base/script.py +0 -2
  15. reflex/components/base/script.pyi +0 -2
  16. reflex/components/base/strict_mode.pyi +0 -2
  17. reflex/components/component.py +2 -30
  18. reflex/components/core/auto_scroll.py +14 -13
  19. reflex/components/core/auto_scroll.pyi +0 -2
  20. reflex/components/core/banner.pyi +0 -10
  21. reflex/components/core/client_side_routing.pyi +0 -2
  22. reflex/components/core/clipboard.py +1 -3
  23. reflex/components/core/clipboard.pyi +0 -2
  24. reflex/components/core/cond.py +0 -2
  25. reflex/components/core/debounce.pyi +0 -1
  26. reflex/components/core/helmet.pyi +0 -2
  27. reflex/components/core/html.pyi +0 -2
  28. reflex/components/core/match.py +1 -2
  29. reflex/components/core/sticky.pyi +0 -4
  30. reflex/components/core/upload.pyi +0 -10
  31. reflex/components/core/window_events.pyi +0 -2
  32. reflex/components/datadisplay/code.py +6 -4
  33. reflex/components/datadisplay/code.pyi +0 -4
  34. reflex/components/datadisplay/dataeditor.pyi +0 -2
  35. reflex/components/datadisplay/shiki_code_block.pyi +0 -6
  36. reflex/components/el/element.pyi +0 -2
  37. reflex/components/el/elements/base.pyi +0 -2
  38. reflex/components/el/elements/forms.py +5 -21
  39. reflex/components/el/elements/forms.pyi +0 -38
  40. reflex/components/el/elements/inline.pyi +0 -56
  41. reflex/components/el/elements/media.pyi +0 -52
  42. reflex/components/el/elements/metadata.pyi +0 -12
  43. reflex/components/el/elements/other.pyi +0 -14
  44. reflex/components/el/elements/scripts.pyi +0 -6
  45. reflex/components/el/elements/sectioning.pyi +0 -30
  46. reflex/components/el/elements/tables.pyi +0 -20
  47. reflex/components/el/elements/typography.pyi +0 -32
  48. reflex/components/gridjs/datatable.pyi +0 -4
  49. reflex/components/lucide/icon.py +12 -1
  50. reflex/components/lucide/icon.pyi +12 -7
  51. reflex/components/markdown/markdown.pyi +0 -2
  52. reflex/components/moment/moment.pyi +0 -2
  53. reflex/components/plotly/plotly.py +25 -17
  54. reflex/components/plotly/plotly.pyi +0 -18
  55. reflex/components/radix/primitives/accordion.pyi +0 -14
  56. reflex/components/radix/primitives/base.pyi +0 -4
  57. reflex/components/radix/primitives/drawer.pyi +0 -22
  58. reflex/components/radix/primitives/form.pyi +0 -20
  59. reflex/components/radix/primitives/progress.pyi +0 -10
  60. reflex/components/radix/primitives/slider.pyi +0 -10
  61. reflex/components/radix/themes/base.py +2 -4
  62. reflex/components/radix/themes/base.pyi +0 -15
  63. reflex/components/radix/themes/color_mode.pyi +0 -5
  64. reflex/components/radix/themes/components/alert_dialog.pyi +0 -11
  65. reflex/components/radix/themes/components/aspect_ratio.pyi +0 -2
  66. reflex/components/radix/themes/components/avatar.pyi +0 -2
  67. reflex/components/radix/themes/components/badge.pyi +0 -2
  68. reflex/components/radix/themes/components/button.pyi +0 -2
  69. reflex/components/radix/themes/components/callout.pyi +0 -10
  70. reflex/components/radix/themes/components/card.pyi +0 -2
  71. reflex/components/radix/themes/components/checkbox.pyi +0 -6
  72. reflex/components/radix/themes/components/checkbox_cards.pyi +0 -4
  73. reflex/components/radix/themes/components/checkbox_group.pyi +0 -4
  74. reflex/components/radix/themes/components/context_menu.pyi +0 -26
  75. reflex/components/radix/themes/components/data_list.pyi +0 -8
  76. reflex/components/radix/themes/components/dialog.pyi +0 -12
  77. reflex/components/radix/themes/components/dropdown_menu.pyi +0 -14
  78. reflex/components/radix/themes/components/hover_card.pyi +0 -7
  79. reflex/components/radix/themes/components/icon_button.pyi +0 -2
  80. reflex/components/radix/themes/components/inset.pyi +0 -2
  81. reflex/components/radix/themes/components/popover.pyi +0 -6
  82. reflex/components/radix/themes/components/progress.pyi +0 -2
  83. reflex/components/radix/themes/components/radio.pyi +0 -2
  84. reflex/components/radix/themes/components/radio_cards.pyi +0 -4
  85. reflex/components/radix/themes/components/radio_group.pyi +0 -8
  86. reflex/components/radix/themes/components/scroll_area.pyi +0 -2
  87. reflex/components/radix/themes/components/segmented_control.pyi +0 -4
  88. reflex/components/radix/themes/components/select.pyi +0 -18
  89. reflex/components/radix/themes/components/separator.pyi +0 -2
  90. reflex/components/radix/themes/components/skeleton.pyi +0 -2
  91. reflex/components/radix/themes/components/slider.pyi +0 -2
  92. reflex/components/radix/themes/components/spinner.pyi +0 -2
  93. reflex/components/radix/themes/components/switch.pyi +0 -2
  94. reflex/components/radix/themes/components/table.pyi +0 -14
  95. reflex/components/radix/themes/components/tabs.pyi +0 -10
  96. reflex/components/radix/themes/components/text_area.pyi +0 -2
  97. reflex/components/radix/themes/components/text_field.pyi +0 -6
  98. reflex/components/radix/themes/components/tooltip.pyi +0 -2
  99. reflex/components/radix/themes/layout/base.pyi +0 -2
  100. reflex/components/radix/themes/layout/box.pyi +0 -2
  101. reflex/components/radix/themes/layout/center.pyi +0 -2
  102. reflex/components/radix/themes/layout/container.pyi +0 -1
  103. reflex/components/radix/themes/layout/flex.pyi +0 -2
  104. reflex/components/radix/themes/layout/grid.pyi +0 -2
  105. reflex/components/radix/themes/layout/list.pyi +0 -10
  106. reflex/components/radix/themes/layout/section.pyi +0 -2
  107. reflex/components/radix/themes/layout/spacer.pyi +0 -2
  108. reflex/components/radix/themes/layout/stack.pyi +0 -6
  109. reflex/components/radix/themes/typography/blockquote.pyi +0 -2
  110. reflex/components/radix/themes/typography/code.pyi +0 -2
  111. reflex/components/radix/themes/typography/heading.pyi +0 -2
  112. reflex/components/radix/themes/typography/link.pyi +0 -2
  113. reflex/components/radix/themes/typography/text.pyi +0 -14
  114. reflex/components/react_player/audio.pyi +0 -2
  115. reflex/components/react_player/react_player.pyi +0 -2
  116. reflex/components/react_player/video.pyi +0 -2
  117. reflex/components/react_router/dom.pyi +0 -2
  118. reflex/components/recharts/cartesian.pyi +0 -38
  119. reflex/components/recharts/charts.pyi +0 -24
  120. reflex/components/recharts/general.pyi +0 -12
  121. reflex/components/recharts/polar.pyi +0 -12
  122. reflex/components/recharts/recharts.pyi +0 -4
  123. reflex/components/sonner/toast.pyi +0 -2
  124. reflex/components/tags/cond_tag.py +4 -3
  125. reflex/components/tags/iter_tag.py +1 -1
  126. reflex/components/tags/match_tag.py +3 -2
  127. reflex/components/tags/tag.py +39 -40
  128. reflex/constants/base.py +4 -58
  129. reflex/constants/compiler.py +0 -8
  130. reflex/constants/installer.py +5 -5
  131. reflex/environment.py +0 -10
  132. reflex/event.py +77 -15
  133. reflex/page.py +62 -4
  134. reflex/reflex.py +2 -5
  135. reflex/utils/misc.py +0 -3
  136. reflex/utils/net.py +7 -2
  137. reflex/utils/prerequisites.py +8 -71
  138. reflex/utils/processes.py +6 -6
  139. {reflex-0.8.4a1.dist-info → reflex-0.8.5.dist-info}/METADATA +2 -2
  140. {reflex-0.8.4a1.dist-info → reflex-0.8.5.dist-info}/RECORD +143 -147
  141. reflex/components/el/constants/__init__.py +0 -5
  142. reflex/components/el/constants/html.py +0 -343
  143. reflex/components/el/constants/react.py +0 -501
  144. reflex/components/el/constants/reflex.py +0 -51
  145. {reflex-0.8.4a1.dist-info → reflex-0.8.5.dist-info}/WHEEL +0 -0
  146. {reflex-0.8.4a1.dist-info → reflex-0.8.5.dist-info}/entry_points.txt +0 -0
  147. {reflex-0.8.4a1.dist-info → reflex-0.8.5.dist-info}/licenses/LICENSE +0 -0
@@ -34,7 +34,6 @@ class ResponsiveContainer(Recharts, MemoizationLeaf):
34
34
  id: Any | None = None,
35
35
  ref: Var | None = None,
36
36
  class_name: Any | None = None,
37
- autofocus: bool | None = None,
38
37
  custom_attrs: dict[str, Var | Any] | None = None,
39
38
  on_blur: EventType[()] | None = None,
40
39
  on_click: EventType[()] | EventType[PointerEventInfo] | None = None,
@@ -71,7 +70,6 @@ class ResponsiveContainer(Recharts, MemoizationLeaf):
71
70
  id: The id for the component.
72
71
  ref: The Var to pass as the ref to the component.
73
72
  class_name: The class name for the component.
74
- autofocus: Whether the component should take the focus once the page is loaded
75
73
  custom_attrs: custom attribute
76
74
  **props: The props of the component.
77
75
 
@@ -136,7 +134,6 @@ class Legend(Recharts):
136
134
  id: Any | None = None,
137
135
  ref: Var | None = None,
138
136
  class_name: Any | None = None,
139
- autofocus: bool | None = None,
140
137
  custom_attrs: dict[str, Var | Any] | None = None,
141
138
  on_blur: EventType[()] | None = None,
142
139
  on_click: EventType[()] | None = None,
@@ -184,7 +181,6 @@ class Legend(Recharts):
184
181
  id: The id for the component.
185
182
  ref: The Var to pass as the ref to the component.
186
183
  class_name: The class name for the component.
187
- autofocus: Whether the component should take the focus once the page is loaded
188
184
  custom_attrs: custom attribute
189
185
  **props: The props of the component.
190
186
 
@@ -226,7 +222,6 @@ class GraphingTooltip(Recharts):
226
222
  id: Any | None = None,
227
223
  ref: Var | None = None,
228
224
  class_name: Any | None = None,
229
- autofocus: bool | None = None,
230
225
  custom_attrs: dict[str, Var | Any] | None = None,
231
226
  on_blur: EventType[()] | None = None,
232
227
  on_click: EventType[()] | EventType[PointerEventInfo] | None = None,
@@ -271,7 +266,6 @@ class GraphingTooltip(Recharts):
271
266
  id: The id for the component.
272
267
  ref: The Var to pass as the ref to the component.
273
268
  class_name: The class name for the component.
274
- autofocus: Whether the component should take the focus once the page is loaded
275
269
  custom_attrs: custom attribute
276
270
  **props: The props of the component.
277
271
 
@@ -339,7 +333,6 @@ class Label(Recharts):
339
333
  id: Any | None = None,
340
334
  ref: Var | None = None,
341
335
  class_name: Any | None = None,
342
- autofocus: bool | None = None,
343
336
  custom_attrs: dict[str, Var | Any] | None = None,
344
337
  on_blur: EventType[()] | None = None,
345
338
  on_click: EventType[()] | EventType[PointerEventInfo] | None = None,
@@ -372,7 +365,6 @@ class Label(Recharts):
372
365
  id: The id for the component.
373
366
  ref: The Var to pass as the ref to the component.
374
367
  class_name: The class name for the component.
375
- autofocus: Whether the component should take the focus once the page is loaded
376
368
  custom_attrs: custom attribute
377
369
  **props: The props of the component.
378
370
 
@@ -441,7 +433,6 @@ class LabelList(Recharts):
441
433
  id: Any | None = None,
442
434
  ref: Var | None = None,
443
435
  class_name: Any | None = None,
444
- autofocus: bool | None = None,
445
436
  custom_attrs: dict[str, Var | Any] | None = None,
446
437
  on_blur: EventType[()] | None = None,
447
438
  on_click: EventType[()] | EventType[PointerEventInfo] | None = None,
@@ -475,7 +466,6 @@ class LabelList(Recharts):
475
466
  id: The id for the component.
476
467
  ref: The Var to pass as the ref to the component.
477
468
  class_name: The class name for the component.
478
- autofocus: Whether the component should take the focus once the page is loaded
479
469
  custom_attrs: custom attribute
480
470
  **props: The props of the component.
481
471
 
@@ -499,7 +489,6 @@ class Cell(Recharts):
499
489
  id: Any | None = None,
500
490
  ref: Var | None = None,
501
491
  class_name: Any | None = None,
502
- autofocus: bool | None = None,
503
492
  custom_attrs: dict[str, Var | Any] | None = None,
504
493
  on_blur: EventType[()] | None = None,
505
494
  on_click: EventType[()] | EventType[PointerEventInfo] | None = None,
@@ -530,7 +519,6 @@ class Cell(Recharts):
530
519
  id: The id for the component.
531
520
  ref: The Var to pass as the ref to the component.
532
521
  class_name: The class name for the component.
533
- autofocus: Whether the component should take the focus once the page is loaded
534
522
  custom_attrs: custom attribute
535
523
  **props: The props of the component.
536
524
 
@@ -82,7 +82,6 @@ class Pie(Recharts):
82
82
  id: Any | None = None,
83
83
  ref: Var | None = None,
84
84
  class_name: Any | None = None,
85
- autofocus: bool | None = None,
86
85
  custom_attrs: dict[str, Var | Any] | None = None,
87
86
  on_animation_end: EventType[()] | None = None,
88
87
  on_animation_start: EventType[()] | None = None,
@@ -124,7 +123,6 @@ class Pie(Recharts):
124
123
  id: The id for the component.
125
124
  ref: The Var to pass as the ref to the component.
126
125
  class_name: The class name for the component.
127
- autofocus: Whether the component should take the focus once the page is loaded
128
126
  custom_attrs: custom attribute
129
127
  **props: The props of the component.
130
128
 
@@ -192,7 +190,6 @@ class Radar(Recharts):
192
190
  id: Any | None = None,
193
191
  ref: Var | None = None,
194
192
  class_name: Any | None = None,
195
- autofocus: bool | None = None,
196
193
  custom_attrs: dict[str, Var | Any] | None = None,
197
194
  on_animation_end: EventType[()] | None = None,
198
195
  on_animation_start: EventType[()] | None = None,
@@ -219,7 +216,6 @@ class Radar(Recharts):
219
216
  id: The id for the component.
220
217
  ref: The Var to pass as the ref to the component.
221
218
  class_name: The class name for the component.
222
- autofocus: Whether the component should take the focus once the page is loaded
223
219
  custom_attrs: custom attribute
224
220
  **props: The props of the component.
225
221
 
@@ -285,7 +281,6 @@ class RadialBar(Recharts):
285
281
  id: Any | None = None,
286
282
  ref: Var | None = None,
287
283
  class_name: Any | None = None,
288
- autofocus: bool | None = None,
289
284
  custom_attrs: dict[str, Var | Any] | None = None,
290
285
  on_animation_end: EventType[()] | None = None,
291
286
  on_animation_start: EventType[()] | None = None,
@@ -316,7 +311,6 @@ class RadialBar(Recharts):
316
311
  id: The id for the component.
317
312
  ref: The Var to pass as the ref to the component.
318
313
  class_name: The class name for the component.
319
- autofocus: Whether the component should take the focus once the page is loaded
320
314
  custom_attrs: custom attribute
321
315
  **props: The props of the component.
322
316
 
@@ -352,7 +346,6 @@ class PolarAngleAxis(Recharts):
352
346
  id: Any | None = None,
353
347
  ref: Var | None = None,
354
348
  class_name: Any | None = None,
355
- autofocus: bool | None = None,
356
349
  custom_attrs: dict[str, Var | Any] | None = None,
357
350
  on_blur: EventType[()] | None = None,
358
351
  on_click: EventType[()] | None = None,
@@ -401,7 +394,6 @@ class PolarAngleAxis(Recharts):
401
394
  id: The id for the component.
402
395
  ref: The Var to pass as the ref to the component.
403
396
  class_name: The class name for the component.
404
- autofocus: Whether the component should take the focus once the page is loaded
405
397
  custom_attrs: custom attribute
406
398
  **props: The props of the component.
407
399
 
@@ -433,7 +425,6 @@ class PolarGrid(Recharts):
433
425
  id: Any | None = None,
434
426
  ref: Var | None = None,
435
427
  class_name: Any | None = None,
436
- autofocus: bool | None = None,
437
428
  custom_attrs: dict[str, Var | Any] | None = None,
438
429
  on_blur: EventType[()] | None = None,
439
430
  on_click: EventType[()] | EventType[PointerEventInfo] | None = None,
@@ -470,7 +461,6 @@ class PolarGrid(Recharts):
470
461
  id: The id for the component.
471
462
  ref: The Var to pass as the ref to the component.
472
463
  class_name: The class name for the component.
473
- autofocus: Whether the component should take the focus once the page is loaded
474
464
  custom_attrs: custom attribute
475
465
  **props: The props of the component.
476
466
 
@@ -547,7 +537,6 @@ class PolarRadiusAxis(Recharts):
547
537
  id: Any | None = None,
548
538
  ref: Var | None = None,
549
539
  class_name: Any | None = None,
550
- autofocus: bool | None = None,
551
540
  custom_attrs: dict[str, Var | Any] | None = None,
552
541
  on_click: EventType[()] | None = None,
553
542
  on_mouse_enter: EventType[()] | None = None,
@@ -579,7 +568,6 @@ class PolarRadiusAxis(Recharts):
579
568
  id: The id for the component.
580
569
  ref: The Var to pass as the ref to the component.
581
570
  class_name: The class name for the component.
582
- autofocus: Whether the component should take the focus once the page is loaded
583
571
  custom_attrs: custom attribute
584
572
  **props: The props of the component.
585
573
 
@@ -25,7 +25,6 @@ class Recharts(Component):
25
25
  id: Any | None = None,
26
26
  ref: Var | None = None,
27
27
  class_name: Any | None = None,
28
- autofocus: bool | None = None,
29
28
  custom_attrs: dict[str, Var | Any] | None = None,
30
29
  on_blur: EventType[()] | None = None,
31
30
  on_click: EventType[()] | EventType[PointerEventInfo] | None = None,
@@ -54,7 +53,6 @@ class Recharts(Component):
54
53
  id: The id for the component.
55
54
  ref: The Var to pass as the ref to the component.
56
55
  class_name: The class name for the component.
57
- autofocus: Whether the component should take the focus once the page is loaded
58
56
  custom_attrs: custom attribute
59
57
  **props: The props of the component.
60
58
 
@@ -76,7 +74,6 @@ class RechartsCharts(NoSSRComponent, MemoizationLeaf):
76
74
  id: Any | None = None,
77
75
  ref: Var | None = None,
78
76
  class_name: Any | None = None,
79
- autofocus: bool | None = None,
80
77
  custom_attrs: dict[str, Var | Any] | None = None,
81
78
  on_blur: EventType[()] | None = None,
82
79
  on_click: EventType[()] | EventType[PointerEventInfo] | None = None,
@@ -105,7 +102,6 @@ class RechartsCharts(NoSSRComponent, MemoizationLeaf):
105
102
  id: The id for the component.
106
103
  ref: The Var to pass as the ref to the component.
107
104
  class_name: The class name for the component.
108
- autofocus: Whether the component should take the focus once the page is loaded
109
105
  custom_attrs: custom attribute
110
106
  **props: The props of the component.
111
107
 
@@ -127,7 +127,6 @@ class Toaster(Component):
127
127
  id: Any | None = None,
128
128
  ref: Var | None = None,
129
129
  class_name: Any | None = None,
130
- autofocus: bool | None = None,
131
130
  custom_attrs: dict[str, Var | Any] | None = None,
132
131
  on_blur: EventType[()] | None = None,
133
132
  on_click: EventType[()] | EventType[PointerEventInfo] | None = None,
@@ -170,7 +169,6 @@ class Toaster(Component):
170
169
  id: The id for the component.
171
170
  ref: The Var to pass as the ref to the component.
172
171
  class_name: The class name for the component.
173
- autofocus: Whether the component should take the focus once the page is loaded
174
172
  custom_attrs: custom attribute
175
173
  **props: The properties of the toaster.
176
174
 
@@ -1,13 +1,14 @@
1
1
  """Tag to conditionally render components."""
2
2
 
3
3
  import dataclasses
4
+ from collections.abc import Mapping
4
5
  from typing import Any
5
6
 
6
7
  from reflex.components.tags.tag import Tag
7
8
  from reflex.vars.base import Var
8
9
 
9
10
 
10
- @dataclasses.dataclass()
11
+ @dataclasses.dataclass(frozen=True)
11
12
  class CondTag(Tag):
12
13
  """A conditional tag."""
13
14
 
@@ -15,7 +16,7 @@ class CondTag(Tag):
15
16
  cond: Var[Any] = dataclasses.field(default_factory=lambda: Var.create(True))
16
17
 
17
18
  # The code to render if the condition is true.
18
- true_value: dict = dataclasses.field(default_factory=dict)
19
+ true_value: Mapping = dataclasses.field(default_factory=dict)
19
20
 
20
21
  # The code to render if the condition is false.
21
- false_value: dict | None = None
22
+ false_value: Mapping | None = None
@@ -16,7 +16,7 @@ if TYPE_CHECKING:
16
16
  from reflex.components.component import Component
17
17
 
18
18
 
19
- @dataclasses.dataclass()
19
+ @dataclasses.dataclass(frozen=True)
20
20
  class IterTag(Tag):
21
21
  """An iterator tag."""
22
22
 
@@ -1,13 +1,14 @@
1
1
  """Tag to conditionally match cases."""
2
2
 
3
3
  import dataclasses
4
+ from collections.abc import Sequence
4
5
  from typing import Any
5
6
 
6
7
  from reflex.components.tags.tag import Tag
7
8
  from reflex.vars.base import Var
8
9
 
9
10
 
10
- @dataclasses.dataclass()
11
+ @dataclasses.dataclass(frozen=True)
11
12
  class MatchTag(Tag):
12
13
  """A match tag."""
13
14
 
@@ -15,7 +16,7 @@ class MatchTag(Tag):
15
16
  cond: Var[Any] = dataclasses.field(default_factory=lambda: Var.create(True))
16
17
 
17
18
  # The list of match cases to be matched.
18
- match_cases: list[Any] = dataclasses.field(default_factory=list)
19
+ match_cases: Sequence[Any] = dataclasses.field(default_factory=list)
19
20
 
20
21
  # The catchall case to match.
21
22
  default: Any = dataclasses.field(default=Var.create(None))
@@ -31,7 +31,7 @@ def render_prop(value: Any) -> Any:
31
31
  return value
32
32
 
33
33
 
34
- @dataclasses.dataclass()
34
+ @dataclasses.dataclass(frozen=True)
35
35
  class Tag:
36
36
  """A React tag."""
37
37
 
@@ -39,24 +39,16 @@ class Tag:
39
39
  name: str = ""
40
40
 
41
41
  # The props of the tag.
42
- props: dict[str, Any] = dataclasses.field(default_factory=dict)
42
+ props: Mapping[str, Any] = dataclasses.field(default_factory=dict)
43
43
 
44
44
  # The inner contents of the tag.
45
45
  contents: str = ""
46
46
 
47
47
  # Special props that aren't key value pairs.
48
- special_props: list[Var] = dataclasses.field(default_factory=list)
48
+ special_props: Sequence[Var] = dataclasses.field(default_factory=list)
49
49
 
50
50
  # The children components.
51
- children: list[Any] = dataclasses.field(default_factory=list)
52
-
53
- def __post_init__(self):
54
- """Post initialize the tag."""
55
- object.__setattr__(
56
- self,
57
- "props",
58
- {name: LiteralVar.create(value) for name, value in self.props.items()},
59
- )
51
+ children: Sequence[Any] = dataclasses.field(default_factory=list)
60
52
 
61
53
  def format_props(self) -> list:
62
54
  """Format the tag's props.
@@ -67,18 +59,15 @@ class Tag:
67
59
  return format.format_props(*self.special_props, **self.props)
68
60
 
69
61
  def set(self, **kwargs: Any):
70
- """Set the tag's fields.
62
+ """Return a new tag with the given fields set.
71
63
 
72
64
  Args:
73
65
  **kwargs: The fields to set.
74
66
 
75
67
  Returns:
76
- The tag with the fields
68
+ The tag with the fields set.
77
69
  """
78
- for name, value in kwargs.items():
79
- setattr(self, name, value)
80
-
81
- return self
70
+ return dataclasses.replace(self, **kwargs)
82
71
 
83
72
  def __iter__(self):
84
73
  """Iterate over the tag's fields.
@@ -87,12 +76,15 @@ class Tag:
87
76
  tuple[str, Any]: The field name and value.
88
77
  """
89
78
  for field in dataclasses.fields(self):
90
- rendered_value = render_prop(getattr(self, field.name))
91
- if rendered_value is not None:
92
- yield field.name, rendered_value
79
+ if field.name == "props":
80
+ yield "props", self.format_props()
81
+ elif field.name != "special_props":
82
+ rendered_value = render_prop(getattr(self, field.name))
83
+ if rendered_value is not None:
84
+ yield field.name, rendered_value
93
85
 
94
86
  def add_props(self, **kwargs: Any | None) -> Tag:
95
- """Add props to the tag.
87
+ """Return a new tag with the given props added.
96
88
 
97
89
  Args:
98
90
  **kwargs: The props to add.
@@ -100,33 +92,40 @@ class Tag:
100
92
  Returns:
101
93
  The tag with the props added.
102
94
  """
103
- self.props.update(
104
- {
105
- format.to_camel_case(name, treat_hyphens_as_underscores=False): (
106
- prop
107
- if isinstance(prop, (EventChain, Mapping))
108
- else LiteralVar.create(prop)
109
- )
110
- for name, prop in kwargs.items()
111
- if self.is_valid_prop(prop)
112
- }
95
+ return dataclasses.replace(
96
+ self,
97
+ props={
98
+ **self.props,
99
+ **{
100
+ format.to_camel_case(name, treat_hyphens_as_underscores=False): (
101
+ prop
102
+ if isinstance(prop, (EventChain, Mapping))
103
+ else LiteralVar.create(prop)
104
+ )
105
+ for name, prop in kwargs.items()
106
+ if self.is_valid_prop(prop)
107
+ },
108
+ },
113
109
  )
114
- return self
115
110
 
116
111
  def remove_props(self, *args: str) -> Tag:
117
- """Remove props from the tag.
112
+ """Return a new tag with the given props removed.
118
113
 
119
114
  Args:
120
- *args: The props to remove.
115
+ *args: The names of the props to remove.
121
116
 
122
117
  Returns:
123
118
  The tag with the props removed.
124
119
  """
125
- for name in args:
126
- prop_name = format.to_camel_case(name)
127
- if prop_name in self.props:
128
- del self.props[prop_name]
129
- return self
120
+ formatted_args = [format.to_camel_case(arg) for arg in args]
121
+ return dataclasses.replace(
122
+ self,
123
+ props={
124
+ name: value
125
+ for name, value in self.props.items()
126
+ if name not in formatted_args
127
+ },
128
+ )
130
129
 
131
130
  @staticmethod
132
131
  def is_valid_prop(prop: Var | None) -> bool:
reflex/constants/base.py CHANGED
@@ -11,8 +11,6 @@ from typing import Literal
11
11
 
12
12
  from platformdirs import PlatformDirs
13
13
 
14
- from .utils import classproperty
15
-
16
14
  IS_WINDOWS = platform.system() == "Windows"
17
15
  IS_MACOS = platform.system() == "Darwin"
18
16
  IS_LINUX = platform.system() == "Linux"
@@ -119,9 +117,6 @@ class ReflexHostingCLI(SimpleNamespace):
119
117
  class Templates(SimpleNamespace):
120
118
  """Constants related to Templates."""
121
119
 
122
- # The route on Reflex backend to query which templates are available and their URLs.
123
- APP_TEMPLATES_ROUTE = "/app-templates"
124
-
125
120
  # The default template
126
121
  DEFAULT = "blank"
127
122
 
@@ -132,58 +127,12 @@ class Templates(SimpleNamespace):
132
127
  CHOOSE_TEMPLATES = "choose-templates"
133
128
 
134
129
  # The URL to find reflex templates.
135
- REFLEX_TEMPLATES_URL = "https://reflex.dev/templates"
136
-
137
- # Demo url for the default template.
138
- DEFAULT_TEMPLATE_URL = "https://blank-template.reflex.run"
130
+ REFLEX_TEMPLATES_URL = (
131
+ "https://reflex.dev/docs/getting-started/open-source-templates/"
132
+ )
139
133
 
140
134
  # The reflex.build frontend host
141
- REFLEX_BUILD_FRONTEND = "https://reflex.build"
142
-
143
- # The reflex.build backend host
144
- REFLEX_BUILD_BACKEND = "https://flexgen-prod-flexgen.fly.dev"
145
-
146
- @classproperty
147
- @classmethod
148
- def REFLEX_BUILD_URL(cls):
149
- """The URL to redirect to reflex.build.
150
-
151
- Returns:
152
- The URL to redirect to reflex.build.
153
- """
154
- from reflex.environment import environment
155
-
156
- return (
157
- environment.REFLEX_BUILD_FRONTEND.get()
158
- + "/gen?reflex_init_token={reflex_init_token}"
159
- )
160
-
161
- @classproperty
162
- @classmethod
163
- def REFLEX_BUILD_POLL_URL(cls):
164
- """The URL to poll waiting for the user to select a generation.
165
-
166
- Returns:
167
- The URL to poll waiting for the user to select a generation.
168
- """
169
- from reflex.environment import environment
170
-
171
- return environment.REFLEX_BUILD_BACKEND.get() + "/api/init/{reflex_init_token}"
172
-
173
- @classproperty
174
- @classmethod
175
- def REFLEX_BUILD_CODE_URL(cls):
176
- """The URL to fetch the generation's reflex code.
177
-
178
- Returns:
179
- The URL to fetch the generation's reflex code.
180
- """
181
- from reflex.environment import environment
182
-
183
- return (
184
- environment.REFLEX_BUILD_BACKEND.get()
185
- + "/api/gen/{generation_hash}/refactored"
186
- )
135
+ REFLEX_BUILD_FRONTEND = "https://build.reflex.dev"
187
136
 
188
137
  class Dirs(SimpleNamespace):
189
138
  """Folders used by the template system of Reflex."""
@@ -204,9 +153,6 @@ class Javascript(SimpleNamespace):
204
153
  # The node modules directory.
205
154
  NODE_MODULES = "node_modules"
206
155
 
207
- # The package lock file.
208
- PACKAGE_LOCK = "package-lock.json"
209
-
210
156
 
211
157
  class ReactRouter(Javascript):
212
158
  """Constants related to React Router."""
@@ -136,14 +136,6 @@ class Hooks(SimpleNamespace):
136
136
  """Common sets of hook declarations."""
137
137
 
138
138
  EVENTS = f"const [{CompileVars.ADD_EVENTS}, {CompileVars.CONNECT_ERROR}] = useContext(EventLoopContext);"
139
- AUTOFOCUS = """
140
- // Set focus to the specified element.
141
- const focusRef = useRef(null)
142
- useEffect(() => {
143
- if (focusRef.current) {
144
- focusRef.current.focus();
145
- }
146
- })"""
147
139
 
148
140
  class HookPosition(enum.Enum):
149
141
  """The position of the hook in the component."""
@@ -75,7 +75,7 @@ fetch-retries=0
75
75
 
76
76
 
77
77
  def _determine_react_router_version() -> str:
78
- default_version = "7.7.0"
78
+ default_version = "7.7.1"
79
79
  if (version := os.getenv("REACT_ROUTER_VERSION")) and version != default_version:
80
80
  from reflex.utils import console
81
81
 
@@ -87,7 +87,7 @@ def _determine_react_router_version() -> str:
87
87
 
88
88
 
89
89
  def _determine_react_version() -> str:
90
- default_version = "19.1.0"
90
+ default_version = "19.1.1"
91
91
  if (version := os.getenv("REACT_VERSION")) and version != default_version:
92
92
  from reflex.utils import console
93
93
 
@@ -131,7 +131,7 @@ class PackageJson(SimpleNamespace):
131
131
  "react": cls._react_version,
132
132
  "react-helmet": "6.1.0",
133
133
  "react-dom": cls._react_version,
134
- "isbot": "5.1.28",
134
+ "isbot": "5.1.29",
135
135
  "socket.io-client": "4.8.1",
136
136
  "universal-cookie": "7.2.2",
137
137
  }
@@ -143,11 +143,11 @@ class PackageJson(SimpleNamespace):
143
143
  "postcss-import": "16.1.1",
144
144
  "@react-router/dev": _react_router_version,
145
145
  "@react-router/fs-routes": _react_router_version,
146
- "rolldown-vite": "7.0.9",
146
+ "vite": "npm:rolldown-vite@7.0.12",
147
147
  }
148
148
  OVERRIDES = {
149
149
  # This should always match the `react` version in DEPENDENCIES for recharts compatibility.
150
150
  "react-is": _react_version,
151
151
  "cookie": "1.0.2",
152
- "rollup": "4.45.1",
152
+ "vite": "npm:rolldown-vite@7.0.12",
153
153
  }
reflex/environment.py CHANGED
@@ -563,16 +563,6 @@ class EnvironmentVariables:
563
563
  # Whether to skip purging the web directory in dev mode.
564
564
  REFLEX_PERSIST_WEB_DIR: EnvVar[bool] = env_var(False)
565
565
 
566
- # The reflex.build frontend host.
567
- REFLEX_BUILD_FRONTEND: EnvVar[str] = env_var(
568
- constants.Templates.REFLEX_BUILD_FRONTEND
569
- )
570
-
571
- # The reflex.build backend host.
572
- REFLEX_BUILD_BACKEND: EnvVar[str] = env_var(
573
- constants.Templates.REFLEX_BUILD_BACKEND
574
- )
575
-
576
566
  # This env var stores the execution mode of the app
577
567
  REFLEX_ENV_MODE: EnvVar[constants.Env] = env_var(constants.Env.DEV)
578
568