Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions reflex/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -1019,11 +1019,13 @@ def _get_frontend_packages(self, imports: dict[str, set[ImportVar]]):
Example:
>>> _get_frontend_packages({"react": "16.14.0", "react-dom": "16.14.0"})
"""
dependencies = constants.PackageJson.DEPENDENCIES
dev_dependencies = constants.PackageJson.DEV_DEPENDENCIES
page_imports = {
i
for i, tags in imports.items()
if i not in constants.PackageJson.DEPENDENCIES
and i not in constants.PackageJson.DEV_DEPENDENCIES
if i not in dependencies
and i not in dev_dependencies
and not any(i.startswith(prefix) for prefix in ["/", "$/", ".", "next/"])
and i != ""
and any(tag.install for tag in tags)
Expand Down
35 changes: 22 additions & 13 deletions reflex/constants/installer.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,19 +113,28 @@ class Commands(SimpleNamespace):

_react_version = _determine_react_version()

DEPENDENCIES = {
"@emotion/react": "11.14.0",
"axios": "1.9.0",
"json5": "2.2.3",
"next": _determine_nextjs_version(),
"next-sitemap": "4.2.3",
"next-themes": "0.4.6",
"react": _react_version,
"react-dom": _react_version,
"react-focus-lock": "2.13.6",
"socket.io-client": "4.8.1",
"universal-cookie": "7.2.2",
}
@classproperty
@classmethod
def DEPENDENCIES(cls) -> dict[str, str]:
"""The dependencies to include in package.json.

Returns:
A dictionary of dependencies with their versions.
"""
return {
"@emotion/react": "11.14.0",
"axios": "1.9.0",
"json5": "2.2.3",
"next": _determine_nextjs_version(),
"next-sitemap": "4.2.3",
"next-themes": "0.4.6",
"react": cls._react_version,
"react-dom": cls._react_version,
"react-focus-lock": "2.13.6",
"socket.io-client": "4.8.1",
"universal-cookie": "7.2.2",
}

DEV_DEPENDENCIES = {
"autoprefixer": "10.4.21",
"postcss": "8.5.3",
Expand Down