Prechádzať zdrojové kódy

Remove deprecated route decorator (#1815)

Elijah Ahianyo 1 rok pred
rodič
commit
796f523c03
2 zmenil súbory, kde vykonal 0 pridanie a 46 odobranie
  1. 0 1
      reflex/__init__.py
  2. 0 45
      reflex/route.py

+ 0 - 1
reflex/__init__.py

@@ -37,7 +37,6 @@ from .middleware import Middleware as Middleware
 from .model import Model as Model
 from .model import session as session
 from .page import page as page
-from .route import route as route
 from .state import ComputedVar as var
 from .state import Cookie as Cookie
 from .state import LocalStorage as LocalStorage

+ 0 - 45
reflex/route.py

@@ -5,51 +5,6 @@ from __future__ import annotations
 import re
 
 from reflex import constants
-from reflex.event import EventHandler
-from reflex.page import page
-from reflex.utils.console import deprecate
-
-
-def route(
-    route: str | None = None,
-    title: str | None = None,
-    image: str | None = None,
-    description: str | None = None,
-    on_load: EventHandler | list[EventHandler] | None = None,
-):
-    """Decorate a function as a page.
-
-    rx.App() will automatically call add_page() for any method decorated with route
-    when App.compile is called.
-
-    All defaults are None because they will use the one from add_page().
-
-    Note: the decorated functions still need to be imported.
-
-    Args:
-        route: The route to reach the page.
-        title: The title of the page.
-        image: The favicon of the page.
-        description: The description of the page
-        on_load: The event handler(s) called when the page load.
-
-    Returns:
-        The decorated function.
-    """
-    deprecate(
-        feature_name="@rx.route",
-        deprecation_version="0.2.3",
-        reason="and is being replaced by @rx.page due to enhanced routing features.",
-        removal_version="0.2.8",
-    )
-
-    return page(
-        route=route,
-        title=title,
-        image=image,
-        description=description,
-        on_load=on_load,
-    )
 
 
 def verify_route_validity(route: str) -> None: