reflex 0.4.7a3__py3-none-any.whl → 0.4.8a1__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 (124) hide show
  1. reflex/.templates/web/utils/state.js +7 -1
  2. reflex/app.py +15 -1
  3. reflex/compiler/utils.py +1 -1
  4. reflex/components/base/body.pyi +0 -3
  5. reflex/components/base/document.pyi +0 -15
  6. reflex/components/base/fragment.pyi +0 -3
  7. reflex/components/base/head.pyi +0 -3
  8. reflex/components/base/link.pyi +0 -6
  9. reflex/components/base/meta.pyi +0 -12
  10. reflex/components/chakra/base.pyi +0 -6
  11. reflex/components/chakra/datadisplay/badge.pyi +0 -3
  12. reflex/components/chakra/datadisplay/code.pyi +0 -3
  13. reflex/components/chakra/datadisplay/divider.pyi +0 -3
  14. reflex/components/chakra/datadisplay/keyboard_key.pyi +0 -3
  15. reflex/components/chakra/datadisplay/list.pyi +0 -3
  16. reflex/components/chakra/datadisplay/stat.pyi +0 -15
  17. reflex/components/chakra/datadisplay/table.pyi +0 -12
  18. reflex/components/chakra/datadisplay/tag.pyi +0 -12
  19. reflex/components/chakra/disclosure/accordion.pyi +0 -12
  20. reflex/components/chakra/disclosure/tabs.pyi +0 -12
  21. reflex/components/chakra/disclosure/transition.pyi +0 -18
  22. reflex/components/chakra/disclosure/visuallyhidden.pyi +0 -3
  23. reflex/components/chakra/feedback/alert.pyi +0 -9
  24. reflex/components/chakra/feedback/circularprogress.pyi +0 -3
  25. reflex/components/chakra/feedback/progress.pyi +0 -3
  26. reflex/components/chakra/feedback/skeleton.pyi +0 -9
  27. reflex/components/chakra/feedback/spinner.pyi +0 -3
  28. reflex/components/chakra/forms/button.pyi +0 -6
  29. reflex/components/chakra/forms/checkbox.pyi +0 -6
  30. reflex/components/chakra/forms/colormodeswitch.pyi +0 -3
  31. reflex/components/chakra/forms/editable.pyi +0 -12
  32. reflex/components/chakra/forms/form.pyi +0 -9
  33. reflex/components/chakra/forms/iconbutton.pyi +0 -3
  34. reflex/components/chakra/forms/input.pyi +0 -15
  35. reflex/components/chakra/forms/numberinput.pyi +0 -12
  36. reflex/components/chakra/forms/pininput.py +1 -1
  37. reflex/components/chakra/forms/pininput.pyi +1 -4
  38. reflex/components/chakra/forms/radio.py +1 -1
  39. reflex/components/chakra/forms/radio.pyi +1 -1
  40. reflex/components/chakra/forms/rangeslider.py +1 -1
  41. reflex/components/chakra/forms/rangeslider.pyi +1 -10
  42. reflex/components/chakra/forms/slider.pyi +0 -12
  43. reflex/components/chakra/forms/switch.pyi +0 -3
  44. reflex/components/chakra/layout/aspect_ratio.pyi +0 -3
  45. reflex/components/chakra/layout/box.pyi +0 -3
  46. reflex/components/chakra/layout/card.pyi +0 -9
  47. reflex/components/chakra/layout/center.pyi +0 -9
  48. reflex/components/chakra/layout/container.pyi +0 -3
  49. reflex/components/chakra/layout/flex.pyi +0 -3
  50. reflex/components/chakra/layout/grid.pyi +0 -9
  51. reflex/components/chakra/layout/spacer.pyi +0 -3
  52. reflex/components/chakra/layout/stack.pyi +0 -9
  53. reflex/components/chakra/layout/wrap.pyi +0 -3
  54. reflex/components/chakra/media/avatar.pyi +0 -9
  55. reflex/components/chakra/media/icon.pyi +0 -3
  56. reflex/components/chakra/navigation/breadcrumb.pyi +0 -3
  57. reflex/components/chakra/navigation/linkoverlay.pyi +0 -6
  58. reflex/components/chakra/navigation/stepper.pyi +0 -24
  59. reflex/components/chakra/overlay/alertdialog.pyi +0 -18
  60. reflex/components/chakra/overlay/drawer.pyi +0 -18
  61. reflex/components/chakra/overlay/menu.pyi +0 -18
  62. reflex/components/chakra/overlay/modal.pyi +0 -18
  63. reflex/components/chakra/overlay/popover.pyi +0 -24
  64. reflex/components/chakra/overlay/tooltip.pyi +0 -3
  65. reflex/components/chakra/typography/heading.pyi +0 -3
  66. reflex/components/chakra/typography/highlight.pyi +0 -3
  67. reflex/components/chakra/typography/span.pyi +0 -3
  68. reflex/components/chakra/typography/text.pyi +0 -3
  69. reflex/components/component.py +61 -22
  70. reflex/components/core/client_side_routing.pyi +0 -6
  71. reflex/components/core/upload.py +3 -1
  72. reflex/components/core/upload.pyi +0 -3
  73. reflex/components/el/element.pyi +0 -3
  74. reflex/components/el/elements/base.pyi +0 -3
  75. reflex/components/el/elements/forms.pyi +0 -39
  76. reflex/components/el/elements/inline.pyi +0 -84
  77. reflex/components/el/elements/media.pyi +0 -42
  78. reflex/components/el/elements/metadata.pyi +0 -15
  79. reflex/components/el/elements/other.pyi +0 -21
  80. reflex/components/el/elements/scripts.pyi +0 -9
  81. reflex/components/el/elements/sectioning.pyi +0 -45
  82. reflex/components/el/elements/tables.pyi +0 -30
  83. reflex/components/el/elements/typography.pyi +0 -45
  84. reflex/components/gridjs/datatable.pyi +0 -3
  85. reflex/components/lucide/icon.pyi +0 -3
  86. reflex/components/next/base.pyi +0 -3
  87. reflex/components/next/link.pyi +0 -3
  88. reflex/components/plotly/plotly.pyi +0 -6
  89. reflex/components/radix/primitives/accordion.pyi +0 -3
  90. reflex/components/radix/primitives/base.pyi +0 -6
  91. reflex/components/radix/primitives/drawer.pyi +0 -21
  92. reflex/components/radix/primitives/form.pyi +0 -18
  93. reflex/components/radix/primitives/progress.pyi +0 -9
  94. reflex/components/radix/primitives/slider.pyi +0 -15
  95. reflex/components/radix/themes/base.pyi +0 -6
  96. reflex/components/react_player/audio.pyi +0 -3
  97. reflex/components/react_player/react_player.pyi +0 -3
  98. reflex/components/react_player/video.pyi +0 -3
  99. reflex/components/recharts/cartesian.pyi +0 -57
  100. reflex/components/recharts/general.pyi +0 -12
  101. reflex/components/recharts/polar.pyi +0 -18
  102. reflex/components/recharts/recharts.pyi +0 -3
  103. reflex/constants/__init__.py +2 -0
  104. reflex/constants/base.py +5 -0
  105. reflex/constants/compiler.py +2 -0
  106. reflex/constants/installer.py +4 -2
  107. reflex/event.py +7 -6
  108. reflex/experimental/__init__.py +2 -0
  109. reflex/experimental/misc.py +12 -0
  110. reflex/model.py +1 -1
  111. reflex/reflex.py +0 -1
  112. reflex/utils/compat.py +43 -0
  113. reflex/utils/console.py +10 -1
  114. reflex/utils/export.py +1 -3
  115. reflex/utils/imports.py +14 -1
  116. reflex/utils/prerequisites.py +65 -41
  117. reflex/utils/processes.py +37 -0
  118. reflex/utils/serializers.py +14 -0
  119. reflex/utils/types.py +1 -1
  120. {reflex-0.4.7a3.dist-info → reflex-0.4.8a1.dist-info}/METADATA +1 -2
  121. {reflex-0.4.7a3.dist-info → reflex-0.4.8a1.dist-info}/RECORD +124 -122
  122. {reflex-0.4.7a3.dist-info → reflex-0.4.8a1.dist-info}/WHEEL +1 -1
  123. {reflex-0.4.7a3.dist-info → reflex-0.4.8a1.dist-info}/LICENSE +0 -0
  124. {reflex-0.4.7a3.dist-info → reflex-0.4.8a1.dist-info}/entry_points.txt +0 -0
@@ -144,9 +144,6 @@ class Axis(Recharts):
144
144
 
145
145
  Returns:
146
146
  The component.
147
-
148
- Raises:
149
- TypeError: If an invalid child is passed.
150
147
  """
151
148
  ...
152
149
 
@@ -267,9 +264,6 @@ class XAxis(Axis):
267
264
 
268
265
  Returns:
269
266
  The component.
270
-
271
- Raises:
272
- TypeError: If an invalid child is passed.
273
267
  """
274
268
  ...
275
269
 
@@ -390,9 +384,6 @@ class YAxis(Axis):
390
384
 
391
385
  Returns:
392
386
  The component.
393
-
394
- Raises:
395
- TypeError: If an invalid child is passed.
396
387
  """
397
388
  ...
398
389
 
@@ -518,9 +509,6 @@ class ZAxis(Recharts):
518
509
 
519
510
  Returns:
520
511
  The component.
521
-
522
- Raises:
523
- TypeError: If an invalid child is passed.
524
512
  """
525
513
  ...
526
514
 
@@ -578,9 +566,6 @@ class Brush(Recharts):
578
566
 
579
567
  Returns:
580
568
  The component.
581
-
582
- Raises:
583
- TypeError: If an invalid child is passed.
584
569
  """
585
570
  ...
586
571
 
@@ -644,9 +629,6 @@ class Cartesian(Recharts):
644
629
 
645
630
  Returns:
646
631
  The component.
647
-
648
- Raises:
649
- TypeError: If an invalid child is passed.
650
632
  """
651
633
  ...
652
634
 
@@ -764,9 +746,6 @@ class Area(Cartesian):
764
746
 
765
747
  Returns:
766
748
  The component.
767
-
768
- Raises:
769
- TypeError: If an invalid child is passed.
770
749
  """
771
750
  ...
772
751
 
@@ -845,9 +824,6 @@ class Bar(Cartesian):
845
824
 
846
825
  Returns:
847
826
  The component.
848
-
849
- Raises:
850
- TypeError: If an invalid child is passed.
851
827
  """
852
828
  ...
853
829
 
@@ -965,9 +941,6 @@ class Line(Cartesian):
965
941
 
966
942
  Returns:
967
943
  The component.
968
-
969
- Raises:
970
- TypeError: If an invalid child is passed.
971
944
  """
972
945
  ...
973
946
 
@@ -1063,9 +1036,6 @@ class Scatter(Cartesian):
1063
1036
 
1064
1037
  Returns:
1065
1038
  The component.
1066
-
1067
- Raises:
1068
- TypeError: If an invalid child is passed.
1069
1039
  """
1070
1040
  ...
1071
1041
 
@@ -1141,9 +1111,6 @@ class Funnel(Cartesian):
1141
1111
 
1142
1112
  Returns:
1143
1113
  The component.
1144
-
1145
- Raises:
1146
- TypeError: If an invalid child is passed.
1147
1114
  """
1148
1115
  ...
1149
1116
 
@@ -1232,9 +1199,6 @@ class ErrorBar(Recharts):
1232
1199
 
1233
1200
  Returns:
1234
1201
  The component.
1235
-
1236
- Raises:
1237
- TypeError: If an invalid child is passed.
1238
1202
  """
1239
1203
  ...
1240
1204
 
@@ -1328,9 +1292,6 @@ class Reference(Recharts):
1328
1292
 
1329
1293
  Returns:
1330
1294
  The component.
1331
-
1332
- Raises:
1333
- TypeError: If an invalid child is passed.
1334
1295
  """
1335
1296
  ...
1336
1297
 
@@ -1426,9 +1387,6 @@ class ReferenceLine(Reference):
1426
1387
 
1427
1388
  Returns:
1428
1389
  The component.
1429
-
1430
- Raises:
1431
- TypeError: If an invalid child is passed.
1432
1390
  """
1433
1391
  ...
1434
1392
 
@@ -1496,9 +1454,6 @@ class ReferenceDot(Reference):
1496
1454
 
1497
1455
  Returns:
1498
1456
  The component.
1499
-
1500
- Raises:
1501
- TypeError: If an invalid child is passed.
1502
1457
  """
1503
1458
  ...
1504
1459
 
@@ -1602,9 +1557,6 @@ class ReferenceArea(Recharts):
1602
1557
 
1603
1558
  Returns:
1604
1559
  The component.
1605
-
1606
- Raises:
1607
- TypeError: If an invalid child is passed.
1608
1560
  """
1609
1561
  ...
1610
1562
 
@@ -1689,9 +1641,6 @@ class Grid(Recharts):
1689
1641
 
1690
1642
  Returns:
1691
1643
  The component.
1692
-
1693
- Raises:
1694
- TypeError: If an invalid child is passed.
1695
1644
  """
1696
1645
  ...
1697
1646
 
@@ -1786,9 +1735,6 @@ class CartesianGrid(Grid):
1786
1735
 
1787
1736
  Returns:
1788
1737
  The component.
1789
-
1790
- Raises:
1791
- TypeError: If an invalid child is passed.
1792
1738
  """
1793
1739
  ...
1794
1740
 
@@ -1901,8 +1847,5 @@ class CartesianAxis(Grid):
1901
1847
 
1902
1848
  Returns:
1903
1849
  The component.
1904
-
1905
- Raises:
1906
- TypeError: If an invalid child is passed.
1907
1850
  """
1908
1851
  ...
@@ -219,9 +219,6 @@ class Legend(Recharts):
219
219
 
220
220
  Returns:
221
221
  The component.
222
-
223
- Raises:
224
- TypeError: If an invalid child is passed.
225
222
  """
226
223
  ...
227
224
 
@@ -314,9 +311,6 @@ class GraphingTooltip(Recharts):
314
311
 
315
312
  Returns:
316
313
  The component.
317
-
318
- Raises:
319
- TypeError: If an invalid child is passed.
320
314
  """
321
315
  ...
322
316
 
@@ -446,9 +440,6 @@ class Label(Recharts):
446
440
 
447
441
  Returns:
448
442
  The component.
449
-
450
- Raises:
451
- TypeError: If an invalid child is passed.
452
443
  """
453
444
  ...
454
445
 
@@ -580,8 +571,5 @@ class LabelList(Recharts):
580
571
 
581
572
  Returns:
582
573
  The component.
583
-
584
- Raises:
585
- TypeError: If an invalid child is passed.
586
574
  """
587
575
  ...
@@ -97,9 +97,6 @@ class Pie(Recharts):
97
97
 
98
98
  Returns:
99
99
  The component.
100
-
101
- Raises:
102
- TypeError: If an invalid child is passed.
103
100
  """
104
101
  ...
105
102
 
@@ -203,9 +200,6 @@ class Radar(Recharts):
203
200
 
204
201
  Returns:
205
202
  The component.
206
-
207
- Raises:
208
- TypeError: If an invalid child is passed.
209
203
  """
210
204
  ...
211
205
 
@@ -266,9 +260,6 @@ class RadialBar(Recharts):
266
260
 
267
261
  Returns:
268
262
  The component.
269
-
270
- Raises:
271
- TypeError: If an invalid child is passed.
272
263
  """
273
264
  ...
274
265
 
@@ -345,9 +336,6 @@ class PolarAngleAxis(Recharts):
345
336
 
346
337
  Returns:
347
338
  The component.
348
-
349
- Raises:
350
- TypeError: If an invalid child is passed.
351
339
  """
352
340
  ...
353
341
 
@@ -440,9 +428,6 @@ class PolarGrid(Recharts):
440
428
 
441
429
  Returns:
442
430
  The component.
443
-
444
- Raises:
445
- TypeError: If an invalid child is passed.
446
431
  """
447
432
  ...
448
433
 
@@ -558,8 +543,5 @@ class PolarRadiusAxis(Recharts):
558
543
 
559
544
  Returns:
560
545
  The component.
561
-
562
- Raises:
563
- TypeError: If an invalid child is passed.
564
546
  """
565
547
  ...
@@ -83,9 +83,6 @@ class Recharts(Component):
83
83
 
84
84
  Returns:
85
85
  The component.
86
-
87
- Raises:
88
- TypeError: If an invalid child is passed.
89
86
  """
90
87
  ...
91
88
 
@@ -4,6 +4,7 @@ from .base import (
4
4
  COOKIES,
5
5
  ENV_MODE_ENV_VAR,
6
6
  IS_WINDOWS,
7
+ IS_WINDOWS_BUN_SUPPORTED_MACHINE, # type: ignore
7
8
  LOCAL_STORAGE,
8
9
  POLLING_MAX_HTTP_BUFFER_SIZE,
9
10
  PYTEST_CURRENT_TEST,
@@ -86,6 +87,7 @@ __ALL__ = [
86
87
  Hooks,
87
88
  Imports,
88
89
  IS_WINDOWS,
90
+ IS_WINDOWS_BUN_SUPPORTED_MACHINE,
89
91
  LOCAL_STORAGE,
90
92
  LogLevel,
91
93
  MemoizationDisposition,
reflex/constants/base.py CHANGED
@@ -11,6 +11,11 @@ from types import SimpleNamespace
11
11
  from platformdirs import PlatformDirs
12
12
 
13
13
  IS_WINDOWS = platform.system() == "Windows"
14
+ # https://github.com/oven-sh/bun/blob/main/src/cli/install.ps1
15
+ IS_WINDOWS_BUN_SUPPORTED_MACHINE = IS_WINDOWS and platform.machine() in [
16
+ "AMD64",
17
+ "x86_64",
18
+ ] # filter out 32 bit + ARM
14
19
 
15
20
 
16
21
  class Dirs(SimpleNamespace):
@@ -26,6 +26,8 @@ class Ext(SimpleNamespace):
26
26
  CSS = ".css"
27
27
  # The extension for zip files.
28
28
  ZIP = ".zip"
29
+ # The extension for executable files on Windows.
30
+ EXE = ".exe"
29
31
 
30
32
 
31
33
  class CompileVars(SimpleNamespace):
@@ -35,13 +35,15 @@ class Bun(SimpleNamespace):
35
35
  """Bun constants."""
36
36
 
37
37
  # The Bun version.
38
- VERSION = "1.0.13"
38
+ VERSION = "1.1.3"
39
39
  # Min Bun Version
40
40
  MIN_VERSION = "0.7.0"
41
41
  # The directory to store the bun.
42
42
  ROOT_PATH = os.path.join(Reflex.DIR, "bun")
43
43
  # Default bun path.
44
- DEFAULT_PATH = os.path.join(ROOT_PATH, "bin", "bun")
44
+ DEFAULT_PATH = os.path.join(
45
+ ROOT_PATH, "bin", "bun" if not IS_WINDOWS else "bun.exe"
46
+ )
45
47
  # URL to bun install script.
46
48
  INSTALL_URL = "https://bun.sh/install"
47
49
 
reflex/event.py CHANGED
@@ -13,7 +13,6 @@ from typing import (
13
13
  Optional,
14
14
  Tuple,
15
15
  Union,
16
- _GenericAlias, # type: ignore
17
16
  get_type_hints,
18
17
  )
19
18
 
@@ -23,6 +22,11 @@ from reflex.utils import console, format
23
22
  from reflex.utils.types import ArgsSpec
24
23
  from reflex.vars import BaseVar, Var
25
24
 
25
+ try:
26
+ from typing import Annotated
27
+ except ImportError:
28
+ from typing_extensions import Annotated
29
+
26
30
 
27
31
  class Event(Base):
28
32
  """An event that describes any state change in the app."""
@@ -118,7 +122,7 @@ class EventHandler(EventActionsMixin):
118
122
  frozen = True
119
123
 
120
124
  @classmethod
121
- def __class_getitem__(cls, args_spec: str) -> _GenericAlias:
125
+ def __class_getitem__(cls, args_spec: str) -> Annotated:
122
126
  """Get a typed EventHandler.
123
127
 
124
128
  Args:
@@ -127,10 +131,7 @@ class EventHandler(EventActionsMixin):
127
131
  Returns:
128
132
  The EventHandler class item.
129
133
  """
130
- gen = _GenericAlias(cls, Any)
131
- # Cannot subclass special typing classes, so we need to set the args_spec dynamically as an attribute.
132
- gen.args_spec = args_spec
133
- return gen
134
+ return Annotated[cls, args_spec]
134
135
 
135
136
  @property
136
137
  def is_background(self) -> bool:
@@ -4,6 +4,7 @@ from types import SimpleNamespace
4
4
 
5
5
  from ..utils.console import warn
6
6
  from . import hooks as hooks
7
+ from .misc import run_in_thread as run_in_thread
7
8
 
8
9
  warn(
9
10
  "`rx._x` contains experimental features and might be removed at any time in the future .",
@@ -11,4 +12,5 @@ warn(
11
12
 
12
13
  _x = SimpleNamespace(
13
14
  hooks=hooks,
15
+ run_in_thread=run_in_thread,
14
16
  )
@@ -0,0 +1,12 @@
1
+ """Miscellaneous functions for the experimental package."""
2
+
3
+ import asyncio
4
+
5
+
6
+ async def run_in_thread(func):
7
+ """Run a function in a separate thread.
8
+
9
+ Args:
10
+ func (callable): The function to run.
11
+ """
12
+ await asyncio.get_event_loop().run_in_executor(None, func)
reflex/model.py CHANGED
@@ -16,12 +16,12 @@ import alembic.script
16
16
  import alembic.util
17
17
  import sqlalchemy
18
18
  import sqlalchemy.orm
19
- import sqlmodel
20
19
 
21
20
  from reflex import constants
22
21
  from reflex.base import Base
23
22
  from reflex.config import get_config
24
23
  from reflex.utils import console
24
+ from reflex.utils.compat import sqlmodel
25
25
 
26
26
 
27
27
  def get_engine(url: str | None = None):
reflex/reflex.py CHANGED
@@ -178,7 +178,6 @@ def _run(
178
178
  prerequisites.check_latest_package_version(constants.Reflex.MODULE_NAME)
179
179
 
180
180
  if frontend:
181
- prerequisites.update_next_config()
182
181
  # Get the app module.
183
182
  prerequisites.get_compiled_app()
184
183
 
reflex/utils/compat.py ADDED
@@ -0,0 +1,43 @@
1
+ """Compatibility hacks and helpers."""
2
+
3
+ import contextlib
4
+ import sys
5
+
6
+
7
+ @contextlib.contextmanager
8
+ def pydantic_v1_patch():
9
+ """A context manager that patches the Pydantic module to mimic v1 behaviour.
10
+
11
+ Yields:
12
+ None when the Pydantic module is patched.
13
+ """
14
+ patched_modules = [
15
+ "pydantic",
16
+ "pydantic.fields",
17
+ "pydantic.errors",
18
+ "pydantic.main",
19
+ ]
20
+ originals = {module: sys.modules.get(module) for module in patched_modules}
21
+ try:
22
+ import pydantic.v1 # type: ignore
23
+
24
+ sys.modules["pydantic.fields"] = pydantic.v1.fields # type: ignore
25
+ sys.modules["pydantic.main"] = pydantic.v1.main # type: ignore
26
+ sys.modules["pydantic.errors"] = pydantic.v1.errors # type: ignore
27
+ sys.modules["pydantic"] = pydantic.v1
28
+ yield
29
+ except (ImportError, AttributeError):
30
+ # pydantic v1 is already installed
31
+ yield
32
+ finally:
33
+ # Restore the original Pydantic module
34
+ for k, original in originals.items():
35
+ if k in sys.modules:
36
+ if original:
37
+ sys.modules[k] = original
38
+ else:
39
+ del sys.modules[k]
40
+
41
+
42
+ with pydantic_v1_patch():
43
+ import sqlmodel as sqlmodel
reflex/utils/console.py CHANGED
@@ -28,6 +28,15 @@ def set_log_level(log_level: LogLevel):
28
28
  _LOG_LEVEL = log_level
29
29
 
30
30
 
31
+ def is_debug() -> bool:
32
+ """Check if the log level is debug.
33
+
34
+ Returns:
35
+ True if the log level is debug.
36
+ """
37
+ return _LOG_LEVEL <= LogLevel.DEBUG
38
+
39
+
31
40
  def print(msg: str, **kwargs):
32
41
  """Print a message.
33
42
 
@@ -45,7 +54,7 @@ def debug(msg: str, **kwargs):
45
54
  msg: The debug message.
46
55
  kwargs: Keyword arguments to pass to the print function.
47
56
  """
48
- if _LOG_LEVEL <= LogLevel.DEBUG:
57
+ if is_debug():
49
58
  msg_ = f"[blue]Debug: {msg}[/blue]"
50
59
  if progress := kwargs.pop("progress", None):
51
60
  progress.console.print(msg_, **kwargs)
reflex/utils/export.py CHANGED
@@ -50,10 +50,8 @@ def export(
50
50
  console.rule("[bold]Compiling production app and preparing for export.")
51
51
 
52
52
  if frontend:
53
- # Update some parameters for export
54
- prerequisites.update_next_config(export=True)
55
53
  # Ensure module can be imported and app.compile() is called.
56
- prerequisites.get_compiled_app()
54
+ prerequisites.get_compiled_app(export=True)
57
55
  # Set up .web directory and install frontend dependencies.
58
56
  build.setup_frontend(Path.cwd())
59
57
 
reflex/utils/imports.py CHANGED
@@ -54,6 +54,10 @@ class ImportVar(Base):
54
54
  # whether this import should be rendered or not
55
55
  render: Optional[bool] = True
56
56
 
57
+ # whether this import package should be added to transpilePackages in next.config.js
58
+ # https://nextjs.org/docs/app/api-reference/next-config-js/transpilePackages
59
+ transpile: Optional[bool] = False
60
+
57
61
  @property
58
62
  def name(self) -> str:
59
63
  """The name of the import.
@@ -72,7 +76,16 @@ class ImportVar(Base):
72
76
  Returns:
73
77
  The hash of the var.
74
78
  """
75
- return hash((self.tag, self.is_default, self.alias, self.install, self.render))
79
+ return hash(
80
+ (
81
+ self.tag,
82
+ self.is_default,
83
+ self.alias,
84
+ self.install,
85
+ self.render,
86
+ self.transpile,
87
+ )
88
+ )
76
89
 
77
90
 
78
91
  ImportDict = Dict[str, List[ImportVar]]