Skip to content

Commit e79503e

Browse files
authored
restore get_decorated_pages behavior and deprecate it (#5194)
1 parent 43c081c commit e79503e

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

reflex/app.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1117,7 +1117,6 @@ def _apply_decorated_pages(self):
11171117
# Add the @rx.page decorated pages to collect on_load events.
11181118
for render, kwargs in DECORATED_PAGES[app_name]:
11191119
self.add_page(render, **kwargs)
1120-
DECORATED_PAGES[app_name].clear()
11211120

11221121
def _validate_var_dependencies(self, state: type[BaseState] | None = None) -> None:
11231122
"""Validate the dependencies of the vars in the app.

reflex/page.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
from reflex.config import get_config
1010
from reflex.event import EventType
11+
from reflex.utils import console
1112

1213
DECORATED_PAGES: dict[str, list] = defaultdict(list)
1314

@@ -76,6 +77,13 @@ def get_decorated_pages(omit_implicit_routes: bool = True) -> list[dict[str, Any
7677
Returns:
7778
The decorated pages.
7879
"""
80+
console.deprecate(
81+
"get_decorated_pages",
82+
reason="This function is deprecated and will be removed in a future version.",
83+
deprecation_version="0.7.9",
84+
removal_version="0.8.0",
85+
dedupe=True,
86+
)
7987
return sorted(
8088
[
8189
page_data

0 commit comments

Comments
 (0)