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

Add soft deprecations #737

Merged
merged 2 commits into from
Feb 19, 2024
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
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
later deprecated in favor of their LiveView built-in counterparts.
* Scope-aware context as described in https://surface-ui.org/contexts#scope-aware-context will
be deprecaded and fully removed in `v0.13`. The reason is the lack of built-in support for that
feature in Liveview itself, which leads to unefficient diff-tracking when using it. Global context
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.

Expand Down
9 changes: 9 additions & 0 deletions lib/surface/components/context.ex
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
defmodule Surface.Components.Context do
@moduledoc """
> #### Soft deprecation warning {: .warning}
>
> Using this module as a component with `<Context>` 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.
"""
Expand Down
8 changes: 8 additions & 0 deletions lib/surface/components/live_patch.ex
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
defmodule Surface.Components.LivePatch do
@moduledoc """
> #### 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.

Defines a link that will **patch** the current LiveView.

Provides similar capabilities to Phoenix's built-in `live_patch/2`
Expand All @@ -12,6 +18,8 @@ defmodule Surface.Components.LivePatch do
`<LiveRedirect>` instead.
"""

@moduledoc deprecated: "Use liveview's built-in `<.link>` instead"

use Surface.Component

@doc "The required path to link to"
Expand Down
8 changes: 8 additions & 0 deletions lib/surface/components/live_redirect.ex
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
defmodule Surface.Components.LiveRedirect do
@moduledoc """
> #### 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.

Defines a link that will **redirect** to a new LiveView.

Provides similar capabilities to Phoenix's built-in `live_redirect/2`
Expand All @@ -12,6 +18,8 @@ defmodule Surface.Components.LiveRedirect do
it, use `<LivePatch>` instead.
"""

@moduledoc deprecated: "Use liveview's built-in `<.link>` instead"

use Surface.Component

@doc "The required path to link to"
Expand Down
Loading