Releases: elixir-lang/elixir
Releases · elixir-lang/elixir
v1.6.0
Official announcement: https://elixir-lang.org/blog/2018/01/17/elixir-v1-6-0-released/
1. Enhancements
EEx
- [EEx] Allow markers
/
and|
to be used in a custom EEx engine
Elixir
- [Calendar] Add truncate to
Time
,DateTime
andNaiveDateTime
to facilitate microsecond precision pruning - [Code] Add
format_string!/2
andformat_file!/2
for automatic code formatting - [Code] Support column annotations in quoted expressions with
columns: true
inCode.string_to_quoted/2
- [DynamicSupervisor] Add
DynamicSupervisor
designed to manage children that are added and removed dynamically - [Exception] Make
Exception.blame/3
extensible by adding an optionalblame/2
callback to exceptions - [Exception] Improve the printing of guards on blamed exceptions
- [Enumerable] Add
Enumerable.slice/1
and optimize manyEnum
operations with the new protocol. This allows data-structures with index-based random access to provide a non-linear implementation - [Inspect] Show UTF-8 BOM on inspected strings
- [Inspect.Algebra] Add
:strict
and:flex
breaks - this gives more control over the document fitting - [Inspect.Algebra] Allow a group to inherit the parent group break
- [Inspect.Algebra] Add
force_unfit/1
andnext_break_fits/2
which give more control over document fitting - [Inspect.Algebra] Add
collapse_lines/1
for collapsing multiple lines to a maximum value - [Inspect.Algebra] Allow
nest/2
to be:reset
or be set to the current:cursor
position - [Kernel] Prefix variables with V when emitting Erlang code. This improves the integration with tools such as Erlang code formatters and the GUI debugger
- [Kernel] Warn on the use of
length(x) == 0
in guards - [Kernel] Warn if
catch
comes beforerescue
in try - [Kernel] Warn if heredoc is outdented compared to its closing quotes
- [Kernel] Add
defguard/1
anddefguardp/1
to make it easier to build guard-safe macros - [Kernel.ParallelCompiler] Add
compile/2
,compile_to_path/3
andrequire/2
which provide detailed information about warnings and errors - [Kernel.SpecialForms] Support the
uniq: true
flag infor
comprehensions - [Module] Introduce
@deprecated
and@since
attributes - [List] Rearrange equals and inserts for shorter diff scripts in
List.myers_difference/2
- [Record] Allow
:macros
and:includes
to be given toRecord.extract/2
- [Stream] Add
Stream.intersperse/2
- [String] Update to Unicode 10
- [String] Allow passing empty string
match
toString.replace/4
- [String] Support context and language sensitive operations in
String.upcase/2
andString.downcase/2
. Currently only the:greek
context is supported - [String] Support
:ascii
conversion inString.upcase/2
andString.downcase/2
- [Time] Add
Time.add/3
ExUnit
- [ExUnit.Assertions] Perform inclusive checks in
assert_in_delta
- [ExUnit.Callbacks] Add
ExUnit.Callbacks.start_supervised!/2
- [ExUnit.Case] Generate a random seed per test based on the test suite seed
IEx
- [IEx.Autocomplete] Provide contextual autocompletion:
t Enum.
will autocomplete types,b Enum
will autocomplete callbacks - [IEx.CLI] Provide hints for developers when a bad host name is given to
--remsh
- [IEx.Helpers] Automatically include specs when showing documentation for functions/macros
- [IEx.Helpers] Improve formatting of behaviours and typespecs by using the formatter
- [IEx.Helpers] Allow pattern matching and guard expressions when on
IEx.break!
Logger
- [Logger] Add
:discard_threshold
to Logger to help with message queue overflow
Mix
- [mix app.start] Add
--preload-modules
tomix app.start
- [mix archive.build] Allow
mix archive.build
to bundle dot files via an option - [mix compile] Define a behavior for Mix compiler tasks and return diagnostics from compiler tasks
- [mix compile] Track struct dependencies between files and recompile them only if the struct changes
- [mix deps] Support
:system_env
option when specifying dependencies - [mix format] Add a
mix format
task that formats the given files (or the files specified in a.formatter.exs
file) - [mix profile.eprof] Add a new task for time-based profiling with eprof
- [mix test] Run all functions in a describe block by giving the
file:line
the describe block starts - [mix test] Report the top N slowest tests with the
--slowest N
flag - [mix test] Report the number of doctests and tests separately
- [mix xref] Support
--include-siblings
in reports for umbrella support - [mix xref] Add
mix xref graph --format stats
- [mix xref] Add
--only-nodes
and--label
filters to mix xref graph - [mix xref] Add
mix xref deprecated
that shows the callsite of deprecated functions
2. Bug fixes
Elixir
- [CLI] Support path with spaces as argument to elixir.bat
- [Inspect] Properly handle minus signal for non-decimal negative integers
- [Integer] Do not raise on non-integer values in
is_odd
/is_even
- [Kernel] Solve a precedence issue between
&
and|
, such as[&Foo.bar/1 | &Baz.bat/2]
- [Kernel] Do not load dynamic Elixir modules as
:in_memory
as this value is not officially supported by the code server. Instead, use an empty list, which is the same value used by Erlang. - [Kernel] Validate variable struct name is atom when used in pattern matching
- [Kernel] No longer generate documentation for
defdelegate
functions automatically to avoid overriding previously specified@doc
- [Macro] Fix
Macro.to_string/2
for tuple calls, such asalias Foo.{Bar, Baz}
- [MapSet] Return valid MapSet when unioning a legacy MapSet
- [Regex] Return a leading empty space when splitting on empty pattern. This makes the
split
operation consistent with the other operations in theRegex
module - [Stream] Ensure
Stream.chunk_while/4
does not emit more elements than necessary when halted - [String] Return a leading empty space when splitting on empty string. This makes the
split
operation consistent with the other operations in theString
module - [URI] Preserve empty fragments in
URI.parse/1
Mix
- [mix app.start] Improve the quality of reports if app fails to boot
- [mix cmd] Allow
mix cmd
to be invoked multiple times without marking it as executed - [mix deps] Ensure optional dependencies in umbrella applications are loaded
- [mix deps.update] Ensure transitive new non-Hex dependencies are also fetched when a repo is updated
- [mix xref] Take compile dependencies with higher priority than runtime ones when building a graph
- [mix xref] Handle external files for xref callers and warnings
3. Soft deprecations (no warnings emitted)
Elixir
- [GenServer] Warn if
init/1
is not defined inGenServer
. This brings GenServer closer to the implementation in OTP and aligns all behaviours to require theinit/1
callback - [Inspect.Algebra]
surround/3
andsurround_many/6
are deprecated in favor ofcontainer_doc/6
- [Kernel] Specifying map types with variable keys without defining the type as required/optional is deprecated
- [Kernel.ParallelCompiler]
files/2
andfiles_to_path/3
are deprecated in favor ofcompile/2
andcompile_to_path/3
- [Kernel.ParallelRequire]
files/2
is deprecated in favor ofKernel.ParallelCompiler.require/2
- [Supervisor] The
:simple_one_for_one
strategy is deprecated in favor ofDynamicSupervisor
- [Supervisor] Passing a list of args to
Supervisor.start_child/2
is deprecated in favor ofDynamicSupervisor
- [Task.Supervisor] Passing
:restart
and:shutdown
toTask.Supervisor.start_link/2
is deprecated (it should be passed on start child instead)
ExUnit
- [ExUnit.Formatter]
:case_started
and:case_finished
events are deprecated in favor of:module_started
and:module_finished
Mix
- [Mix.Compilers.Erlang] Returning
{:ok, val} | :error
from custom Erlang compilers is deprecated in favor of{:ok, val, warnings} | {:error, errors, warnings}
4. Deprecations
Elixir
- [Enum]
Enum.partition/2
is deprecated in favor ofEnum.split_with/2
- [Keyword]
Keyword.replace/3
is deprecated in favor ofKeyword.fetch/2
andKeyword.put/3
- [Map]
Map.replace/3
is deprecated in favor ofMap.fetch/2
andMap.put/3
- [Macro]
Macro.unescape_tokens/1
andMacro.unescape_tokens/2
are deprecated in favor ofEnum.map/2
- [Range] Deprecate
Range.range?/1
in favor of pattern matching on_ .. _
v1.6.0-rc.1
Release v1.6.0-rc.1
v1.6.0-rc.0
Release v1.6.0-rc.0
v1.5.3
1. Bug fixes
Elixir
- [Calendar] Consider microseconds in maximum possible Calendar.ISO datetime
- [Enum] Fix
chunk_every/4
whenstep > count
- [Kernel] Warn duplicate definitions in macros
- [Kernel] Remove dialyzer warnings from else in with clauses
- [Kernel] Do not warning on upcoming
@deprecated
and@since
attributes for v1.6 - [MapSet] Return valid MapSet when union-ing a legacy MapSet
ExUnit
- [ExUnit] Fix compiler warnings in
assert_receive/3
v1.5.2
1. Enhancements
Elixir
- [Kernel] Optimize function definition with multiple clauses by not traversing the internal clauses table
- [Kernel] Warn if unary operators are followed by new lines
- [Registry] Use the name of the Registry as its
:id
in thechild_spec/1
function
2. Bug fixes
Elixir
- [DateTime] Fix negative microsecond result when passing negative Unix epochs to
from_unix/2
- [Kernel] Improve error message for oversized atoms
- [Kernel] Ensure
@impl
attribute also propagates to clauses from default arguments - [Kernel] Emit proper error for unknown vars inside binary pattern in match
IEx
- [IEx] Do not crash IEx unexpectedly on
System.stop/0
- [IEx.Helpers] Ensure exiting a breakpoint set inside a breakpoint does not terminate the shell unexpectedly
Mix
- [mix local.hex] Ensure
--if-missing
flag works as advertised - [mix test] Do not trigger additional error reports when there is a failure when loading test files
- [Mix.SCM.Git] Ensure errors when invoking
git
propagate correctly
v1.5.1
1. Enhancements
EEx
- [EEx.Engine] Add
handle_begin
andhandle_end
to EEx
Elixir
- [Kernel] Do not use references on function/macro definitions - this provides large improvements in compilation times in some rare corner cases
- [Supervisor] Support mixing old and new typespecs in
Supervisor.init/2
andSupevisor.start_link/2
Mix
- [mix profile.*] Allow profile tasks to run without a project
2. Bug fixes
EEx
- [EEx.Engine] Do not re-use the value of the
init/1
callback throughout the compilation stack
Elixir
- [Kernel] Ensure dialyzer does not emit warnings in some uses of
with
- [Kernel] Fix dialyzer warnings when
defmacrop
is used in modules - [Kernel] Ensure Elixir modules can be dialyzed without starting the Elixir application
- [Kernel] Do not serialize references in quoted expressions
- [Kernel] Make sure structs expansion use the latest definition available when struct modules are recompiled
- [Task] Support
:infinity
timeout on Task streams - [Typespec] Ensure typespecs allow
tuple
to be used as variable names
v1.5.0
Official announcement: https://elixir-lang.org/blog/2017/07/25/elixir-v1-5-0-released/
1. Enhancements
Elixir
- [Access] Optimize
Access.get/2
- [Base] Optimize Base encode/decode
- [Calendar] Implement Inspect for DateTime with Calendar.ISO
- [Calendar] Add "ISO days" format for conversions between Calendars and
Date.convert/2
,Time.convert/2
,NaiveDateTime.convert/2
andDateTime.convert/2
(as well as bang variants) - [Calendar] Add
:calendar
field toTime
struct - [Calendar] Add
Time.diff/3
,Date.add/2
,Date.diff/2
,DateTime.diff/3
- [Calendar] Add
Date.range/2
- [Calendar] Add
Date.new/4
,DateTime.utc_now/1
,NaiveDateTime.new/8
andTime.new/5
that allow specifing calendar - [Enum] Add
Enum.chunk_by/4
andStream.chunk_by/4
- [Enum] Add
Enum.chunk_every/2
andEnum.chunk_every/4
with a more explicit API thanEnum.chunk/2
andEnum.chunk/4
- [Exception] Add
Exception.blame/3
that adds metadata to exceptions - [File] Add
File.read_link/1
andFile.read_link!/1
- [File] Introduce
:trim_bom
option forFile.stream!/2
- [Inspect] Add
:printable_limit
to control the limit of printable structures - [Integer] Add
Integer.gcd/2
- [Kernel] Add
left not in right
to check that the left side is not in the enumerable on the right - [Kernel] Use the new
debug_info
chunk in OTP 20. This provides a mechanism for tools to retrieve the Elixir AST from beam files - [Kernel]
defoverridable/1
accepts a module name as argument and marks all callbacks as overridable - [Kernel] Allow non-quoted Unicode atoms and variables according to Unicode Annex #31 (see Unicode Syntax document)
- [Kernel] Warn when a
:__struct__
key is used when building/updating structs - [Kernel] Cache the AST on definitions. This speeds up the compilation time from 10% to 15% measured across different projects
- [Kernel] Improve compiler error message on invalid patterns and guards
- [Keyword] Add
replace/3
andreplace!/3
for replacing an existing key - [List]
List.starts_with?/2
- [Macro] Introduce
Macro.generate_arguments/2
- [Map] Optimize
Map.merge/3
by choosing merging direction - [Map] Add
replace/3
andreplace!/3
for replacing an existing key - [Map] Raise
BadMapError
inMap.equal?/2
when either of the two arguments is not a map - [MapSet] Reduce
MapSet
size when serialized to approximately half - [Process] Add
Process.cancel_timer/2
- [Protocol] Show available implementations on
Protocol.UndefinedError
if the protocol has been consolidated - [Registry] Support ETS guard conditions in
Registry.match/3
- [Registry] Support
parallel: true
inRegistry.dispatch/3
- [Registry] Introduce
Registry.unregister_match/4
- [Stream] Add
Stream.chunk_every/2
andStream.chunk_every/4
with a more explicit API thanStream.chunk/2
andStream.chunk/4
- [String] Optimise binary pattern matching in
String.split/1
andString.trim_*/1
- [Supervisor] Add
Supervisor.init/2
andSupervisor.child_spec/2
- [Supervisor] Allow
module
and{module, arg}
to be given toSupervisor.start_link/2
and invokemodule.child_spec(arg)
on each argument - [Task] Support
:on_timeout
inTask.async_stream
to control how tasks are terminated - [Task] Add
ordered: false
support toTask.async_stream
ExUnit
- [ExUnit] Show code snippet from test source file in case of test errors
- [ExUnit] Use
Exception.blame/3
when formatting test errors - [ExUnit] Make
assert_raise/2
fail if the underlying exception has a brokenmessage/1
implementation - [ExUnit] Add
start_supervised/2
andstop_supervised/1
to ExUnit. Processes started by this function are automatically shut down when the test exits
IEx
- [IEx.Autocomplete] Support autocompletion of variable names
- [IEx.Autocomplete] Support autocompletion of functions imported using
import Mod, only: [...]
- [IEx.Evaluator] Use
Exception.blame/3
when showing errors in the terminal - [IEx.Helpers] Add
exports/1
IEx helper to list all exports in a module - [IEx.Helpers] Add
break!/2
,break!/4
,breaks/0
,continue/0
,open/0
,remove_breaks/0
,remove_breaks/1
,reset_break/1
,reset_break/3
andwhereami/1
for code debugging - [IEx.Helpers] No longer emit warnings for IEx commands without parentheses
- [IEx.Helpers] Add
runtime_info/0
for printing runtime system information - [IEx.Helpers] Add
open/1
to open the source of a given module/function in your editor - [IEx.Info] Implement
IEx.Info
protocol for calendar types
Logger
- [Logger] Add
metadata: :all
configuration to log all metadata
Mix
- [mix compile.elixir] Add
--all-warnings
option to Elixir compiler that shows all warnings from the previous compilation (instead of just of the files being compiled) - [mix escript.build] Strip debug information from escripts by default and add option
:strip_beam
which defaults to true - [mix loadpaths] Ensure
--no-deps-check
do not trigger SCM callbacks (such asgit
) - [mix local.hex] Add
--if-missing
flag tolocal.hex
mix task - [mix profile.cprof] Add
Mix.Tasks.Profile.Cprof
for count-based profiling - [mix new] New styling for generated applications
2. Bug fixes
Elixir
- [Calendar] Ensure
Calendar.ISO
raises a readable error when reaching up the year 10000 restriction - [Calendar] Return
{:error, :invalid_time}
for wrong precision instead of crashing when parsing ISO dates - [Enumerable] Raise
Protocol.UndefinedError
on bad functions in Enumerable implementation - [File] Ensure recursive file operations raise on paths with null bytes (security issue reported by Griffin Byatt)
- [File] Support
:ram
/:raw
files inFile.copy/2
- [Inspect] Do not use colors when inspecting error messages
- [Kernel] Support guards on anonymous functions of zero arity
- [Kernel] Fix compilation of maps used as maps keys inside matches
- [Kernel] Ensure
do
clause inwith
is tail call optimizable - [Module]
on_definition/6
callback receives body wrapped in a keyword list, such as[do: body]
. This solves a bug where it was impossible to distinguish between a bodyless clause and a function that returnsnil
. - [Path] Ensure recursive path operations raise on paths with null bytes (security issue reported by Griffin Byatt)
- [Protocol] Do not lose source compile info on protocol consolidation
- [Record] Properly escape quoted expressions passed to
defrecord
- [Regex] Fix
inspect/2
for regexes with/
terminator in them - [Registry] Ensure
Registry.match/4
works with:_
as key - [Stream] Fix stream cycle over empty enumerable
- [String] Consider Unicode non-characters valid according to the specification in
String.valid?/1
- [StringIO] Fix encoding and performance issues in
StringIO.get_until
- [System] Raise on paths with null bytes in
System.cmd/2
and inSystem.find_executable/1
(security issue reported by Griffin Byatt) - [System] Raise on ill-formed environment variables (security issue reported by Griffin Byatt)
ExUnit
- [ExUnit] Properly account failed tests when
setup_all
fails
IEx
- [IEx] Skip autocompletion of module names that are invalid without being quoted
- [IEx] Skip autocompletion of functions with default arguments with
@doc false
- [IEx] Do not start oldshell alongside IEx
Mix
- [mix compile.elixir] Store multiple sources in case of module conflicts. This solves an issue where
_build
would get corrupted when compiling Elixir projects with module conflicts - [mix compile.erlang] Do not silently discard Erlang compile errors
- [mix compile.erlang] Properly track
-compile
module attribute when specified as a list - [mix compile.protocols] Ensure protocol implementations do not "disappear" when switching between applications in umbrella projects by having separate consolidation paths per project
- [mix compile.protocols] Do not raise when consolidating a protocol that was converted into a module
3. Soft deprecations (no warnings emitted)
Elixir
- [Kernel]
not left in right
is soft-deprecated in favor ofleft not in right
4. Deprecations
Elixir
Atom.to_char_list/1
,Float.to_char_list/1
,Integer.to_char_list/1
,Integer.to_char_list/2
,Kernel.to_char_list/1
,List.Chars.to_char_list/1
,String.to_char_list/1
have been deprecated in favor of theirto_charlist
version. This aligns with the naming conventions in both Erlang and Elixir- [Enum] Deprecate
Enum.filter_map/3
in favor ofEnum.filter/2
+Enum.map/2
or for-comprehensions - [GenEvent] Deprecate
GenEvent
and provide alternatives in its docs - [Kernel] Using
()
to meannil
is deprecated - [Kernel]
:as_char_lists value
inInspect.Opts.t/0
type, in favor of:as_charlists
- [Kernel]
:char_lists
key inInspect.Opts.t/0
type, in favor of:charlists
- [Module] Using Erlang parse transforms via
@compile {:parse_transform, _}
is deprecated - [Stream] Deprecate
Stream.filter_map/3
in favor ofStream.filter/2
+Stream.map/2
- [String]
String.ljust/3
andString.rjust/3
are deprecated in favor ofString.pad_leading/3
andString.pad_trailing/3
with a binary padding - [String]
String.strip/1
andString.strip/2
are deprecated in favor ofString.trim/1
andString.trim/2
- [String]
String.lstrip/1
andString.rstrip/1
are deprecated in favor ofString.trim_leading/1
andString.trim_trailing/1
- [String]
String.lstrip/2
andString.rstrip/2
are deprecated in favor ofString.trim_leading/2
andString.trim_trailing/2
with a binary as second argument - [Typespec]
char_list/0
type is deprecated in favor of `...
v1.5.0-rc.2
Release v1.5.0-rc.2
v1.5.0-rc.1
Release v1.5.0-rc.1
v1.5.0-rc.0
Release v1.5.0-rc.0