From 2ed2ec7df319176c58eb0d8bc6689ebe8c9774d5 Mon Sep 17 00:00:00 2001 From: Marlus Saraiva Date: Mon, 19 Feb 2024 12:49:49 -0300 Subject: [PATCH] Update soft deprecated messages --- lib/surface/components/context.ex | 14 +++++++++----- lib/surface/components/live_patch.ex | 11 ++++++++--- lib/surface/components/live_redirect.ex | 11 ++++++++--- 3 files changed, 25 insertions(+), 11 deletions(-) diff --git a/lib/surface/components/context.ex b/lib/surface/components/context.ex index 344b70bf..baf69e5b 100644 --- a/lib/surface/components/context.ex +++ b/lib/surface/components/context.ex @@ -1,12 +1,16 @@ defmodule Surface.Components.Context do @moduledoc """ + > #### Soft deprecation warning {: .warning} + > + > Using this module as a component with `` has been deprecated. Support for + > scope-aware context will be removed in `v0.13` due to the lack of built-in support for + > the feature in Liveview itself, which leads to inefficient diff-tracking when using it. + > + > Global context related functions like `Context.put/3` and `Context.get/3`, as well as the `:from_context` + > option, will be kept and recommended as their usage don't affect diff-tracking negatively. + A built-in module and component that allows users to set and retrieve values to/from the context. - - > **Soft deprecation alert:** Scope-aware context will be deprecaded in the near future and fully removed - > in `v0.13`. The reason is the lack of built-in support for that feature in Liveview itself, which - > leads to inefficient diff-tracking when using it. Global context related functions like `Context.put` - > and `Context.get`, as well as the `:from_context` option, will be kept as their use don't affect diff-tracking negatively. """ use Surface.Component diff --git a/lib/surface/components/live_patch.ex b/lib/surface/components/live_patch.ex index 1df86fbf..6cd979c9 100644 --- a/lib/surface/components/live_patch.ex +++ b/lib/surface/components/live_patch.ex @@ -1,9 +1,12 @@ defmodule Surface.Components.LivePatch do @moduledoc """ - Defines a link that will **patch** the current LiveView. + > #### Soft deprecation warning {: .warning} + > + > This component has been deprecated in favor of liveview's built-in `<.link>` + > and will be removed in `v0.13`. See https://hexdocs.pm/phoenix_live_view/live-navigation.html for + > more info usage. - > **Soft deprecation alert:** This component has been deprecated in favor of liveview's built-in `<.link>` - > and will be removed in `v0.13`. See https://hexdocs.pm/phoenix_live_view/live-navigation.html for more info. + Defines a link that will **patch** the current LiveView. Provides similar capabilities to Phoenix's built-in `live_patch/2` function. @@ -15,6 +18,8 @@ defmodule Surface.Components.LivePatch do `` instead. """ + @moduledoc deprecated: "Use liveview's built-in `<.link>` instead" + use Surface.Component @doc "The required path to link to" diff --git a/lib/surface/components/live_redirect.ex b/lib/surface/components/live_redirect.ex index 5ef0a932..d327bb99 100644 --- a/lib/surface/components/live_redirect.ex +++ b/lib/surface/components/live_redirect.ex @@ -1,9 +1,12 @@ defmodule Surface.Components.LiveRedirect do @moduledoc """ - Defines a link that will **redirect** to a new LiveView. + > #### Soft deprecation warning {: .warning} + > + > This component has been deprecated in favor of liveview's built-in `<.link>` + > and will be removed in `v0.13`. See https://hexdocs.pm/phoenix_live_view/live-navigation.html for + > more info usage. - > **Soft deprecation alert:** This component has been deprecated in favor of liveview's built-in `<.link>` - > and will be removed in `v0.13`. See https://hexdocs.pm/phoenix_live_view/live-navigation.html for more info. + Defines a link that will **redirect** to a new LiveView. Provides similar capabilities to Phoenix's built-in `live_redirect/2` function. @@ -15,6 +18,8 @@ defmodule Surface.Components.LiveRedirect do it, use `` instead. """ + @moduledoc deprecated: "Use liveview's built-in `<.link>` instead" + use Surface.Component @doc "The required path to link to"