Skip to content

Commit 315bf9c

Browse files
committed
Add next_dev_indicators config knob, default to False
The nextjs dev indicator might be useful in some circumstances, but it also can block elements that we want to click for integration tests. Since it's a new feature, disable it until we find that it's useful -- otherwise it's just branding for Vercel.
1 parent 29c98e1 commit 315bf9c

File tree

3 files changed

+18
-6
lines changed

3 files changed

+18
-6
lines changed

reflex/config.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -815,6 +815,9 @@ class Config: # pyright: ignore [reportIncompatibleVariableOverride]
815815
# Whether to enable or disable nextJS gzip compression.
816816
next_compression: bool = True
817817

818+
# Whether to enable or disable NextJS dev indicator.
819+
next_dev_indicators: bool = False
820+
818821
# Whether to use React strict mode in nextJS
819822
react_strict_mode: bool = True
820823

reflex/utils/prerequisites.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -923,6 +923,7 @@ def _update_next_config(
923923
"compress": config.next_compression,
924924
"trailingSlash": True,
925925
"staticPageGenerationTimeout": config.static_page_generation_timeout,
926+
"devIndicators": config.next_dev_indicators,
926927
}
927928
if transpile_packages:
928929
next_config["transpilePackages"] = list(

tests/units/test_prerequisites.py

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,31 +32,31 @@
3232
app_name="test",
3333
),
3434
False,
35-
'module.exports = {basePath: "", compress: true, trailingSlash: true, staticPageGenerationTimeout: 60};',
35+
'module.exports = {basePath: "", compress: true, trailingSlash: true, staticPageGenerationTimeout: 60, devIndicators: false};',
3636
),
3737
(
3838
Config(
3939
app_name="test",
4040
static_page_generation_timeout=30,
4141
),
4242
False,
43-
'module.exports = {basePath: "", compress: true, trailingSlash: true, staticPageGenerationTimeout: 30};',
43+
'module.exports = {basePath: "", compress: true, trailingSlash: true, staticPageGenerationTimeout: 30, devIndicators: false};',
4444
),
4545
(
4646
Config(
4747
app_name="test",
4848
next_compression=False,
4949
),
5050
False,
51-
'module.exports = {basePath: "", compress: false, trailingSlash: true, staticPageGenerationTimeout: 60};',
51+
'module.exports = {basePath: "", compress: false, trailingSlash: true, staticPageGenerationTimeout: 60, devIndicators: false};',
5252
),
5353
(
5454
Config(
5555
app_name="test",
5656
frontend_path="/test",
5757
),
5858
False,
59-
'module.exports = {basePath: "/test", compress: true, trailingSlash: true, staticPageGenerationTimeout: 60};',
59+
'module.exports = {basePath: "/test", compress: true, trailingSlash: true, staticPageGenerationTimeout: 60, devIndicators: false};',
6060
),
6161
(
6262
Config(
@@ -65,14 +65,22 @@
6565
next_compression=False,
6666
),
6767
False,
68-
'module.exports = {basePath: "/test", compress: false, trailingSlash: true, staticPageGenerationTimeout: 60};',
68+
'module.exports = {basePath: "/test", compress: false, trailingSlash: true, staticPageGenerationTimeout: 60, devIndicators: false};',
6969
),
7070
(
7171
Config(
7272
app_name="test",
7373
),
7474
True,
75-
'module.exports = {basePath: "", compress: true, trailingSlash: true, staticPageGenerationTimeout: 60, output: "export", distDir: "_static"};',
75+
'module.exports = {basePath: "", compress: true, trailingSlash: true, staticPageGenerationTimeout: 60, devIndicators: false, output: "export", distDir: "_static"};',
76+
),
77+
(
78+
Config(
79+
app_name="test",
80+
next_dev_indicators=True,
81+
),
82+
True,
83+
'module.exports = {basePath: "", compress: true, trailingSlash: true, staticPageGenerationTimeout: 60, devIndicators: true, output: "export", distDir: "_static"};',
7684
),
7785
],
7886
)

0 commit comments

Comments
 (0)