Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Deprecations #1927

Merged
merged 2 commits into from
Oct 5, 2023
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
4 changes: 2 additions & 2 deletions reflex/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -407,8 +407,8 @@ def add_page(
console.deprecate(
feature_name="Passing script tags to add_page",
reason="Add script components as children to the page component instead",
deprecation_version="v0.2.9",
removal_version="v0.2.11",
deprecation_version="0.3.0",
removal_version="0.3.2",
)
component.children.extend(script_tags)

Expand Down
4 changes: 2 additions & 2 deletions reflex/components/base/script.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ def client_side(javascript_code) -> Var[EventChain]:
console.deprecate(
feature_name="rx.client_side",
reason="and has been replaced by rx.call_script, which can be used from backend EventHandler too",
deprecation_version="0.2.9",
removal_version="0.2.10",
deprecation_version="0.3.0",
removal_version="0.3.1",
)
return BaseVar(name=f"...args => {{{javascript_code}}}", type_=EventChain)
6 changes: 3 additions & 3 deletions reflex/components/component.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ def _create_event_chain(
feature_name="EventChain",
reason="to avoid confusion, only use yield API",
deprecation_version="0.2.8",
removal_version="0.2.9",
removal_version="0.3.1",
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pushing the deprecation dates back as it will require additional testing

)
events = []
for v in value:
Expand Down Expand Up @@ -296,7 +296,7 @@ def get_event_triggers(self) -> Dict[str, Any]:
feature_name=f"get_triggers ({self.__class__.__name__})",
reason="replaced by get_event_triggers",
deprecation_version="0.2.8",
removal_version="0.2.9",
removal_version="0.3.1",
)
deprecated_triggers = {
trigger: lambda: [] for trigger in deprecated_triggers
Expand All @@ -310,7 +310,7 @@ def get_event_triggers(self) -> Dict[str, Any]:
feature_name=f"get_controlled_triggers ({self.__class__.__name__})",
reason="replaced by get_event_triggers",
deprecation_version="0.2.8",
removal_version="0.2.9",
removal_version="0.3.1",
)

return {
Expand Down
4 changes: 2 additions & 2 deletions reflex/components/typography/markdown.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,8 @@ def create(cls, *children, **props) -> Component:
console.deprecate(
"rx.markdown custom_styles",
"Use the component_map prop instead.",
"0.2.9",
"0.2.11",
"0.3.0",
"0.3.2",
)

# Update the base component map with the custom component map.
Expand Down
10 changes: 5 additions & 5 deletions reflex/event.py
Original file line number Diff line number Diff line change
Expand Up @@ -333,8 +333,8 @@ def set_cookie(key: str, value: str) -> EventSpec:
console.deprecate(
feature_name=f"rx.set_cookie",
reason="and has been replaced by rx.Cookie, which can be used as a state var",
deprecation_version="0.2.9",
removal_version="0.2.10",
deprecation_version="0.3.0",
removal_version="0.3.1",
)
return server_side(
"_set_cookie",
Expand Down Expand Up @@ -375,8 +375,8 @@ def set_local_storage(key: str, value: str) -> EventSpec:
console.deprecate(
feature_name=f"rx.set_local_storage",
reason="and has been replaced by rx.LocalStorage, which can be used as a state var",
deprecation_version="0.2.9",
removal_version="0.2.10",
deprecation_version="0.3.0",
removal_version="0.3.1",
)
return server_side(
"_set_local_storage",
Expand Down Expand Up @@ -537,7 +537,7 @@ def call_event_handler(
feature_name="EVENT_ARG API for triggers",
reason="Replaced by new API using lambda allow arbitrary number of args",
deprecation_version="0.2.8",
removal_version="0.2.9",
removal_version="0.3.1",
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pushing this back for the same reason

)
if len(args) == 1:
return event_handler()
Expand Down
1 change: 0 additions & 1 deletion reflex/utils/console.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@ def warn(msg: str, **kwargs):
print(f"[orange1]Warning: {msg}[/orange1]", **kwargs)


# def deprecate(msg: str, **kwargs):
def deprecate(
feature_name: str,
reason: str,
Expand Down
4 changes: 2 additions & 2 deletions reflex/vars.py
Original file line number Diff line number Diff line change
Expand Up @@ -1464,8 +1464,8 @@ def get_local_storage(key: Var | str | None = None) -> BaseVar:
console.deprecate(
feature_name=f"rx.get_local_storage",
reason="and has been replaced by rx.LocalStorage, which can be used as a state var",
deprecation_version="0.2.9",
removal_version="0.2.10",
deprecation_version="0.3.0",
removal_version="0.3.1",
)
if key is not None:
if not (isinstance(key, Var) and key.type_ == str) and not isinstance(key, str):
Expand Down
Loading