Skip to content

Commit 4347c30

Browse files
authored
nextjs 15.3 (#5125)
* nextjs 15.3 * do something different
1 parent 63960ec commit 4347c30

File tree

2 files changed

+13
-7
lines changed

2 files changed

+13
-7
lines changed

reflex/constants/installer.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ class Node(SimpleNamespace):
7575

7676

7777
def _determine_nextjs_version() -> str:
78-
default_version = "15.2.4"
78+
default_version = "15.3.0"
7979
if (version := os.getenv("NEXTJS_VERSION")) and version != default_version:
8080
from reflex.utils import console
8181

@@ -92,9 +92,9 @@ class PackageJson(SimpleNamespace):
9292
class Commands(SimpleNamespace):
9393
"""The commands to define in package.json."""
9494

95-
DEV = "next dev"
96-
EXPORT = "next build"
97-
EXPORT_SITEMAP = "next build && next-sitemap"
95+
DEV = "next dev {flags}"
96+
EXPORT = "next build {flags}"
97+
EXPORT_SITEMAP = "next build {flags} && next-sitemap"
9898
PROD = "next start"
9999

100100
PATH = "package.json"

reflex/utils/prerequisites.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
from reflex.compiler import templates
3939
from reflex.config import Config, environment, get_config
4040
from reflex.utils import console, net, path_ops, processes
41+
from reflex.utils.decorator import once
4142
from reflex.utils.exceptions import (
4243
GeneratedCodeHasNoFunctionDefsError,
4344
SystemPackageMissingError,
@@ -987,16 +988,21 @@ def initialize_web_directory():
987988
init_reflex_json(project_hash=project_hash)
988989

989990

991+
@once
990992
def _turbopack_flag() -> str:
991993
return " --turbopack" if environment.REFLEX_USE_TURBOPACK.get() else ""
992994

993995

994996
def _compile_package_json():
995997
return templates.PACKAGE_JSON.render(
996998
scripts={
997-
"dev": constants.PackageJson.Commands.DEV + _turbopack_flag(),
998-
"export": constants.PackageJson.Commands.EXPORT,
999-
"export_sitemap": constants.PackageJson.Commands.EXPORT_SITEMAP,
999+
"dev": constants.PackageJson.Commands.DEV.format(flags=_turbopack_flag()),
1000+
"export": constants.PackageJson.Commands.EXPORT.format(
1001+
flags=_turbopack_flag()
1002+
),
1003+
"export_sitemap": constants.PackageJson.Commands.EXPORT_SITEMAP.format(
1004+
flags=_turbopack_flag()
1005+
),
10001006
"prod": constants.PackageJson.Commands.PROD,
10011007
},
10021008
dependencies=constants.PackageJson.DEPENDENCIES,

0 commit comments

Comments
 (0)