Skip to content

Commit

Permalink
add config knob for react_strict_mode. default to True. also cleanup …
Browse files Browse the repository at this point in the history
…unused code (#3389)
  • Loading branch information
Lendemor authored May 29, 2024
1 parent 4b939ca commit c7064b9
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 128 deletions.
3 changes: 3 additions & 0 deletions reflex/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,9 @@ class Config:
# Whether to enable or disable nextJS gzip compression.
next_compression: bool = True

# Whether to use React strict mode in nextJS
react_strict_mode: bool = True

# Additional frontend packages to install.
frontend_packages: List[str] = []

Expand Down
112 changes: 0 additions & 112 deletions reflex/config.pyi

This file was deleted.

2 changes: 0 additions & 2 deletions reflex/constants/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
)
from .config import (
ALEMBIC_CONFIG,
PRODUCTION_BACKEND_URL,
Config,
Expiration,
GitIgnore,
Expand Down Expand Up @@ -99,7 +98,6 @@
Ping,
POLLING_MAX_HTTP_BUFFER_SIZE,
PYTEST_CURRENT_TEST,
PRODUCTION_BACKEND_URL,
Reflex,
RELOAD_CONFIG,
RequirementsTxt,
Expand Down
15 changes: 1 addition & 14 deletions reflex/utils/prerequisites.py
Original file line number Diff line number Diff line change
Expand Up @@ -332,19 +332,6 @@ def parse_redis_url() -> str | dict | None:
return dict(host=redis_url, port=int(redis_port), db=0)


def get_production_backend_url() -> str:
"""Get the production backend URL.
Returns:
The production backend URL.
"""
config = get_config()
return constants.PRODUCTION_BACKEND_URL.format(
username=config.username,
app_name=config.app_name,
)


def validate_app_name(app_name: str | None = None) -> str:
"""Validate the app name.
Expand Down Expand Up @@ -625,7 +612,7 @@ def _update_next_config(
next_config = {
"basePath": config.frontend_path or "",
"compress": config.next_compression,
"reactStrictMode": True,
"reactStrictMode": config.react_strict_mode,
"trailingSlash": True,
}
if transpile_packages:
Expand Down

0 comments on commit c7064b9

Please sign in to comment.