Skip to content

Commit 7a2ec85

Browse files
adhami3310masenf
andauthored
expose NEXTJS_VERSION and upgrade nextjs (#5039)
* expose NEXTJS_VERSION and upgrade nextjs * disable turbopack * 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. --------- Co-authored-by: Masen Furer <[email protected]>
1 parent b978bf7 commit 7a2ec85

File tree

4 files changed

+21
-8
lines changed

4 files changed

+21
-8
lines changed

reflex/config.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -703,7 +703,7 @@ class EnvironmentVariables:
703703
REFLEX_STATE_SIZE_LIMIT: EnvVar[int] = env_var(1000)
704704

705705
# Whether to use the turbopack bundler.
706-
REFLEX_USE_TURBOPACK: EnvVar[bool] = env_var(True)
706+
REFLEX_USE_TURBOPACK: EnvVar[bool] = env_var(False)
707707

708708
# Additional paths to include in the hot reload. Separated by a colon.
709709
REFLEX_HOT_RELOAD_INCLUDE_PATHS: EnvVar[list[Path]] = env_var([])
@@ -826,6 +826,9 @@ class Config: # pyright: ignore [reportIncompatibleVariableOverride]
826826
# Whether to enable or disable nextJS gzip compression.
827827
next_compression: bool = True
828828

829+
# Whether to enable or disable NextJS dev indicator.
830+
next_dev_indicators: bool = False
831+
829832
# Whether to use React strict mode in nextJS
830833
react_strict_mode: bool = True
831834

reflex/constants/installer.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
from __future__ import annotations
44

5+
import os
56
from types import SimpleNamespace
67

78
from .base import IS_WINDOWS
@@ -84,7 +85,7 @@ class Commands(SimpleNamespace):
8485
"@emotion/react": "11.14.0",
8586
"axios": "1.8.3",
8687
"json5": "2.2.3",
87-
"next": "15.0.4",
88+
"next": os.getenv("NEXTJS_VERSION", "15.2.4"),
8889
"next-sitemap": "4.2.3",
8990
"next-themes": "0.4.6",
9091
"react": "19.0.0",

reflex/utils/prerequisites.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1067,6 +1067,7 @@ def _update_next_config(
10671067
"compress": config.next_compression,
10681068
"trailingSlash": True,
10691069
"staticPageGenerationTimeout": config.static_page_generation_timeout,
1070+
"devIndicators": config.next_dev_indicators,
10701071
}
10711072
if transpile_packages:
10721073
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)