Skip to content

Commit 42e6957

Browse files
committed
Merge branch 'main' into release/reflex-0.8.1
2 parents 74a938e + 35da6a2 commit 42e6957

File tree

6 files changed

+41
-55
lines changed

6 files changed

+41
-55
lines changed

pyi_hashes.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
"reflex/components/plotly/plotly.pyi": "1de86aa6881e59d4053206e62e3039c3",
4646
"reflex/components/radix/__init__.pyi": "5d8e3579912473e563676bfc71f29191",
4747
"reflex/components/radix/primitives/__init__.pyi": "68fcf93acb9a40d94561d375a3a5fdb1",
48-
"reflex/components/radix/primitives/accordion.pyi": "2df705ef76706119731b410165a0bdcd",
48+
"reflex/components/radix/primitives/accordion.pyi": "126758bb92f4d06853ea5a73cc193c77",
4949
"reflex/components/radix/primitives/base.pyi": "bde318c8eb87aa3f63bd827493675da3",
5050
"reflex/components/radix/primitives/drawer.pyi": "5ef31326d1f76956fd8eaafbc661f1a2",
5151
"reflex/components/radix/primitives/form.pyi": "2461e70c7a114381bb7d1f609747cbeb",

reflex/components/core/banner.py

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,9 @@ def create(cls, *children, **props) -> Icon:
268268
Returns:
269269
The icon component with default props applied.
270270
"""
271-
pulse_var = Var(_js_expr="pulse")
271+
pulse_var = Var(r"keyframes({ from: { opacity: 0 }, to: { opacity: 1 } })").to(
272+
str
273+
)
272274
return super().create(
273275
"wifi_off",
274276
color=props.pop("color", "crimson"),
@@ -289,18 +291,6 @@ def add_imports(self) -> dict[str, str | ImportVar | list[str | ImportVar]]:
289291
"""
290292
return {"@emotion/react": [ImportVar(tag="keyframes")]}
291293

292-
def _get_custom_code(self) -> str | None:
293-
return """
294-
const pulse = keyframes`
295-
0% {
296-
opacity: 0;
297-
}
298-
100% {
299-
opacity: 1;
300-
}
301-
`
302-
"""
303-
304294

305295
class ConnectionPulser(Div):
306296
"""A connection pulser component."""

reflex/components/radix/primitives/accordion.py

Lines changed: 10 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -431,6 +431,14 @@ def create(cls, *children, **props) -> Component:
431431
return super().create(tag="chevron_down", class_name=cls_name, **props)
432432

433433

434+
SLIDE_DOWN = Var(
435+
r'keyframes({ from: { height: 0 }, to: { height: "var(--radix-accordion-content-height)" } })'
436+
)
437+
SLIDE_UP = Var(
438+
r'keyframes({ from: { height: "var(--radix-accordion-content-height)" }, to: { height: 0 } })'
439+
)
440+
441+
434442
class AccordionContent(AccordionComponent):
435443
"""An accordion component."""
436444

@@ -464,44 +472,17 @@ def create(cls, *children, **props) -> Component:
464472

465473
return super().create(*children, class_name=cls_name, **props)
466474

467-
def add_custom_code(self) -> list[str]:
468-
"""Add custom code to the component.
469-
470-
Returns:
471-
The custom code of the component.
472-
"""
473-
return [
474-
"""
475-
const slideDown = keyframes`
476-
from {
477-
height: 0;
478-
}
479-
to {
480-
height: var(--radix-accordion-content-height);
481-
}
482-
`
483-
const slideUp = keyframes`
484-
from {
485-
height: var(--radix-accordion-content-height);
486-
}
487-
to {
488-
height: 0;
489-
}
490-
`
491-
"""
492-
]
493-
494475
def add_style(self) -> dict[str, Any] | None:
495476
"""Add style to the component.
496477
497478
Returns:
498479
The style of the component.
499480
"""
500-
slide_down = Var("slideDown").to(str) + Var.create(
481+
slide_down = SLIDE_DOWN.to(str) + Var.create(
501482
" var(--animation-duration) var(--animation-easing)",
502483
)
503484

504-
slide_up = Var("slideUp").to(str) + Var.create(
485+
slide_up = SLIDE_UP.to(str) + Var.create(
505486
" var(--animation-duration) var(--animation-easing)",
506487
)
507488

reflex/constants/compiler.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ class PageNames(SimpleNamespace):
8585
# The name of the index page.
8686
INDEX_ROUTE = "index"
8787
# The name of the app root page.
88-
APP_ROOT = "root.js"
88+
APP_ROOT = "root.jsx"
8989
# The root stylesheet filename.
9090
STYLESHEET_ROOT = "__reflex_global_styles"
9191
# The name of the document root page.

reflex/constants/installer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ def DEPENDENCIES(cls) -> dict[str, str]:
143143
"postcss-import": "16.1.1",
144144
"@react-router/dev": _react_router_version,
145145
"@react-router/fs-routes": _react_router_version,
146-
"rolldown-vite": "7.0.3",
146+
"rolldown-vite": "7.0.5",
147147
}
148148
OVERRIDES = {
149149
# This should always match the `react` version in DEPENDENCIES for recharts compatibility.

reflex/utils/processes.py

Lines changed: 25 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,26 @@ def get_num_workers() -> int:
5353
return (os.cpu_count() or 1) * 2 + 1
5454

5555

56+
def _is_address_responsive(
57+
address_family: socket.AddressFamily | int, address: str, port: int
58+
) -> bool:
59+
"""Check if a given address and port are responsive.
60+
61+
Args:
62+
address_family: The address family (e.g., socket.AF_INET or socket.AF_INET6).
63+
address: The address to check.
64+
port: The port to check.
65+
66+
Returns:
67+
Whether the address and port are responsive.
68+
"""
69+
try:
70+
with closing(socket.socket(address_family, socket.SOCK_STREAM)) as sock:
71+
return sock.connect_ex((address, port)) == 0
72+
except OSError:
73+
return False
74+
75+
5676
def is_process_on_port(port: int) -> bool:
5777
"""Check if a process is running on the given port.
5878
@@ -62,16 +82,11 @@ def is_process_on_port(port: int) -> bool:
6282
Returns:
6383
Whether a process is running on the given port.
6484
"""
65-
# Test IPv4 localhost (127.0.0.1)
66-
with closing(socket.socket(socket.AF_INET, socket.SOCK_STREAM)) as sock:
67-
ipv4_result = sock.connect_ex(("127.0.0.1", port)) == 0
68-
69-
# Test IPv6 localhost (::1)
70-
with closing(socket.socket(socket.AF_INET6, socket.SOCK_STREAM)) as sock:
71-
ipv6_result = sock.connect_ex(("::1", port)) == 0
72-
73-
# Port is in use if either IPv4 or IPv6 is listening
74-
return ipv4_result or ipv6_result
85+
return _is_address_responsive( # Test IPv4 localhost (127.0.0.1)
86+
socket.AF_INET, "127.0.0.1", port
87+
) or _is_address_responsive(
88+
socket.AF_INET6, "::1", port
89+
) # Test IPv6 localhost (::1)
7590

7691

7792
def change_port(port: int, _type: str) -> int:

0 commit comments

Comments
 (0)