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
1 change: 0 additions & 1 deletion pyi_hashes.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
"reflex/components/core/__init__.pyi": "007170b97e58bdf28b2aee381d91c0c7",
"reflex/components/core/auto_scroll.pyi": "10c4cf71d0d0c1d46a8e1205bd119c11",
"reflex/components/core/banner.pyi": "3c07547afc4f215aefd5e5afa409aa25",
"reflex/components/core/client_side_routing.pyi": "57a7917e993f625c623bcef50b60b804",
"reflex/components/core/clipboard.pyi": "a844eb927d9bc2a43f5e88161b258539",
"reflex/components/core/debounce.pyi": "055da7aa890f44fb4d48bd5978f1a874",
"reflex/components/core/helmet.pyi": "43f8497c8fafe51e29dca1dd535d143a",
Expand Down
1 change: 0 additions & 1 deletion reflex/.templates/web/app/routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { route } from "@react-router/dev/routes";
import { flatRoutes } from "@react-router/fs-routes";

export default [
route("404", "routes/[404]._index.jsx", { id: "404" }),
...(await flatRoutes({
ignoredRouteFiles: ["routes/\\[404\\]._index.jsx"],
})),
Expand Down
45 changes: 0 additions & 45 deletions reflex/.templates/web/utils/client_side_routing.js

This file was deleted.

14 changes: 7 additions & 7 deletions reflex/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,6 @@
connection_toaster,
)
from reflex.components.core.breakpoints import set_breakpoints
from reflex.components.core.client_side_routing import (
default_404_page,
wait_for_client_redirect,
)
from reflex.components.core.sticky import sticky
from reflex.components.core.upload import Upload, get_upload_dir
from reflex.components.radix import themes
Expand Down Expand Up @@ -775,8 +771,10 @@ def add_page(

if route == constants.Page404.SLUG:
if component is None:
component = default_404_page
component = wait_for_client_redirect(self._generate_component(component))
from reflex.components.el.elements import span

component = span("404: Page not found")
component = self._generate_component(component)
title = title or constants.Page404.TITLE
description = description or constants.Page404.DESCRIPTION
image = image or constants.Page404.IMAGE
Expand Down Expand Up @@ -1312,7 +1310,9 @@ def memoized_toast_provider():
self.head_components,
html_lang=self.html_lang,
html_custom_attrs=(
{**self.html_custom_attrs} if self.html_custom_attrs else {}
{"suppressHydrationWarning": "true", **self.html_custom_attrs}
if self.html_custom_attrs
else {"suppressHydrationWarning": "true"}
),
)
)
Expand Down
70 changes: 0 additions & 70 deletions reflex/components/core/client_side_routing.py

This file was deleted.

2 changes: 2 additions & 0 deletions reflex/constants/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,8 @@ class ReactRouter(Javascript):
rf"(?:{DEV_FRONTEND_LISTENING_REGEX}|{PROD_FRONTEND_LISTENING_REGEX})(.*)"
)

SPA_FALLBACK = "__spa-fallback.html"


# Color mode variables
class ColorMode(SimpleNamespace):
Expand Down
4 changes: 2 additions & 2 deletions reflex/constants/installer.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ class Commands(SimpleNamespace):

DEV = "react-router dev --host"
EXPORT = "react-router build"
PROD = "serve ./build/client"
PROD = "sirv ./build/client --single 404.html --host"

PATH = "package.json"

Expand All @@ -127,7 +127,7 @@ def DEPENDENCIES(cls) -> dict[str, str]:
"react-router": cls._react_router_version,
"react-router-dom": cls._react_router_version,
"@react-router/node": cls._react_router_version,
"serve": "14.2.4",
"sirv-cli": "3.0.1",
"react": cls._react_version,
"react-helmet": "6.1.0",
"react-dom": cls._react_version,
Expand Down
2 changes: 1 addition & 1 deletion reflex/testing.py
Original file line number Diff line number Diff line change
Expand Up @@ -1008,7 +1008,7 @@ def _run_frontend(self):
/ reflex.constants.Dirs.STATIC
)
error_page_map = {
404: web_root / "404" / "index.html",
404: web_root / "404.html",
}
with Subdir404TCPServer(
("", 0),
Expand Down
4 changes: 4 additions & 0 deletions reflex/utils/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,10 @@ def build():
)
processes.show_progress("Creating Production Build", process, checkpoints)
_duplicate_index_html_to_parent_dir(wdir / constants.Dirs.STATIC)
path_ops.cp(
wdir / constants.Dirs.STATIC / constants.ReactRouter.SPA_FALLBACK,
wdir / constants.Dirs.STATIC / "404.html",
)


def setup_frontend(
Expand Down
Loading