reflex 0.7.14a3__py3-none-any.whl → 0.7.14a5__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of reflex might be problematic. Click here for more details.
- reflex/app.py +2 -1
- reflex/assets.py +1 -1
- reflex/compiler/compiler.py +2 -1
- reflex/components/base/bare.py +17 -5
- reflex/components/component.py +30 -6
- reflex/components/core/banner.py +1 -1
- reflex/components/core/upload.py +1 -1
- reflex/config.py +16 -608
- reflex/constants/base.py +3 -3
- reflex/constants/installer.py +1 -1
- reflex/environment.py +606 -0
- reflex/istate/manager.py +2 -1
- reflex/model.py +2 -1
- reflex/reflex.py +2 -1
- reflex/state.py +1 -1
- reflex/testing.py +3 -1
- reflex/utils/console.py +2 -2
- reflex/utils/exec.py +2 -1
- reflex/utils/export.py +2 -1
- reflex/utils/net.py +2 -2
- reflex/utils/path_ops.py +2 -1
- reflex/utils/prerequisites.py +2 -1
- reflex/utils/processes.py +1 -1
- reflex/utils/registry.py +1 -1
- reflex/utils/telemetry.py +1 -1
- {reflex-0.7.14a3.dist-info → reflex-0.7.14a5.dist-info}/METADATA +1 -1
- {reflex-0.7.14a3.dist-info → reflex-0.7.14a5.dist-info}/RECORD +30 -29
- {reflex-0.7.14a3.dist-info → reflex-0.7.14a5.dist-info}/WHEEL +0 -0
- {reflex-0.7.14a3.dist-info → reflex-0.7.14a5.dist-info}/entry_points.txt +0 -0
- {reflex-0.7.14a3.dist-info → reflex-0.7.14a5.dist-info}/licenses/LICENSE +0 -0
reflex/app.py
CHANGED
|
@@ -68,7 +68,8 @@ from reflex.components.core.sticky import sticky
|
|
|
68
68
|
from reflex.components.core.upload import Upload, get_upload_dir
|
|
69
69
|
from reflex.components.radix import themes
|
|
70
70
|
from reflex.components.sonner.toast import toast
|
|
71
|
-
from reflex.config import
|
|
71
|
+
from reflex.config import get_config
|
|
72
|
+
from reflex.environment import ExecutorType, environment
|
|
72
73
|
from reflex.event import (
|
|
73
74
|
_EVENT_FIELDS,
|
|
74
75
|
Event,
|
reflex/assets.py
CHANGED
reflex/compiler/compiler.py
CHANGED
|
@@ -19,8 +19,9 @@ from reflex.components.component import (
|
|
|
19
19
|
CustomComponent,
|
|
20
20
|
StatefulComponent,
|
|
21
21
|
)
|
|
22
|
-
from reflex.config import
|
|
22
|
+
from reflex.config import get_config
|
|
23
23
|
from reflex.constants.compiler import PageNames
|
|
24
|
+
from reflex.environment import environment
|
|
24
25
|
from reflex.state import BaseState
|
|
25
26
|
from reflex.style import SYSTEM_COLOR_MODE
|
|
26
27
|
from reflex.utils import console, path_ops
|
reflex/components/base/bare.py
CHANGED
|
@@ -8,7 +8,7 @@ from typing import Any
|
|
|
8
8
|
from reflex.components.component import BaseComponent, Component, ComponentStyle
|
|
9
9
|
from reflex.components.tags import Tag
|
|
10
10
|
from reflex.components.tags.tagless import Tagless
|
|
11
|
-
from reflex.
|
|
11
|
+
from reflex.environment import PerformanceMode, environment
|
|
12
12
|
from reflex.utils import console
|
|
13
13
|
from reflex.utils.decorator import once
|
|
14
14
|
from reflex.utils.imports import ParsedImportDict
|
|
@@ -141,17 +141,29 @@ class Bare(Component):
|
|
|
141
141
|
custom_code |= component._get_all_custom_code()
|
|
142
142
|
return custom_code
|
|
143
143
|
|
|
144
|
-
def _get_all_app_wrap_components(
|
|
144
|
+
def _get_all_app_wrap_components(
|
|
145
|
+
self, *, ignore_ids: set[int] | None = None
|
|
146
|
+
) -> dict[tuple[int, str], Component]:
|
|
145
147
|
"""Get the components that should be wrapped in the app.
|
|
146
148
|
|
|
149
|
+
Args:
|
|
150
|
+
ignore_ids: The ids to ignore when collecting components.
|
|
151
|
+
|
|
147
152
|
Returns:
|
|
148
153
|
The components that should be wrapped in the app.
|
|
149
154
|
"""
|
|
150
|
-
|
|
155
|
+
ignore_ids = ignore_ids or set()
|
|
156
|
+
app_wrap_components = super()._get_all_app_wrap_components(
|
|
157
|
+
ignore_ids=ignore_ids
|
|
158
|
+
)
|
|
151
159
|
if isinstance(self.contents, Var):
|
|
152
160
|
for component in _components_from_var(self.contents):
|
|
153
|
-
|
|
154
|
-
|
|
161
|
+
component_id = id(component)
|
|
162
|
+
if isinstance(component, Component) and component_id not in ignore_ids:
|
|
163
|
+
ignore_ids.add(component_id)
|
|
164
|
+
app_wrap_components |= component._get_all_app_wrap_components(
|
|
165
|
+
ignore_ids=ignore_ids
|
|
166
|
+
)
|
|
155
167
|
return app_wrap_components
|
|
156
168
|
|
|
157
169
|
def _get_all_refs(self) -> set[str]:
|
reflex/components/component.py
CHANGED
|
@@ -1976,24 +1976,38 @@ class Component(BaseComponent, ABC):
|
|
|
1976
1976
|
"""
|
|
1977
1977
|
return {}
|
|
1978
1978
|
|
|
1979
|
-
def _get_all_app_wrap_components(
|
|
1979
|
+
def _get_all_app_wrap_components(
|
|
1980
|
+
self, *, ignore_ids: set[int] | None = None
|
|
1981
|
+
) -> dict[tuple[int, str], Component]:
|
|
1980
1982
|
"""Get the app wrap components for the component and its children.
|
|
1981
1983
|
|
|
1984
|
+
Args:
|
|
1985
|
+
ignore_ids: A set of component IDs to ignore. Used to avoid duplicates.
|
|
1986
|
+
|
|
1982
1987
|
Returns:
|
|
1983
1988
|
The app wrap components.
|
|
1984
1989
|
"""
|
|
1990
|
+
ignore_ids = ignore_ids or set()
|
|
1985
1991
|
# Store the components in a set to avoid duplicates.
|
|
1986
1992
|
components = self._get_app_wrap_components()
|
|
1987
1993
|
|
|
1988
1994
|
for component in tuple(components.values()):
|
|
1989
|
-
|
|
1995
|
+
component_id = id(component)
|
|
1996
|
+
if component_id in ignore_ids:
|
|
1997
|
+
continue
|
|
1998
|
+
ignore_ids.add(component_id)
|
|
1999
|
+
components.update(
|
|
2000
|
+
component._get_all_app_wrap_components(ignore_ids=ignore_ids)
|
|
2001
|
+
)
|
|
1990
2002
|
|
|
1991
2003
|
# Add the app wrap components for the children.
|
|
1992
2004
|
for child in self.children:
|
|
2005
|
+
child_id = id(child)
|
|
1993
2006
|
# Skip BaseComponent and StatefulComponent children.
|
|
1994
|
-
if not isinstance(child, Component):
|
|
2007
|
+
if not isinstance(child, Component) or child_id in ignore_ids:
|
|
1995
2008
|
continue
|
|
1996
|
-
|
|
2009
|
+
ignore_ids.add(child_id)
|
|
2010
|
+
components.update(child._get_all_app_wrap_components(ignore_ids=ignore_ids))
|
|
1997
2011
|
|
|
1998
2012
|
# Return the components.
|
|
1999
2013
|
return components
|
|
@@ -2206,13 +2220,23 @@ class CustomComponent(Component):
|
|
|
2206
2220
|
component._add_style_recursive(style)
|
|
2207
2221
|
return component
|
|
2208
2222
|
|
|
2209
|
-
def _get_all_app_wrap_components(
|
|
2223
|
+
def _get_all_app_wrap_components(
|
|
2224
|
+
self, *, ignore_ids: set[int] | None = None
|
|
2225
|
+
) -> dict[tuple[int, str], Component]:
|
|
2210
2226
|
"""Get the app wrap components for the custom component.
|
|
2211
2227
|
|
|
2228
|
+
Args:
|
|
2229
|
+
ignore_ids: A set of IDs to ignore to avoid infinite recursion.
|
|
2230
|
+
|
|
2212
2231
|
Returns:
|
|
2213
2232
|
The app wrap components.
|
|
2214
2233
|
"""
|
|
2215
|
-
|
|
2234
|
+
ignore_ids = ignore_ids or set()
|
|
2235
|
+
component = self.get_component()
|
|
2236
|
+
if id(component) in ignore_ids:
|
|
2237
|
+
return {}
|
|
2238
|
+
ignore_ids.add(id(component))
|
|
2239
|
+
return self.get_component()._get_all_app_wrap_components(ignore_ids=ignore_ids)
|
|
2216
2240
|
|
|
2217
2241
|
|
|
2218
2242
|
CUSTOM_COMPONENTS: dict[str, CustomComponent] = {}
|
reflex/components/core/banner.py
CHANGED
|
@@ -16,9 +16,9 @@ from reflex.components.radix.themes.components.dialog import (
|
|
|
16
16
|
from reflex.components.radix.themes.layout.flex import Flex
|
|
17
17
|
from reflex.components.radix.themes.typography.text import Text
|
|
18
18
|
from reflex.components.sonner.toast import ToastProps, toast_ref
|
|
19
|
-
from reflex.config import environment
|
|
20
19
|
from reflex.constants import Dirs, Hooks, Imports
|
|
21
20
|
from reflex.constants.compiler import CompileVars
|
|
21
|
+
from reflex.environment import environment
|
|
22
22
|
from reflex.utils.imports import ImportVar
|
|
23
23
|
from reflex.vars import VarData
|
|
24
24
|
from reflex.vars.base import LiteralVar, Var
|
reflex/components/core/upload.py
CHANGED
|
@@ -16,9 +16,9 @@ from reflex.components.component import (
|
|
|
16
16
|
from reflex.components.core.cond import cond
|
|
17
17
|
from reflex.components.el.elements.forms import Input
|
|
18
18
|
from reflex.components.radix.themes.layout.box import Box
|
|
19
|
-
from reflex.config import environment
|
|
20
19
|
from reflex.constants import Dirs
|
|
21
20
|
from reflex.constants.compiler import Hooks, Imports
|
|
21
|
+
from reflex.environment import environment
|
|
22
22
|
from reflex.event import (
|
|
23
23
|
CallableEventSpec,
|
|
24
24
|
EventChain,
|