File tree Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Original file line number Diff line number Diff line change @@ -1928,6 +1928,37 @@ TIP: If you're into SemVer, it's a good idea to omit the patch version.
1928
1928
This means you should use `0.5` instead of `0.5.0`. This applies
1929
1929
for all metadata data that's version related.
1930
1930
1931
+ === `:superseded-by`
1932
+
1933
+ Often you'd combine `:deprecated` with `:superseded-by`, as there would be
1934
+ some newer API that supersedes whatever got deprecated.
1935
+
1936
+ Typically for vars you'll use a non-qualified name if the replacement lives
1937
+ in the same namespace, and a fully-qualified name otherwise.
1938
+
1939
+ [source,clojure]
1940
+ ----
1941
+ ;; in case we have a version
1942
+ (def ^{:deprecated "0.5"
1943
+ :superseded-by "bar"} foo
1944
+ "Use `bar` instead.
1945
+ 42)
1946
+
1947
+ (ns foo.bar
1948
+ "A deprecated ns."
1949
+ {:deprecated "0.8"
1950
+ :superseded-by "foo.baz"})
1951
+
1952
+ (defn ^{:deprecated "0.5"
1953
+ :superseded-by "bar"} foo
1954
+ (bar))
1955
+
1956
+ ;; otherwise
1957
+ (defn ^{:deprecated true
1958
+ :superseded-by "bar"} foo
1959
+ (bar))
1960
+ ----
1961
+
1931
1962
=== `:added`
1932
1963
1933
1964
The most common way to document when a public API was added to a
You can’t perform that action at this time.
0 commit comments