v1.17.0
Official announcement: https://elixir-lang.org/blog/2024/06/12/elixir-v1-17-0-released/
1. Enhancements
Elixir
- [Access] Add
Access.find/1that mirrorsEnum.find/2 - [Code] Support cursor inside fn/rescue/catch/else/after inside
Code.Fragment.container_cursor_to_quoted/2 - [Date] Add
Date.shift/2to shift dates with duration and calendar-specific semantics - [Date] Allow
Dateto accept years outside of-9999..9999range - [DateTime] Add
DateTime.shift/2to shift datetimes with duration and calendar-specific semantics - [Duration] Add a new
Durationdata type - [GenServer] Add
c:GenServer.format_status/1callback - [Kernel] Add
Kernel.get_in/1with safe nil-handling for access and structs - [Kernel] Add
Kernel.is_non_struct_map/1guard - [Kernel] Add
Kernel.to_timeout/1 - [Kernel] Emit warnings for undefined functions from modules defined within the same context as the caller code
- [Kernel] Support integers in uppercase sigils
- [Keyword] Add
Keyword.intersect/2-3to mirror theMapAPI - [Macro] Add
Macro.Env.define_alias/4,Macro.Env.define_import/4,Macro.Env.define_require/4,Macro.Env.expand_alias/4,Macro.Env.expand_import/5, andMacro.Env.expand_require/6to aid the implementation of language servers and embedded languages - [NaiveDateTime] Add
NaiveDateTime.shift/2to shift naive datetimes with duration and calendar-specific semantics - [Process] Add
Process.set_label/1 - [String] Add
String.byte_slice/3to slice a string to a maximum number of bytes while keeping it UTF-8 encoded - [System] Support
use_stdio: falseinSystem.cmd/3andSystem.shell/2 - [Time] Add
Time.shift/2to shift times with duration and calendar-specific semantics
ExUnit
- [ExUnit] Propagate the test process itself as a caller in
start_supervised - [ExUnit] Include max cases in ExUnit reports
IEx
- [IEx.Helpers] Warns if
recompilewas called and the current working directory changed - [IEx.Helpers] Add
c/0as an alias tocontinue/0 - [IEx.Pry] Add
IEx.Pry.annotate_quoted/3to annotate a quoted expression with pry breakpoints
Logger
- [Logger] Format
:gen_statemreports using Elixir data structures - [Logger] Include process label in logger events
Mix
- [mix deps] Add
:depthoption toMix.SCM.Git, thus supporting shallow clones of Git dependencies - [mix deps] Warn if
:optionalis used in combination with:in_umbrella - [mix deps.get] Do not add optional dependency requirements if its parent dep was skipped
- [mix deps.tree] Add
--umbrella-onlytomix deps.tree - [mix profile.tprof] Add a new profiler, available on Erlang/OTP 27+, which can measure count, time, and heap usage
- [mix test] Add
mix test --breakpointsthat sets up a breakpoint before each test that will run - [mix test] Add
mix test --repeat-until-failureto rerun tests until a failure occurs - [mix test] Add
mix test --slowest-modulesto print slowest modules based on all of the tests they hold - [mix test] Generate cover HTML files in parallel
2. Bug fixes
Elixir
- [bin/elixir.bat] Improve handling of quotes and exclamation marks in flags
- [Code] Address a bug where AST nodes for
(a -> b)were not wrapped as part of the literal encoder - [Kernel] Resolve inconsistencies of how
..and...are handled at the AST level - [Kernel] Fix parsing precedence of ambiguous operators followed by containers
- [Kernel] Do not expand code in
quote bind_quoted: ...twice - [Kernel] Respect
:lineproperty when:fileis given as option toquote - [Kernel] Do not crash on
Macro.escape/2when passing a quote triplet without valid meta - [Kernel] Avoid double tracing events when capturing a function
- [Kernel] Fix a bug where captured arguments would conflict when a capture included a macro that also used captures
- [Module] Return default value in
Module.get_attribute/3for persisted attributes which have not yet been written to
IEx
- [IEx.Helpers] Update the history size whenever history is pruned
Mix
- [mix deps] Fix error message for diverged SCM definition in sibling
3. Soft deprecations (no warnings emitted)
Elixir
- [GenServer] Deprecate
c:GenServer.format_status/2callback to align with Erlang/OTP 25+
Mix
- [mix profile.cprof] Deprecated in favor of the new
mix profile.tprof - [mix profile.eprof] Deprecated in favor of the new
mix profile.tprof
4. Hard deprecations
Elixir
- [IO] Passing
:alltoIO.read/2andIO.binread/2is deprecated, pass:eofinstead - [Kernel] Single-quote charlists are deprecated, use
~cinstead - [Kernel] Deprecate escaping closing delimiter in uppercase sigils
- [Range]
left..rightwithout explicit steps inside patterns and guards is deprecated, writeleft..right//stepinstead - [Range] Decreasing ranges, such as
10..1without an explicit step is deprecated, write10..1//-1instead
ExUnit
- [ExUnit.Case]
register_test/4is deprecated in favor ofregister_test/6for performance reasons