reflex 0.8.0a5__py3-none-any.whl → 0.8.0a7__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 (148) hide show
  1. reflex/.templates/jinja/web/pages/_app.js.jinja2 +1 -1
  2. reflex/.templates/web/utils/state.js +78 -31
  3. reflex/__init__.pyi +327 -188
  4. reflex/app.py +17 -7
  5. reflex/compiler/compiler.py +3 -1
  6. reflex/compiler/utils.py +28 -12
  7. reflex/components/__init__.pyi +34 -15
  8. reflex/components/base/__init__.pyi +30 -19
  9. reflex/components/base/app_wrap.pyi +2 -3
  10. reflex/components/base/body.pyi +2 -3
  11. reflex/components/base/document.pyi +7 -13
  12. reflex/components/base/error_boundary.pyi +2 -3
  13. reflex/components/base/fragment.pyi +2 -3
  14. reflex/components/base/link.pyi +3 -5
  15. reflex/components/base/meta.pyi +14 -18
  16. reflex/components/base/script.pyi +2 -3
  17. reflex/components/base/strict_mode.pyi +2 -3
  18. reflex/components/core/__init__.pyi +77 -38
  19. reflex/components/core/auto_scroll.pyi +2 -3
  20. reflex/components/core/banner.pyi +8 -14
  21. reflex/components/core/client_side_routing.pyi +2 -3
  22. reflex/components/core/clipboard.pyi +2 -3
  23. reflex/components/core/debounce.pyi +2 -3
  24. reflex/components/core/helmet.pyi +2 -3
  25. reflex/components/core/html.pyi +2 -3
  26. reflex/components/core/sticky.pyi +4 -7
  27. reflex/components/core/upload.pyi +5 -9
  28. reflex/components/datadisplay/__init__.pyi +13 -7
  29. reflex/components/datadisplay/code.pyi +2 -3
  30. reflex/components/datadisplay/dataeditor.pyi +33 -11
  31. reflex/components/datadisplay/shiki_code_block.pyi +3 -5
  32. reflex/components/el/__init__.pyi +506 -246
  33. reflex/components/el/element.pyi +2 -3
  34. reflex/components/el/elements/__init__.pyi +504 -245
  35. reflex/components/el/elements/base.pyi +2 -3
  36. reflex/components/el/elements/forms.pyi +77 -49
  37. reflex/components/el/elements/inline.pyi +29 -57
  38. reflex/components/el/elements/media.pyi +26 -51
  39. reflex/components/el/elements/metadata.pyi +7 -13
  40. reflex/components/el/elements/other.pyi +8 -15
  41. reflex/components/el/elements/scripts.pyi +4 -7
  42. reflex/components/el/elements/sectioning.pyi +16 -31
  43. reflex/components/el/elements/tables.pyi +11 -21
  44. reflex/components/el/elements/typography.pyi +16 -31
  45. reflex/components/gridjs/datatable.pyi +3 -5
  46. reflex/components/lucide/icon.pyi +4 -7
  47. reflex/components/markdown/markdown.pyi +2 -3
  48. reflex/components/moment/moment.py +1 -1
  49. reflex/components/moment/moment.pyi +2 -3
  50. reflex/components/plotly/plotly.pyi +31 -39
  51. reflex/components/radix/__init__.pyi +123 -65
  52. reflex/components/radix/primitives/__init__.pyi +6 -4
  53. reflex/components/radix/primitives/accordion.pyi +8 -15
  54. reflex/components/radix/primitives/base.pyi +3 -5
  55. reflex/components/radix/primitives/drawer.pyi +11 -21
  56. reflex/components/radix/primitives/form.pyi +22 -22
  57. reflex/components/radix/primitives/progress.pyi +5 -9
  58. reflex/components/radix/primitives/slider.pyi +6 -11
  59. reflex/components/radix/themes/__init__.pyi +5 -6
  60. reflex/components/radix/themes/base.pyi +9 -17
  61. reflex/components/radix/themes/color_mode.pyi +4 -7
  62. reflex/components/radix/themes/components/__init__.pyi +75 -38
  63. reflex/components/radix/themes/components/alert_dialog.pyi +8 -15
  64. reflex/components/radix/themes/components/aspect_ratio.pyi +2 -3
  65. reflex/components/radix/themes/components/avatar.pyi +2 -3
  66. reflex/components/radix/themes/components/badge.pyi +2 -3
  67. reflex/components/radix/themes/components/button.pyi +2 -3
  68. reflex/components/radix/themes/components/callout.pyi +5 -9
  69. reflex/components/radix/themes/components/card.pyi +2 -3
  70. reflex/components/radix/themes/components/checkbox.pyi +3 -5
  71. reflex/components/radix/themes/components/checkbox_cards.pyi +3 -5
  72. reflex/components/radix/themes/components/checkbox_group.pyi +3 -5
  73. reflex/components/radix/themes/components/context_menu.pyi +14 -27
  74. reflex/components/radix/themes/components/data_list.pyi +5 -9
  75. reflex/components/radix/themes/components/dialog.pyi +7 -13
  76. reflex/components/radix/themes/components/dropdown_menu.pyi +9 -17
  77. reflex/components/radix/themes/components/hover_card.pyi +4 -7
  78. reflex/components/radix/themes/components/icon_button.pyi +2 -3
  79. reflex/components/radix/themes/components/inset.pyi +2 -3
  80. reflex/components/radix/themes/components/popover.pyi +5 -9
  81. reflex/components/radix/themes/components/progress.pyi +2 -3
  82. reflex/components/radix/themes/components/radio.pyi +2 -3
  83. reflex/components/radix/themes/components/radio_cards.pyi +3 -5
  84. reflex/components/radix/themes/components/radio_group.pyi +4 -7
  85. reflex/components/radix/themes/components/scroll_area.pyi +2 -3
  86. reflex/components/radix/themes/components/segmented_control.pyi +3 -5
  87. reflex/components/radix/themes/components/select.pyi +9 -17
  88. reflex/components/radix/themes/components/separator.pyi +2 -3
  89. reflex/components/radix/themes/components/skeleton.pyi +2 -3
  90. reflex/components/radix/themes/components/slider.pyi +12 -5
  91. reflex/components/radix/themes/components/spinner.pyi +2 -3
  92. reflex/components/radix/themes/components/switch.pyi +2 -3
  93. reflex/components/radix/themes/components/table.pyi +8 -15
  94. reflex/components/radix/themes/components/tabs.pyi +5 -9
  95. reflex/components/radix/themes/components/text_area.pyi +10 -5
  96. reflex/components/radix/themes/components/text_field.pyi +19 -9
  97. reflex/components/radix/themes/components/tooltip.pyi +2 -3
  98. reflex/components/radix/themes/layout/__init__.pyi +27 -14
  99. reflex/components/radix/themes/layout/base.pyi +2 -3
  100. reflex/components/radix/themes/layout/box.pyi +2 -3
  101. reflex/components/radix/themes/layout/center.pyi +2 -3
  102. reflex/components/radix/themes/layout/container.pyi +2 -3
  103. reflex/components/radix/themes/layout/flex.pyi +2 -3
  104. reflex/components/radix/themes/layout/grid.pyi +2 -3
  105. reflex/components/radix/themes/layout/list.pyi +5 -9
  106. reflex/components/radix/themes/layout/section.pyi +2 -3
  107. reflex/components/radix/themes/layout/spacer.pyi +2 -3
  108. reflex/components/radix/themes/layout/stack.pyi +4 -7
  109. reflex/components/radix/themes/typography/__init__.pyi +7 -5
  110. reflex/components/radix/themes/typography/blockquote.pyi +2 -3
  111. reflex/components/radix/themes/typography/code.pyi +2 -3
  112. reflex/components/radix/themes/typography/heading.pyi +2 -3
  113. reflex/components/radix/themes/typography/link.pyi +3 -5
  114. reflex/components/radix/themes/typography/text.pyi +7 -13
  115. reflex/components/react_player/audio.pyi +5 -4
  116. reflex/components/react_player/react_player.pyi +2 -3
  117. reflex/components/react_player/video.pyi +5 -4
  118. reflex/components/recharts/__init__.pyi +208 -100
  119. reflex/components/recharts/cartesian.py +0 -6
  120. reflex/components/recharts/cartesian.pyi +25 -48
  121. reflex/components/recharts/charts.pyi +13 -25
  122. reflex/components/recharts/general.pyi +7 -13
  123. reflex/components/recharts/polar.pyi +7 -13
  124. reflex/components/recharts/recharts.py +2 -2
  125. reflex/components/recharts/recharts.pyi +3 -5
  126. reflex/components/sonner/toast.py +1 -1
  127. reflex/components/sonner/toast.pyi +2 -3
  128. reflex/config.py +7 -36
  129. reflex/constants/installer.py +7 -8
  130. reflex/environment.py +70 -0
  131. reflex/istate/__init__.py +69 -0
  132. reflex/istate/manager.py +1 -0
  133. reflex/plugins/shared_tailwind.py +58 -1
  134. reflex/plugins/tailwind_v3.py +4 -4
  135. reflex/plugins/tailwind_v4.py +6 -5
  136. reflex/state.py +17 -12
  137. reflex/testing.py +2 -1
  138. reflex/utils/exec.py +16 -6
  139. reflex/utils/imports.py +5 -12
  140. reflex/utils/misc.py +1 -2
  141. reflex/utils/prerequisites.py +1 -1
  142. reflex/utils/processes.py +14 -39
  143. reflex/utils/telemetry.py +0 -15
  144. {reflex-0.8.0a5.dist-info → reflex-0.8.0a7.dist-info}/METADATA +3 -3
  145. {reflex-0.8.0a5.dist-info → reflex-0.8.0a7.dist-info}/RECORD +148 -148
  146. {reflex-0.8.0a5.dist-info → reflex-0.8.0a7.dist-info}/WHEEL +0 -0
  147. {reflex-0.8.0a5.dist-info → reflex-0.8.0a7.dist-info}/entry_points.txt +0 -0
  148. {reflex-0.8.0a5.dist-info → reflex-0.8.0a7.dist-info}/licenses/LICENSE +0 -0
@@ -4,7 +4,7 @@
4
4
  # This file was generated by `reflex/utils/pyi_generator.py`!
5
5
  # ------------------------------------------------------
6
6
  from collections.abc import Mapping, Sequence
7
- from typing import Any, Literal, overload
7
+ from typing import Any, Literal
8
8
 
9
9
  from reflex.components.core.breakpoints import Breakpoints
10
10
  from reflex.constants.colors import Color
@@ -14,9 +14,8 @@ from reflex.vars.base import Var
14
14
  from .recharts import RechartsCharts
15
15
 
16
16
  class ChartBase(RechartsCharts):
17
- @overload
18
17
  @classmethod
19
- def create( # type: ignore
18
+ def create(
20
19
  cls,
21
20
  *children,
22
21
  width: Var[int | str] | int | str | None = None,
@@ -74,9 +73,8 @@ class ChartBase(RechartsCharts):
74
73
  """
75
74
 
76
75
  class CategoricalChartBase(ChartBase):
77
- @overload
78
76
  @classmethod
79
- def create( # type: ignore
77
+ def create(
80
78
  cls,
81
79
  *children,
82
80
  data: Sequence[dict[str, Any]] | Var[Sequence[dict[str, Any]]] | None = None,
@@ -152,9 +150,8 @@ class CategoricalChartBase(ChartBase):
152
150
  """
153
151
 
154
152
  class AreaChart(CategoricalChartBase):
155
- @overload
156
153
  @classmethod
157
- def create( # type: ignore
154
+ def create(
158
155
  cls,
159
156
  *children,
160
157
  base_value: Literal["auto", "dataMax", "dataMin"]
@@ -235,9 +232,8 @@ class AreaChart(CategoricalChartBase):
235
232
  """
236
233
 
237
234
  class BarChart(CategoricalChartBase):
238
- @overload
239
235
  @classmethod
240
- def create( # type: ignore
236
+ def create(
241
237
  cls,
242
238
  *children,
243
239
  bar_category_gap: Var[int | str] | int | str | None = None,
@@ -323,9 +319,8 @@ class BarChart(CategoricalChartBase):
323
319
  """
324
320
 
325
321
  class LineChart(CategoricalChartBase):
326
- @overload
327
322
  @classmethod
328
- def create( # type: ignore
323
+ def create(
329
324
  cls,
330
325
  *children,
331
326
  data: Sequence[dict[str, Any]] | Var[Sequence[dict[str, Any]]] | None = None,
@@ -401,9 +396,8 @@ class LineChart(CategoricalChartBase):
401
396
  """
402
397
 
403
398
  class ComposedChart(CategoricalChartBase):
404
- @overload
405
399
  @classmethod
406
- def create( # type: ignore
400
+ def create(
407
401
  cls,
408
402
  *children,
409
403
  base_value: Literal["auto", "dataMax", "dataMin"]
@@ -492,9 +486,8 @@ class ComposedChart(CategoricalChartBase):
492
486
  """
493
487
 
494
488
  class PieChart(ChartBase):
495
- @overload
496
489
  @classmethod
497
- def create( # type: ignore
490
+ def create(
498
491
  cls,
499
492
  *children,
500
493
  margin: Var[dict[str, Any]] | dict[str, Any] | None = None,
@@ -560,9 +553,8 @@ class PieChart(ChartBase):
560
553
  class RadarChart(ChartBase):
561
554
  @classmethod
562
555
  def get_event_triggers(cls) -> dict[str, Var | Any]: ...
563
- @overload
564
556
  @classmethod
565
- def create( # type: ignore
557
+ def create(
566
558
  cls,
567
559
  *children,
568
560
  data: Sequence[dict[str, Any]] | Var[Sequence[dict[str, Any]]] | None = None,
@@ -622,9 +614,8 @@ class RadarChart(ChartBase):
622
614
  """
623
615
 
624
616
  class RadialBarChart(ChartBase):
625
- @overload
626
617
  @classmethod
627
- def create( # type: ignore
618
+ def create(
628
619
  cls,
629
620
  *children,
630
621
  data: Sequence[dict[str, Any]] | Var[Sequence[dict[str, Any]]] | None = None,
@@ -706,9 +697,8 @@ class RadialBarChart(ChartBase):
706
697
  class ScatterChart(ChartBase):
707
698
  @classmethod
708
699
  def get_event_triggers(cls) -> dict[str, Var | Any]: ...
709
- @overload
710
700
  @classmethod
711
- def create( # type: ignore
701
+ def create(
712
702
  cls,
713
703
  *children,
714
704
  margin: Var[dict[str, Any]] | dict[str, Any] | None = None,
@@ -760,9 +750,8 @@ class ScatterChart(ChartBase):
760
750
  """
761
751
 
762
752
  class FunnelChart(ChartBase):
763
- @overload
764
753
  @classmethod
765
- def create( # type: ignore
754
+ def create(
766
755
  cls,
767
756
  *children,
768
757
  layout: Var[str] | str | None = None,
@@ -826,9 +815,8 @@ class FunnelChart(ChartBase):
826
815
  """
827
816
 
828
817
  class Treemap(RechartsCharts):
829
- @overload
830
818
  @classmethod
831
- def create( # type: ignore
819
+ def create(
832
820
  cls,
833
821
  *children,
834
822
  width: Var[int | str] | int | str | None = None,
@@ -4,7 +4,7 @@
4
4
  # This file was generated by `reflex/utils/pyi_generator.py`!
5
5
  # ------------------------------------------------------
6
6
  from collections.abc import Mapping, Sequence
7
- from typing import Any, Literal, overload
7
+ from typing import Any, Literal
8
8
 
9
9
  from reflex.components.component import MemoizationLeaf
10
10
  from reflex.components.core.breakpoints import Breakpoints
@@ -15,9 +15,8 @@ from reflex.vars.base import Var
15
15
  from .recharts import Recharts
16
16
 
17
17
  class ResponsiveContainer(Recharts, MemoizationLeaf):
18
- @overload
19
18
  @classmethod
20
- def create( # type: ignore
19
+ def create(
21
20
  cls,
22
21
  *children,
23
22
  aspect: Var[int] | int | None = None,
@@ -81,9 +80,8 @@ class ResponsiveContainer(Recharts, MemoizationLeaf):
81
80
  """
82
81
 
83
82
  class Legend(Recharts):
84
- @overload
85
83
  @classmethod
86
- def create( # type: ignore
84
+ def create(
87
85
  cls,
88
86
  *children,
89
87
  width: Var[int] | int | None = None,
@@ -195,9 +193,8 @@ class Legend(Recharts):
195
193
  """
196
194
 
197
195
  class GraphingTooltip(Recharts):
198
- @overload
199
196
  @classmethod
200
- def create( # type: ignore
197
+ def create(
201
198
  cls,
202
199
  *children,
203
200
  separator: Var[str] | str | None = None,
@@ -283,9 +280,8 @@ class GraphingTooltip(Recharts):
283
280
  """
284
281
 
285
282
  class Label(Recharts):
286
- @overload
287
283
  @classmethod
288
- def create( # type: ignore
284
+ def create(
289
285
  cls,
290
286
  *children,
291
287
  view_box: Var[dict[str, Any]] | dict[str, Any] | None = None,
@@ -385,9 +381,8 @@ class Label(Recharts):
385
381
  """
386
382
 
387
383
  class LabelList(Recharts):
388
- @overload
389
384
  @classmethod
390
- def create( # type: ignore
385
+ def create(
391
386
  cls,
392
387
  *children,
393
388
  data_key: Var[int | str] | int | str | None = None,
@@ -489,9 +484,8 @@ class LabelList(Recharts):
489
484
  """
490
485
 
491
486
  class Cell(Recharts):
492
- @overload
493
487
  @classmethod
494
- def create( # type: ignore
488
+ def create(
495
489
  cls,
496
490
  *children,
497
491
  fill: Color | Var[Color | str] | str | None = None,
@@ -4,7 +4,7 @@
4
4
  # This file was generated by `reflex/utils/pyi_generator.py`!
5
5
  # ------------------------------------------------------
6
6
  from collections.abc import Mapping, Sequence
7
- from typing import Any, Literal, overload
7
+ from typing import Any, Literal
8
8
 
9
9
  from reflex.components.core.breakpoints import Breakpoints
10
10
  from reflex.constants.colors import Color
@@ -16,9 +16,8 @@ from .recharts import Recharts
16
16
  class Pie(Recharts):
17
17
  @classmethod
18
18
  def get_event_triggers(cls) -> dict[str, Var | Any]: ...
19
- @overload
20
19
  @classmethod
21
- def create( # type: ignore
20
+ def create(
22
21
  cls,
23
22
  *children,
24
23
  data: Sequence[dict[str, Any]] | Var[Sequence[dict[str, Any]]] | None = None,
@@ -136,9 +135,8 @@ class Pie(Recharts):
136
135
  class Radar(Recharts):
137
136
  @classmethod
138
137
  def get_event_triggers(cls) -> dict[str, Var | Any]: ...
139
- @overload
140
138
  @classmethod
141
- def create( # type: ignore
139
+ def create(
142
140
  cls,
143
141
  *children,
144
142
  data_key: Var[int | str] | int | str | None = None,
@@ -232,9 +230,8 @@ class Radar(Recharts):
232
230
  class RadialBar(Recharts):
233
231
  @classmethod
234
232
  def get_event_triggers(cls) -> dict[str, Var | Any]: ...
235
- @overload
236
233
  @classmethod
237
- def create( # type: ignore
234
+ def create(
238
235
  cls,
239
236
  *children,
240
237
  data: Sequence[dict[str, Any]] | Var[Sequence[dict[str, Any]]] | None = None,
@@ -328,9 +325,8 @@ class RadialBar(Recharts):
328
325
  """
329
326
 
330
327
  class PolarAngleAxis(Recharts):
331
- @overload
332
328
  @classmethod
333
- def create( # type: ignore
329
+ def create(
334
330
  cls,
335
331
  *children,
336
332
  data_key: Var[int | str] | int | str | None = None,
@@ -414,9 +410,8 @@ class PolarAngleAxis(Recharts):
414
410
  """
415
411
 
416
412
  class PolarGrid(Recharts):
417
- @overload
418
413
  @classmethod
419
- def create( # type: ignore
414
+ def create(
420
415
  cls,
421
416
  *children,
422
417
  cx: Var[int] | int | None = None,
@@ -486,9 +481,8 @@ class PolarGrid(Recharts):
486
481
  class PolarRadiusAxis(Recharts):
487
482
  @classmethod
488
483
  def get_event_triggers(cls) -> dict[str, Var | Any]: ...
489
- @overload
490
484
  @classmethod
491
- def create( # type: ignore
485
+ def create(
492
486
  cls,
493
487
  *children,
494
488
  angle: Var[int] | int | None = None,
@@ -8,7 +8,7 @@ from reflex.components.component import Component, MemoizationLeaf, NoSSRCompone
8
8
  class Recharts(Component):
9
9
  """A component that wraps a recharts lib."""
10
10
 
11
- library = "recharts@2.15.3"
11
+ library = "recharts@3.0.0"
12
12
 
13
13
  def _get_style(self) -> dict:
14
14
  return {"wrapperStyle": self.style}
@@ -17,7 +17,7 @@ class Recharts(Component):
17
17
  class RechartsCharts(NoSSRComponent, MemoizationLeaf):
18
18
  """A component that wraps a recharts lib."""
19
19
 
20
- library = "recharts@2.15.3"
20
+ library = "recharts@3.0.0"
21
21
 
22
22
 
23
23
  LiteralAnimationEasing = Literal["ease", "ease-in", "ease-out", "ease-in-out", "linear"]
@@ -4,7 +4,7 @@
4
4
  # This file was generated by `reflex/utils/pyi_generator.py`!
5
5
  # ------------------------------------------------------
6
6
  from collections.abc import Mapping, Sequence
7
- from typing import Any, Literal, overload
7
+ from typing import Any, Literal
8
8
 
9
9
  from reflex.components.component import Component, MemoizationLeaf, NoSSRComponent
10
10
  from reflex.components.core.breakpoints import Breakpoints
@@ -12,9 +12,8 @@ from reflex.event import EventType, PointerEventInfo
12
12
  from reflex.vars.base import Var
13
13
 
14
14
  class Recharts(Component):
15
- @overload
16
15
  @classmethod
17
- def create( # type: ignore
16
+ def create(
18
17
  cls,
19
18
  *children,
20
19
  style: Sequence[Mapping[str, Any]]
@@ -64,9 +63,8 @@ class Recharts(Component):
64
63
  """
65
64
 
66
65
  class RechartsCharts(NoSSRComponent, MemoizationLeaf):
67
- @overload
68
66
  @classmethod
69
- def create( # type: ignore
67
+ def create(
70
68
  cls,
71
69
  *children,
72
70
  style: Sequence[Mapping[str, Any]]
@@ -171,7 +171,7 @@ class ToastProps(NoExtrasAllowedProps):
171
171
  class Toaster(Component):
172
172
  """A Toaster Component for displaying toast notifications."""
173
173
 
174
- library: str | None = "sonner@2.0.3"
174
+ library: str | None = "sonner@2.0.5"
175
175
 
176
176
  tag = "Toaster"
177
177
 
@@ -4,7 +4,7 @@
4
4
  # This file was generated by `reflex/utils/pyi_generator.py`!
5
5
  # ------------------------------------------------------
6
6
  from collections.abc import Mapping, Sequence
7
- from typing import Any, Literal, overload
7
+ from typing import Any, Literal
8
8
 
9
9
  from reflex.base import Base
10
10
  from reflex.components.component import Component, ComponentNamespace
@@ -82,9 +82,8 @@ class Toaster(Component):
82
82
  def toast_loading(message: str | Var = "", **kwargs: Any): ...
83
83
  @staticmethod
84
84
  def toast_dismiss(id: Var | str | None = None): ...
85
- @overload
86
85
  @classmethod
87
- def create( # type: ignore
86
+ def create(
88
87
  cls,
89
88
  *children,
90
89
  theme: Var[str] | str | None = None,
reflex/config.py CHANGED
@@ -19,7 +19,12 @@ from reflex.base import Base
19
19
  from reflex.constants.base import LogLevel
20
20
  from reflex.environment import EnvironmentVariables as EnvironmentVariables
21
21
  from reflex.environment import EnvVar as EnvVar
22
- from reflex.environment import ExistingPath, interpret_env_var_value
22
+ from reflex.environment import (
23
+ ExistingPath,
24
+ _load_dotenv_from_files,
25
+ _paths_from_env_files,
26
+ interpret_env_var_value,
27
+ )
23
28
  from reflex.environment import env_var as env_var
24
29
  from reflex.environment import environment as environment
25
30
  from reflex.plugins import Plugin
@@ -27,40 +32,6 @@ from reflex.utils import console
27
32
  from reflex.utils.exceptions import ConfigError
28
33
  from reflex.utils.types import true_type_for_pydantic_field
29
34
 
30
- try:
31
- from dotenv import load_dotenv
32
- except ImportError:
33
- load_dotenv = None
34
-
35
-
36
- def _load_dotenv_from_str(env_files: str) -> None:
37
- if not env_files:
38
- return
39
-
40
- if load_dotenv is None:
41
- console.error(
42
- """The `python-dotenv` package is required to load environment variables from a file. Run `pip install "python-dotenv>=1.1.0"`."""
43
- )
44
- return
45
-
46
- # load env files in reverse order if they exist
47
- for env_file_path in [
48
- Path(p) for s in reversed(env_files.split(os.pathsep)) if (p := s.strip())
49
- ]:
50
- if env_file_path.exists():
51
- load_dotenv(env_file_path, override=True)
52
-
53
-
54
- def _load_dotenv_from_env():
55
- """Load environment variables from paths specified in REFLEX_ENV_FILE."""
56
- env_env_file = os.environ.get("REFLEX_ENV_FILE")
57
- if env_env_file:
58
- _load_dotenv_from_str(env_env_file)
59
-
60
-
61
- # Load the env files at import time if they are set in the ENV_FILE environment variable.
62
- _load_dotenv_from_env()
63
-
64
35
 
65
36
  class DBConfig(Base):
66
37
  """Database config."""
@@ -358,7 +329,7 @@ class Config(Base):
358
329
  The updated config values.
359
330
  """
360
331
  if self.env_file:
361
- _load_dotenv_from_str(self.env_file)
332
+ _load_dotenv_from_files(_paths_from_env_files(self.env_file))
362
333
 
363
334
  updated_values = {}
364
335
  # Iterate over the fields.
@@ -14,10 +14,10 @@ class Bun(SimpleNamespace):
14
14
  """Bun constants."""
15
15
 
16
16
  # The Bun version.
17
- VERSION = "1.2.16"
17
+ VERSION = "1.2.17"
18
18
 
19
19
  # Min Bun Version
20
- MIN_VERSION = "1.2.8"
20
+ MIN_VERSION = "1.2.17"
21
21
 
22
22
  # URL to bun install script.
23
23
  INSTALL_URL = "https://raw.githubusercontent.com/reflex-dev/reflex/main/scripts/bun_install.sh"
@@ -63,7 +63,7 @@ class Node(SimpleNamespace):
63
63
  """Node/ NPM constants."""
64
64
 
65
65
  # The minimum required node version.
66
- MIN_VERSION = "20.0.0"
66
+ MIN_VERSION = "20.19.0"
67
67
 
68
68
  # Path of the node config file.
69
69
  CONFIG_PATH = ".npmrc"
@@ -123,7 +123,6 @@ class PackageJson(SimpleNamespace):
123
123
  A dictionary of dependencies with their versions.
124
124
  """
125
125
  return {
126
- "axios": "1.9.0",
127
126
  "json5": "2.2.3",
128
127
  "react-router": cls._react_router_version,
129
128
  "react-router-dom": cls._react_router_version,
@@ -132,7 +131,7 @@ class PackageJson(SimpleNamespace):
132
131
  "react": cls._react_version,
133
132
  "react-helmet": "6.1.0",
134
133
  "react-dom": cls._react_version,
135
- "isbot": "5.1.26",
134
+ "isbot": "5.1.28",
136
135
  "socket.io-client": "4.8.1",
137
136
  "universal-cookie": "7.2.2",
138
137
  }
@@ -140,11 +139,11 @@ class PackageJson(SimpleNamespace):
140
139
  DEV_DEPENDENCIES = {
141
140
  "@emotion/react": "11.14.0",
142
141
  "autoprefixer": "10.4.21",
143
- "postcss": "8.5.4",
144
- "postcss-import": "16.1.0",
142
+ "postcss": "8.5.6",
143
+ "postcss-import": "16.1.1",
145
144
  "@react-router/dev": _react_router_version,
146
145
  "@react-router/fs-routes": _react_router_version,
147
- "rolldown-vite": "6.3.19",
146
+ "rolldown-vite": "7.0.1",
148
147
  }
149
148
  OVERRIDES = {
150
149
  # This should always match the `react` version in DEPENDENCIES for recharts compatibility.
reflex/environment.py CHANGED
@@ -606,3 +606,73 @@ class EnvironmentVariables:
606
606
 
607
607
 
608
608
  environment = EnvironmentVariables()
609
+
610
+ try:
611
+ from dotenv import load_dotenv
612
+ except ImportError:
613
+ load_dotenv = None
614
+
615
+
616
+ def _paths_from_env_files(env_files: str) -> list[Path]:
617
+ """Convert a string of paths separated by os.pathsep into a list of Path objects.
618
+
619
+ Args:
620
+ env_files: The string of paths.
621
+
622
+ Returns:
623
+ A list of Path objects.
624
+ """
625
+ # load env files in reverse order
626
+ return list(
627
+ reversed(
628
+ [
629
+ Path(path)
630
+ for path_element in env_files.split(os.pathsep)
631
+ if (path := path_element.strip())
632
+ ]
633
+ )
634
+ )
635
+
636
+
637
+ def _load_dotenv_from_files(files: list[Path]):
638
+ """Load environment variables from a list of files.
639
+
640
+ Args:
641
+ files: A list of Path objects representing the environment variable files.
642
+ """
643
+ from reflex.utils import console
644
+
645
+ if not files:
646
+ return
647
+
648
+ if load_dotenv is None:
649
+ console.error(
650
+ """The `python-dotenv` package is required to load environment variables from a file. Run `pip install "python-dotenv>=1.1.0"`."""
651
+ )
652
+ return
653
+
654
+ for env_file in files:
655
+ if env_file.exists():
656
+ load_dotenv(env_file, override=True)
657
+
658
+
659
+ def _paths_from_environment() -> list[Path]:
660
+ """Get the paths from the REFLEX_ENV_FILE environment variable.
661
+
662
+ Returns:
663
+ A list of Path objects.
664
+ """
665
+ env_files = os.environ.get("REFLEX_ENV_FILE")
666
+ if not env_files:
667
+ return []
668
+
669
+ return _paths_from_env_files(env_files)
670
+
671
+
672
+ def _load_dotenv_from_env():
673
+ """Load environment variables from paths specified in REFLEX_ENV_FILE."""
674
+ _load_dotenv_from_files(_paths_from_environment())
675
+
676
+
677
+ # Load the env files at import time if they are set in the ENV_FILE environment variable.
678
+ _load_dotenv_from_env()
reflex/istate/__init__.py CHANGED
@@ -1 +1,70 @@
1
1
  """This module will provide interfaces for the state."""
2
+
3
+ import pickle
4
+ import sys
5
+ from collections.abc import Callable
6
+ from typing import Any
7
+
8
+ # Errors caught during pickling of state
9
+ HANDLED_PICKLE_ERRORS = (
10
+ pickle.PicklingError,
11
+ AttributeError,
12
+ IndexError,
13
+ TypeError,
14
+ ValueError,
15
+ )
16
+
17
+
18
+ def _is_picklable(obj: Any, dumps: Callable[[object], bytes]) -> bool:
19
+ try:
20
+ dumps(obj)
21
+ except Exception:
22
+ return False
23
+ else:
24
+ return True
25
+
26
+
27
+ def debug_failed_pickles(obj: object, dumps: Callable[[object], bytes]):
28
+ """Recursively check the picklability of an object and its contents.
29
+
30
+ Args:
31
+ obj: The object to check.
32
+ dumps: The pickle dump function to use.
33
+
34
+ Raises:
35
+ HANDLED_PICKLE_ERRORS: If the object or any of its contents are not picklable.
36
+ """
37
+ if _is_picklable(obj, dumps):
38
+ return
39
+ if sys.version_info < (3, 11):
40
+ return
41
+ if isinstance(obj, dict):
42
+ for k, v in obj.items():
43
+ try:
44
+ debug_failed_pickles(v, dumps)
45
+ except HANDLED_PICKLE_ERRORS as e:
46
+ e.add_note(f"While pickling dict value for key {k!r}")
47
+ raise
48
+ try:
49
+ debug_failed_pickles(k, dumps)
50
+ except HANDLED_PICKLE_ERRORS as e:
51
+ e.add_note(f"While pickling dict key {k!r}")
52
+ raise
53
+ return
54
+ if isinstance(obj, (list, tuple)):
55
+ for i, v in enumerate(obj):
56
+ try:
57
+ debug_failed_pickles(v, dumps)
58
+ except HANDLED_PICKLE_ERRORS as e: # noqa: PERF203
59
+ e.add_note(f"While pickling index {i} of {type(obj).__name__}")
60
+ raise
61
+ return
62
+ picklable_thing = obj.__getstate__()
63
+ if picklable_thing is not None:
64
+ debug_failed_pickles(picklable_thing, dumps)
65
+ else:
66
+ try:
67
+ dumps(obj)
68
+ except HANDLED_PICKLE_ERRORS as e:
69
+ e.add_note(f"While pickling object of type {type(obj).__name__}")
70
+ raise
reflex/istate/manager.py CHANGED
@@ -179,6 +179,7 @@ def _default_token_expiration() -> int:
179
179
 
180
180
  def reset_disk_state_manager():
181
181
  """Reset the disk state manager."""
182
+ console.debug("Resetting disk state manager.")
182
183
  states_directory = prerequisites.get_states_dir()
183
184
  if states_directory.exists():
184
185
  for path in states_directory.iterdir():