Skip to content

Commit 8fab30e

Browse files
committed
Merge branch 'main' into add-validation-to-function-vars
2 parents 2ffa698 + 8663dbc commit 8fab30e

File tree

160 files changed

+2300
-1232
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

160 files changed

+2300
-1232
lines changed

.github/workflows/performance.yml

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: performance-tests
2+
3+
on:
4+
push:
5+
branches:
6+
- "main" # or "master"
7+
paths-ignore:
8+
- "**/*.md"
9+
pull_request:
10+
workflow_dispatch:
11+
12+
env:
13+
TELEMETRY_ENABLED: false
14+
NODE_OPTIONS: "--max_old_space_size=8192"
15+
PR_TITLE: ${{ github.event.pull_request.title }}
16+
APP_HARNESS_HEADLESS: 1
17+
PYTHONUNBUFFERED: 1
18+
19+
jobs:
20+
benchmarks:
21+
name: Run benchmarks
22+
runs-on: ubuntu-latest
23+
steps:
24+
- uses: actions/checkout@v4
25+
- uses: ./.github/actions/setup_build_env
26+
with:
27+
python-version: 3.12.8
28+
run-poetry-install: true
29+
create-venv-at-path: .venv
30+
- name: Run benchmarks
31+
uses: CodSpeedHQ/action@v3
32+
with:
33+
token: ${{ secrets.CODSPEED_TOKEN }}
34+
run: poetry run pytest benchmarks/test_evaluate.py --codspeed

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ assets/external/*
44
dist/*
55
examples/
66
.web
7+
.states
78
.idea
89
.vscode
910
.coverage
@@ -14,3 +15,4 @@ requirements.txt
1415
.pyi_generator_last_run
1516
.pyi_generator_diff
1617
reflex.db
18+
.codspeed

.pre-commit-config.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ repos:
2828
entry: python3 scripts/make_pyi.py
2929

3030
- repo: https://github.com/RobertCraigie/pyright-python
31-
rev: v1.1.334
31+
rev: v1.1.392
3232
hooks:
3333
- id: pyright
3434
args: [reflex, tests]

benchmarks/test_benchmark_compile_components.py

+10-10
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,13 @@ def render_component(num: int):
3434
rx.box(
3535
rx.accordion.root(
3636
rx.accordion.item(
37-
header="Full Ingredients", # type: ignore
38-
content="Yes. It's built with accessibility in mind.", # type: ignore
37+
header="Full Ingredients",
38+
content="Yes. It's built with accessibility in mind.",
3939
font_size="3em",
4040
),
4141
rx.accordion.item(
42-
header="Applications", # type: ignore
43-
content="Yes. It's unstyled by default, giving you freedom over the look and feel.", # type: ignore
42+
header="Applications",
43+
content="Yes. It's unstyled by default, giving you freedom over the look and feel.",
4444
),
4545
collapsible=True,
4646
variant="ghost",
@@ -166,9 +166,9 @@ def app_with_10_components(
166166
root=root,
167167
app_source=functools.partial(
168168
AppWithTenComponentsOnePage,
169-
render_component=render_component, # type: ignore
169+
render_component=render_component, # pyright: ignore [reportCallIssue]
170170
),
171-
) # type: ignore
171+
)
172172

173173

174174
@pytest.fixture(scope="session")
@@ -189,9 +189,9 @@ def app_with_100_components(
189189
root=root,
190190
app_source=functools.partial(
191191
AppWithHundredComponentOnePage,
192-
render_component=render_component, # type: ignore
192+
render_component=render_component, # pyright: ignore [reportCallIssue]
193193
),
194-
) # type: ignore
194+
)
195195

196196

197197
@pytest.fixture(scope="session")
@@ -212,9 +212,9 @@ def app_with_1000_components(
212212
root=root,
213213
app_source=functools.partial(
214214
AppWithThousandComponentsOnePage,
215-
render_component=render_component, # type: ignore
215+
render_component=render_component, # pyright: ignore [reportCallIssue]
216216
),
217-
) # type: ignore
217+
)
218218

219219

220220
@pytest.mark.skipif(constants.IS_WINDOWS, reason=WINDOWS_SKIP_REASON)

benchmarks/test_benchmark_compile_pages.py

+13-13
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ def render_multiple_pages(app, num: int):
2828
"""
2929
from typing import Tuple
3030

31-
from rxconfig import config # type: ignore
31+
from rxconfig import config # pyright: ignore [reportMissingImports]
3232

3333
import reflex as rx
3434

@@ -74,13 +74,13 @@ class State(rx.State):
7474
rx.select(
7575
["C", "PF", "SF", "PG", "SG"],
7676
placeholder="Select a position. (All)",
77-
on_change=State.set_position, # type: ignore
77+
on_change=State.set_position, # pyright: ignore [reportAttributeAccessIssue]
7878
size="3",
7979
),
8080
rx.select(
8181
college,
8282
placeholder="Select a college. (All)",
83-
on_change=State.set_college, # type: ignore
83+
on_change=State.set_college, # pyright: ignore [reportAttributeAccessIssue]
8484
size="3",
8585
),
8686
),
@@ -95,7 +95,7 @@ class State(rx.State):
9595
default_value=[18, 50],
9696
min=18,
9797
max=50,
98-
on_value_commit=State.set_age, # type: ignore
98+
on_value_commit=State.set_age, # pyright: ignore [reportAttributeAccessIssue]
9999
),
100100
align_items="left",
101101
width="100%",
@@ -110,7 +110,7 @@ class State(rx.State):
110110
default_value=[0, 25000000],
111111
min=0,
112112
max=25000000,
113-
on_value_commit=State.set_salary, # type: ignore
113+
on_value_commit=State.set_salary, # pyright: ignore [reportAttributeAccessIssue]
114114
),
115115
align_items="left",
116116
width="100%",
@@ -130,7 +130,7 @@ class State(rx.State):
130130

131131
def AppWithOnePage():
132132
"""A reflex app with one page."""
133-
from rxconfig import config # type: ignore
133+
from rxconfig import config # pyright: ignore [reportMissingImports]
134134

135135
import reflex as rx
136136

@@ -232,7 +232,7 @@ def app_with_ten_pages(
232232
root=root,
233233
app_source=functools.partial(
234234
AppWithTenPages,
235-
render_comp=render_multiple_pages, # type: ignore
235+
render_comp=render_multiple_pages, # pyright: ignore [reportCallIssue]
236236
),
237237
)
238238

@@ -255,9 +255,9 @@ def app_with_hundred_pages(
255255
root=root,
256256
app_source=functools.partial(
257257
AppWithHundredPages,
258-
render_comp=render_multiple_pages, # type: ignore
258+
render_comp=render_multiple_pages, # pyright: ignore [reportCallIssue]
259259
),
260-
) # type: ignore
260+
)
261261

262262

263263
@pytest.fixture(scope="session")
@@ -278,9 +278,9 @@ def app_with_thousand_pages(
278278
root=root,
279279
app_source=functools.partial(
280280
AppWithThousandPages,
281-
render_comp=render_multiple_pages, # type: ignore
281+
render_comp=render_multiple_pages, # pyright: ignore [reportCallIssue]
282282
),
283-
) # type: ignore
283+
)
284284

285285

286286
@pytest.fixture(scope="session")
@@ -301,9 +301,9 @@ def app_with_ten_thousand_pages(
301301
root=root,
302302
app_source=functools.partial(
303303
AppWithTenThousandPages,
304-
render_comp=render_multiple_pages, # type: ignore
304+
render_comp=render_multiple_pages, # pyright: ignore [reportCallIssue]
305305
),
306-
) # type: ignore
306+
)
307307

308308

309309
@pytest.mark.skipif(constants.IS_WINDOWS, reason=WINDOWS_SKIP_REASON)

0 commit comments

Comments
 (0)