Releases: elixir-lang/elixir
Release list
v1.7.1
v1.7.1 (2018-07-26)
1. Bug fixes
Elixir
- [Calendar] Work-around a Dialyzer bug that causes it to loop for a long time, potentially indefinitely
Checksums
- Precompiled.zip SHA1: fb06a3d238b65705a0e36fe9c308eef3d8bb5d46
- Precompiled.zip SHA512: 75c1601d985988ecdfcd48892cde4058dd36e52a3aa1c2007290ce587d7fa131d066afc6c34ca9138cf66431de80369681c82cf6290c214853335471c1851deb
- Docs.zip SHA1: e1008908b0fb4e692893dcc5c745f1c219fced1e
- Docs.zip SHA512: d05d1df7d9dab315a96fd7c0a49214e743b6bbe66fbbc6a3d8933c37f9baa5995b061396254b55d8c6ce8d337ed1ae3fcc3f97e65dd1cd8be9d091ce3412e27a
v1.7.0
Elixir v1.7 is the last release to support Erlang/OTP 19. We recommend everyone to migrate to Erlang/OTP 20+.
Documentation metadata
Elixir v1.7 implements EEP 48. 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:
@moduledoc "A brand new module"
@moduledoc authors: ["Jane", "Mary"], since: "1.4.0"Passing metadata is supported on @doc, @moduledoc and @typedoc.
To access the new documentation format, developers should use Code.fetch_docs/1. The old documentation format is no longer available and the old Code.get_docs/2 function will return nil accordingly.
Tools like IEx and ExDoc have been updated to leverage the new format and show relevant metadata to users. While Elixir allows any metadata to be given, those tools currently exhibit only :deprecated and :since. Other keys may be shown in the future.
The __STACKTRACE__ construct
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:
try do
... something that may fail ...
rescue
e ->
log(e, System.stacktrace())
reraise(e, System.stacktrace())
endIn Elixir v1.7, this can be written as:
try do
... something that may fail ...
rescue
e ->
log(e, __STACKTRACE__)
reraise(e, __STACKTRACE__)
endThis change may also yield performance improvements in the future, since the lexical scope allows us to track precisely when a stacktrace is used and we no longer need to keep references to stacktrace entries after the try construct finishes.
Other parts of the exception system have been improved. For example, more information is provided in certain occurrences of ArgumentError, ArithmeticError and KeyError messages.
Erlang/OTP logger integration
Erlang/OTP 21 includes a new :logger module. Elixir v1.7 fully integrates with the new :logger and leverages its metadata system. The Logger.Translator mechanism has also been improved to export metadata, allowing custom Logger backends to leverage information such as:
-
:crash_reason- a two-element tuple with the throw/error/exit reason as first argument and the stacktrace as second -
:initial_call- the initial call that started the process -
:registered_name- the process registered name as an atom
We recommend Elixir libraries that previously hooked into Erlang's :error_logger to hook into Logger instead, in order to support all current and future Erlang/OTP versions.
Other Logger improvements
Previously, Logger macros such as debug, info, and so on would always evaluate their arguments, even when nothing would be logged. From Elixir v1.7, the arguments are only evaluated when the message is logged.
The Logger configuration system also accepts a new option called :compile_time_purge_matching that allows you to remove log calls with specific compile-time metadata. For example, to remove all logger calls from application :foo with level lower than :info, as well as remove all logger calls from Bar.foo/3, you can use the following configuration:
config :logger,
compile_time_purge_matching: [
[application: :foo, level_lower_than: :info],
[module: Bar, function: "foo/3"]
]ExUnit improvements
ExUnit has also seen its own share of improvements. Assertions such as assert some_fun(arg1, arg2, arg3) will now include the value of each argument in the failure report:
1) test function call arguments (TestOneOfEach)
lib/ex_unit/examples/one_of_each.exs:157
Expected truthy, got false
code: assert some_vars(1 + 2, 3 + 4)
arguments:
# 1
3
# 2
7
stacktrace:
lib/ex_unit/examples/one_of_each.exs:158: (test)
Furthermore, failures in doctests are now colored and diffed.
On the mix test side of things, there is a new --failed flag that runs all tests that failed the last time they ran. Finally, coverage reports generated with mix test --cover include a summary out of the box:
Generating cover results ...
Percentage | Module
-----------|--------------------------
100.00% | Plug.Exception.Any
100.00% | Plug.Adapters.Cowboy2.Stream
100.00% | Collectable.Plug.Conn
100.00% | Plug.Crypto.KeyGenerator
100.00% | Plug.Parsers
100.00% | Plug.Head
100.00% | Plug.Router.Utils
100.00% | Plug.RequestId
... | ...
-----------|--------------------------
77.19% | Total
1. Enhancements
Elixir
- [Calendar.ISO] Support negative dates in
Calendar.ISO - [Calendar] Add
Calendar.months_in_year/1callback - [Code] Add
Code.compile_file/2that compiles files without leaving footprints on the system - [Code] Add
Code.purge_compiler_modules/0that purges any compiler module left behind. This is useful for live systems dynamically compiling code - [Code] Add
Code.fetch_docs/1that returns docs in the EEP 48 format - [Date] Add
Date.months_in_year/1function - [DynamicSupervisor] Use the name of the
DynamicSupervisoras the ID whenever possible - [Exception] Provide "did you mean" suggestions on KeyError
- [Exception] Provide more information on ArithmeticError on Erlang/OTP 21+
- [Function] Add
Functionmodule withcapture/3,info/1andinfo/2functions - [GenServer] Support the new
handle_continue/2callback on Erlang/OTP 21+ - [IO.ANSI] Add cursor movement to
IO.ANSI - [Kernel] Support adding arbitrary documentation metadata by passing a keyword list to
@doc,@moduledocand@typedoc - [Kernel] Introduce
__STACKTRACE__to retrieve the current stacktrace insidecatch/rescue(this will be a requirement for Erlang/OTP 21+) - [Kernel] Raise on unsafe variables in order to allow us to better track unused variables (also known as imperative assignment / variable leakage)
- [Kernel] Warn when using
lengthto check if a list is not empty on guards - [Kernel] Add hints on mismatched
do/endand others pairs - [Kernel] Warn when comparing structs using the
>,<,>=and<=operators - [Kernel] Warn on unsupported nested comparisons such as
x < y < z - [Kernel] Warn if redefining documentation across clauses of the same definition
- [Kernel] Warn on unnecessary quotes around atoms, keywords and calls
- [Macro] Add
Macro.special_form?/2andMacro.operator?/2that returnstrueif the given name/arity is a special form or operator respectively - [Macro.Env] Add
Macro.Env.vars/1andMacro.Env.has_var?/2that gives access to environment data without accessing private fields - [Regex] Include endianness in the regex version. This allows regexes to be recompiled when an archive is installed in a system with a different endianness
- [Registry] Add
Registry.count/1andRegistry.count_match/4 - [String] Update to Unicode 11
- [StringIO] Add
StringIO.open/3 - [System] Use ISO 8601 in
System.build_info/0
ExUnit
- [ExUnit.Assertion] Print the arguments in error reports when asserting on a function call. For example, if
assert is_list(arg)fails, the argument will be shown in the report - [ExUnit.Diff] Improve diffing of lists when one list is a subset of the other
- [ExUnit.DocTest] Show colored diffs on failed doctests
- [ExUnit.Formatter] Excluded tests, via the
--excludeand--onlyflags, are now shown as "Excluded" in reports. Tests skipped via@tag :skipare now exclusively shown as "Skipped" and in yellow
IEx
- [IEx.Helpers] Add
use_if_available/2 - [IEx.Helpers] Allow
force: trueoption inrecompile/1 - [IEx.Helpers] Add
:allocatorspane toruntime_info/1 - [IEx.Helpers] Show documentation metadata in
h/1helpers
Logger
- [Logger] Ensure nil metadata is always pruned
- [Logger] Only evaluate Logger macro arguments when the message will be logged
- [Logger] Add
:compile_time_purge_matchingto purge logger calls that match certain compile time metadata, such as module names and application names - [Logger] Log to
:stderrif a backend fails and there are no other backends - [Logger] Allow translators to return custom metadata
- [Logger] Return
:crash_reason,:initial_calland:registered_nameas metadata in crash reports coming from Erlang/OTP
Mix
- [mix archive.install] Add support for the Hex organization via
--organization - [mix archive.uninstall] Support
--forceflag - [mix compile] Improve support for external build tools such as
rebar - [mix deps] Include
override: truein rebar dependencies to make the behaviour closer to how rebar3 works (although diverged deps are still marked as diverged) - [mix escript.install] Add support for the Hex organization via
--organization - [mix escript.uninstall] Support
--forceflag - [mix help] Also list aliases
- [mix local] Use ipv6 with auto fallback to ipv4 when downloading data
- [mix profile] Allow all profiling tasks to run programatically
- [mix test] Add
--failedoption that only runs previously failed tests - [mix test] Print coverage summary by default when the
--coverflag is given - [Mix.Project] Add
Mix.Project.clear_deps_cache/0 - [Mix.Project] Add
Mix.Project.config_mtime/0that caches the config mtime values to avoid filesystem access
2. Bug fixes
Elixir
- [IO.ANSI.Docs] Fix table column alignment when converting docs to ANSI escapes
- [Code] Ensure
string_to_quoted...
v1.7.0-rc.1
Release v1.7.0-rc.1
v1.7.0-rc.0
Release v1.7.0-rc.0
v1.6.6
This release supports Erlang/OTP 21.0 by removing all warnings and by properly supporting the new Erlang logger module.
Important! the Precompiled.zip attachment below is precompiled on the lowest supported Erlang/OTP version, which is Erlang/OTP 19.0. Therefore, if you want to run Elixir v1.6 with Erlang/OTP 21, we recommend you to compile Elixir from source.
1. Bug fixes
Elixir
- [Base] Do not raise when finding bad digits in
Base.decode32!withcase: :mixed - [Code] Preserve the user's choice when
fnis followed by a newline and it has only a single clause - [DynamicSupervisor] Properly account for restarting children in the
:max_childrenconfiguration - [String] Add performant impl for string upcase/downcase
:asciimode - [Task.Supervisor] Fix type spec for
start_child/4
Logger
- [Logger] Do not crash truncation when truncate is set to infinity
Mix
- [mix format] Match files starting with dot
v1.6.5
This release supports Erlang/OTP 21.0-rc by removing all warnings and by properly redirecting logger output. Note it is not guaranteed it will support Erlang/OTP 21.0 final.
1. Bug fixes
- [Code] Preserve the user's choice in the formatter on parens call with next break fits
- [Code] Preserve the user's choice in the formatter on calls without parens when we have one argument per line
- [Code] Fix formatting when there is a tilde in the first element of a bitstring
- [Kernel] Support specsdiff flag on
__info__spec clauses - [Kernel] Do not exclude hygienic vars in
defguard - [Kernel.SpecialForms] Mark
forcomprehensions as generated to avoid dialyzer warnings - [Macro] Make sure
Macro.to_string/2emits valid quoted expressions - [Task] Support
:infinitytimeout onTask.yield_many/2 - [Task.Supervisor] Do not crash spawning supervised tasks when the parent process is dead
- [URI] Fix parsing of URIs with trailing
?
v1.6.4
v1.6.3
1. Enhancements
Elixir
- [Code.Formatter] Support comments in the middle of pipelines,
whenand|expressions
2. Bug fixes
Elixir
- [Code.Formatter] Consider commas when breaking groups
- [Code.Formatter] Ensure proper precedence between
&and operators - [Code.Formatter] Consider
.formatter.exswhen formatting stdin
Logger
- [Logger.Translator] Ensure logger doesn't crash when reporting named
DynamicSupervisor
v1.6.2
1. Enhancements
Mix
- [mix compile.erlang] Teach Mix erlang compiler alternative spelling for
-behaviordeclaration - [mix format] Support the
:subdirectoriesconfiguration that points to other directories with their own.formatter.exsfile. This is useful in umbrella applications.mix new --umbrellahas also been changed to use this new configuration by default - [mix format] Include the current environment for missing dependency errors
2. Bug fixes
Elixir
- [Code.Formatter] Ensure
->does not exceed line length - [DynamicSupervisor] Properly tag error reports generated by dynamic supervisors so they can be properly translated by
Logger - [DynamicSupervisor] Consider extra arguments during child restart
- [Kernel] Ensure arguments given to a guard defined with
defguardare evaluated in the correct order - [Module] Do not remove docs for previous function declaration when
@impl trueis used - [Supervisor] Ensure
use Supervisorproperly adds the@behaviour Supervisorannotation
Mix
- [Mix.Shell] Bring back
Mix.Shell.cmd/2- this arity was defined via a default argument that was accidentally removed
v1.6.1
1. Enhancements
Elixir
- [DynamicSupervisor] Implement
child_spec/1for DynamicSupervisor - [Kernel] Raise better error messages on invalid map syntax
2. Bug fixes
Elixir
- [Code.Formatter] Only rearrange
not inoperator if explicitly opted-in - [Code.Formatter] Ensure do blocks do not exceed line length on calls with a single argument
- [Collectable] Support bitstrings in Collectable and for-comprehensions (regression in v1.6.0)
- [GenServer] Do not override user own
@optsattribute - [Enum] Reintroduce zipping of any enumerable of enumerables in
Enum.zip/1(regression in v1.6.0) - [Macro] Reorder kw blocks in
Macro.to_string/1to avoid warnings - [Protocol] Fix protocol consolidation when some chunks may be missing
- [Stream] Reintroduce zipping of any enumerable of enumerables in
Stream.zip/1(regression in v1.6.0) - [Supervisor] Do not override user own
@optsattribute - [Supervisor] Add
@specto second clause ofstart_link/2
ExUnit
- [ExUnit.Case] Reintroduce
:casein ExUnit setup/setup_all/test context