|
2 | 2 |
|
3 | 3 | Elixir v1.7 is the last release to support Erlang/OTP 19. We recommend everyone to migrate to Erlang/OTP 20+.
|
4 | 4 |
|
| 5 | +## Documentation metadata |
| 6 | + |
| 7 | +Elixir v1.7 implements [EEP 48](http://erlang.org/eep/eeps/eep-0048.html). EEP 48 aims to bring documentation interoperability across all languages running on the Erlang VM. The documentation format proposed by EEP 48 also supports metadata, which is now fully exposed to Elixir developers: |
| 8 | + |
| 9 | +```elixir |
| 10 | +@moduledoc "A brand new module" |
| 11 | +@moduledoc authors: ["Jane", "Mary"], since: "1.4.0" |
| 12 | +``` |
| 13 | + |
| 14 | +Currently Elixir supports two metadata keys: `:deprecated` and `:since`. Other keys will be added in the future. Passing metadata is supported on `@doc`, `@moduledoc` and `@typedoc`. |
| 15 | + |
| 16 | +To access the new documentation, developers should use `Code.fetch_docs/1`. The old documentation format is no longer available and the old `Code.get_docs/1` function will return `nil` accordingly. |
| 17 | + |
| 18 | +Tools like IEx and ExDoc have been updated to leverage the new format and show relevant metadata to users. |
| 19 | + |
5 | 20 | ## The `__STACKTRACE__` construct
|
6 | 21 |
|
7 | 22 | Erlang/OTP 21.0 introduces a new way to retrieve the stacktrace that is lexically scoped and no longer relies on side-effects like `System.stacktrace/0` does. Before one would write:
|
@@ -119,6 +134,7 @@ Percentage | Module
|
119 | 134 | * [Function] Add `Function` module with `capture/3`, `info/1` and `info/2` functions
|
120 | 135 | * [GenServer] Support the new `handle_continue/2` callback on Erlang/OTP 21+
|
121 | 136 | * [IO.ANSI] Add cursor movement to `IO.ANSI`
|
| 137 | + * [Kernel] Support adding arbitrary documentation metadata by passing a keyword list to `@doc`, `@moduledoc` and `@typedoc` |
122 | 138 | * [Kernel] Introduce `__STACKTRACE__` to retrieve the current stacktrace inside `catch`/`rescue` (this will be a requirement for Erlang/OTP 21+)
|
123 | 139 | * [Kernel] Raise on unsafe variables in order to allow us to better track unused variables
|
124 | 140 | * [Kernel] Warn when using `length` to check if a list is not empty on guards
|
@@ -146,6 +162,7 @@ Percentage | Module
|
146 | 162 | * [IEx.Helpers] Add `use_if_available/2`
|
147 | 163 | * [IEx.Helpers] Allow `force: true` option in `recompile/1`
|
148 | 164 | * [IEx.Helpers] Add `:allocators` pane to `runtime_info/1`
|
| 165 | + * [IEx.Helpers] Show documentation metadata in `h/1` helpers |
149 | 166 |
|
150 | 167 | #### Logger
|
151 | 168 |
|
@@ -179,6 +196,7 @@ Percentage | Module
|
179 | 196 | * [Code] Ensure `string_to_quoted` returns error tuples instead of raising in certain constructs
|
180 | 197 | * [Code.Formatter] Consistently format keyword lists in function calls with and without parens
|
181 | 198 | * [Code.Formatter] Do not break after `->` when there are only comments and one-line clauses
|
| 199 | + * [File] Allow the `:trim_bom` option to be used with `:encoding` |
182 | 200 | * [Kernel] Raise on unsafe variables as some of the code emitted with unsafe variables would not correctly propagate variables or would disable tail call optimization semantics
|
183 | 201 | * [Kernel] Do not crash on dynamic sizes in binary generators with collectable into in comprehensions
|
184 | 202 | * [Kernel] Do not crash on literals with non-unary size in binary generators with collectable into in comprehensions
|
|
0 commit comments