Skip to content

Commit 049f009

Browse files
committed
do not run nextjs check on import
1 parent c849cd8 commit 049f009

2 files changed

Lines changed: 22 additions & 15 deletions

File tree

reflex/app.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1019,11 +1019,13 @@ def _get_frontend_packages(self, imports: dict[str, set[ImportVar]]):
10191019
Example:
10201020
>>> _get_frontend_packages({"react": "16.14.0", "react-dom": "16.14.0"})
10211021
"""
1022+
dependencies = constants.PackageJson.DEPENDENCIES
1023+
dev_dependencies = constants.PackageJson.DEV_DEPENDENCIES
10221024
page_imports = {
10231025
i
10241026
for i, tags in imports.items()
1025-
if i not in constants.PackageJson.DEPENDENCIES
1026-
and i not in constants.PackageJson.DEV_DEPENDENCIES
1027+
if i not in dependencies
1028+
and i not in dev_dependencies
10271029
and not any(i.startswith(prefix) for prefix in ["/", "$/", ".", "next/"])
10281030
and i != ""
10291031
and any(tag.install for tag in tags)

reflex/constants/installer.py

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -113,19 +113,24 @@ class Commands(SimpleNamespace):
113113

114114
_react_version = _determine_react_version()
115115

116-
DEPENDENCIES = {
117-
"@emotion/react": "11.14.0",
118-
"axios": "1.9.0",
119-
"json5": "2.2.3",
120-
"next": _determine_nextjs_version(),
121-
"next-sitemap": "4.2.3",
122-
"next-themes": "0.4.6",
123-
"react": _react_version,
124-
"react-dom": _react_version,
125-
"react-focus-lock": "2.13.6",
126-
"socket.io-client": "4.8.1",
127-
"universal-cookie": "7.2.2",
128-
}
116+
@classproperty
117+
@classmethod
118+
def DEPENDENCIES(cls) -> dict[str, str]:
119+
"""The dependencies to include in package.json."""
120+
return {
121+
"@emotion/react": "11.14.0",
122+
"axios": "1.9.0",
123+
"json5": "2.2.3",
124+
"next": _determine_nextjs_version(),
125+
"next-sitemap": "4.2.3",
126+
"next-themes": "0.4.6",
127+
"react": cls._react_version,
128+
"react-dom": cls._react_version,
129+
"react-focus-lock": "2.13.6",
130+
"socket.io-client": "4.8.1",
131+
"universal-cookie": "7.2.2",
132+
}
133+
129134
DEV_DEPENDENCIES = {
130135
"autoprefixer": "10.4.21",
131136
"postcss": "8.5.3",

0 commit comments

Comments
 (0)