Releases: elixir-lang/elixir
Releases · elixir-lang/elixir
v1.2.6
1. Enhancements
- [Kernel] Support Erlang 19
- [Kernel] Supported generated: true in the
quote
special form
2. Bug fixes
- [Path] Fix a bug in path join with "/" followed by empty segments
- [String] Fix a bug in NFD normalization when followed by one-byte sized graphemes
- [Typespec] Correctly support
<<_::size, _::_*unit>>
syntax
v1.3.0-rc.0
Release v1.3.0-rc.0
v1.2.5
Bug fixes
- [Logger] Stringify truncated function data in Logger
- [Logger] Ensure poorly formatted char data can also be logged by using the replacement character "�" (diamond question mark)
- [Mix] Do not assume
@impl
is always a list - [String] Fix bugs in
String.replace_*
functions where it would not include the accumulated value for certain replacements
v1.2.4
Enhancements
- [Mix] Add
:archives
configuration todef project
that allows projects to list archive dependencies.--no-archives-check
(as well as--no-deps-check
) will disable the archive check. The:archives
option is not checked for dependencies. - [Mix] Add
deps.precompile
task as hook - [Mix] Support
--include-children
inmix deps.compile
option - [String] Update version of the Unicode database to 8.0.0
Bug fixes
- [Application] Ensure
spec/2
returns nil for unknown applications - [Integer] Fix a possible binary leak in
parse/1
- [Mix] Purge Erlang modules on recompilation
- [String] Ensure
split/1
does not break on non-breakable whitespace - [String] Ensure NFC and NFD normalization pass all of Unicode 8.0.0 tests
- [Version] Allow dots in build info for versions in
Version.parse/1
v1.2.3
Enhancements
- [Base] Add
:ignore
and:padding
option to encoding/decoding functions - [Mix] Add
Mix.Projects.deps_paths
that returns the dependencies path as a map
Bug fixes
- [ExUnit] Do not provide negative line numbers without generated annotation (for compatibility with Erlang 19)
- [Mix] Reject non fullfilled optional dependencies later on in the convergence resolution for proper dependency sorting
- [String] Fix incomplete data trimming on both
String.replace_trailing
andString.rstrip
- [String] Attach debug_info back into Unicode modules for Dialyzer support
v1.2.2
Enhancements
- [Kernel] Support
@compile {:autoload, false}
to disable automatic loading after compilation
Bug fixes
- [ExUnit] Raise if trying to override reserved tag in
setup
blocks - [Mix] Ensure retrieve compile manifests do fail if some compilers are not yet available
- [Mix] Automatically merge managers according to the mix > rebar3 > rebar > make order
- [Mix] Force recompilation if dependency was recently fetched
v1.2.1
Enhancements
- [IEx] Support remote pids/ports with IEx helper
i/1
- [Protocol] Warn when
defimpl
is called for a consolidated protocol
Bug fixes
- [ExUnit] Ensure
assert
macros can be used from quoted code - [ExUnit] Do not warn in match assertion if variable is reused in pattern
- [Macro] Fix a bug in
Macro.to_string/1
where a remote function could be accidentally interpreted as a sigil - [Mix] Ensure dependencies are properly skipped when
--only
option is given tomix deps.get
v1.2.0
Official announcement: https://elixir-lang.org/blog/2016/01/03/elixir-v1-2-0-released/
1. Enhancements
Elixir
- [Application] Add
spec/1
andspec/2
to retrieve application specification - [Application] Add
get_application/1
to retrieve the application a given module belongs to - [Base] Optimize encode and decode operations about 10 times
- [Enum] Use the faster and auto-seeding
:rand
instead of:random
inEnum.shuffle/1
andEnum.random/1
andEnum.take_random/2
- [Enum] Add
Enum.with_index/2
- [GenServer] Add
GenServer.stop/1
for shutting down servers reliably - [IO] Add
color
related functions toIO.ANSI
- [Kernel] Support multiple aliases in
alias
,import
,require
anduse
. For example,alias MyApp.{Foo, Bar, Baz}
- [Kernel] Add
struct!/2
. Similar tostruct/2
but raises on invalid keys - [Kernel] Warn if
@doc/@typedoc/@moduledoc
attributes are redefined - [Kernel] Warn if non-variables are used in
defdelegate/2
(as they have no effect) - [Kernel] Mark quoted expressions as generated, avoiding false positives on dialyzer
- [Kernel] Allow variables as map keys on creation
%{key => value}
and on matches%{^key => value}
- [Kernel] Allow the pin operator
^
infn
clauses and on the left side of<-
infor
comprehensions - [Kernel] Introduce
with
as a special form that allows matching on right side parameters - [Kernel] Warn when right hand side of
->
does not provide any expression - [Kernel] Warn if the Elixir was compiled with a different endianness than the one currently available at runtime
- [Kernel] Warn if a variable is used after being defined exclusively in a nested context
- [Kernel] Warn if piping into an expression without parentheses
- [Macro] Add
Macro.traverse/4
that performs pre and post-walk at once - [Macro] Add
Macro.camelize/1
andMacro.underscore/1
- [Process] Add
Process.get_keys/0
- [Stream] Add
Stream.with_index/2
- [String] Introduce
String.replace_{prefix,suffix,leading,trailing}/2
. The first two will replace only the first occurrence of the given match in string. The last two will replace all occurrences of the given match - [String] Support
String.normalize/2
andString.equivalent?/2
that perform NFD and NFC normalization - [System] Add
System.time_offset
,System.monotonic_time
,System.system_time
,System.convert_time_unit
andSystem.unique_integer
- [System] Allow
System.cmd/3
to remove variables by specifying nil values - [Task] Add
Task.Supervisor.async_nolink/1/3
that spawns a supervised task without linking to the caller process - [Task] Introduce
Task.yield_many/2
- [Task] Raise an error when a task is queried from a non-owning process (instead of waiting forever)
ExUnit
- [ExUnit] Allow one test to raise multiple errors. The goal is to enable tools in the ecosystem to emit multiple failure reports from the same test
- [ExUnit] Support
@tag report: [:foo, :bar]
which will include the values for tags:foo
and:bar
whenever a test fails
IEx
- [IEx] Allow
IEX_WITH_WERL
to be set on Windows to always run on WERL mode - [IEx] Display type docs for
t(Module.type)
andt(Module.type/arity)
- [IEx] Add
i/1
helper that prints information about any data type - [IEx] Show source code snippet whenever there is a request to pry a given process
Logger
- [Logger] Add file to logger metadata
Mix
- [Mix] Cache and always consolidate protocols
- [Mix] Add
warn_test_pattern
tomix test
that will warn on potentially misconfigured test files - [Mix] Introduce
MIX_QUIET
environment variable that configures the underlying Mix task to output only error messages - [Mix] Introduce
MIX_DEBUG
environment variable that prints information about the task being run - [Mix] Validate git options and warn on conflicting ref, branch or tags
- [Mix] New umbrella applications will now share configuration and build files
- [Mix] Add experimental support for Rebar 3
- [Mix] Do not warn when an optional dependency has a conflicting
:only
option with another dependency - [Mix] Raise readable error message when parsertools is not available
- [Mix] Add
--build
flag tomix deps.clean DEP
to only remove artifacts from_build
2. Bug fixes
Kernel
- [Access] Improve error messages when using Access on non-valid key-value structures
- [Kernel] Raise when conflicting
:only
and:except
are given to import - [Kernel] Change
__ENV__.file
if@file
is set for the given function - [Kernel] Make
Kernel.ParallelRequire
aware of:warning_as_errors
- [Kernel] Improve error message for invalid
do
/do:
- [Macro] Ensure
Macro.to_string/2
respects operator precedence when using the access operator - [Path] Do not crash when expanding paths that go beyond the root, for example,
Path.expand("/../..")
- [String] Ensure
UnicodeConversionError
does not contain invalid string in its error message
IEx
- [IEx] Do not start apps on
recompile
helper if--no-start
was given - [IEx] Avoid copying of data when evaluating every expression in IEx
Mix
- [Mix] Always run non-recursive tasks at the umbrella root
- [Mix] Ensure rebar projects work on directory names that contain non-latin characters
- [Mix] Ignore directories inside
apps
in umbrellas that do not have amix.exs
file - [Mix] Ensure Mix can be used with path dependencies where the app name is different than the path basename
- [Mix] Ensure dependencies won't crash when updating from a git repository to a hex repository and the git version did not respect SemVer
- [Mix] Do not run remote converger if dependencies have diverged
- [Mix] Ensure umbrella dependencies across all environments are loaded on parent deps.get/deps.update
ExUnit
- [ExUnit] Include file and line in all compilation errors for doctests
3. Soft deprecations (no warnings emitted)
Kernel
- [Dict]
Dict
andHashDict
are soft deprecated in favor ofMap
- [Keyword]
Keyword.size/1
is deprecated in favor oflength/1
- [Map]
Map.size/1
is deprecated in favor ofmap_size/1
- [Set]
Set
andHashSet
are soft deprecated in favor ofMapSet
Mix
- [Mix]
Mix.Utils.camelize/1
andMix.Utils.underscore/1
are soft deprecated in favor ofMacro.camelize/1
andMacro.underscore/1
v1.1.1
v1.1.0
Official announcement: https://elixir-lang.org/blog/2015/09/28/elixir-v1-1-0-released/
1. Enhancements
Elixir
- [Application] Add
Application.fetch_env!/2
,Application.loaded_applications/0
andApplication.started_applications/0
- [CLI] Add support for
--werl
in Windows bash-like shells - [Dict] Add
Dict.get_and_update/3
which behaves similar to the now deprecated Access protocol - [Dict] Add
Dict.get_lazy/3
,Dict.pop_lazy/3
andDict.put_new_lazy/3
- [Enum] Add
Enum.random/1
,Enum.take_random/2
,Enum.min_max/1
,Enum.min_max_by/2
,Enum.reverse_slice/3
,Enum.reduce_while/3
,Enum.dedup/1
andEnum.dedup_by/2
- [Enum] Inline common map usage in
Enum
functions for performance - [File] Add
File.lstat/1
andFile.lstat/1
that works likeFile.stat/1
but is able to return symlink information (i.e. it does not traverse symlinks) - [File] Add
File.rename/2
- [Integer] Add
Integer.digits/2
andInteger.undigits/2
- [Inspect] Add the
:safe
option toinspect/2
and make it safe by default, meaning failures while inspecting won't trigger other failures. Instead, it will be wrapped in an exception which is properly formatted - [IO] Support fenced code blocks on
IO.ANSI.Docs
- [GenServer] Add
GenServer.whereis/1
that expandsGenServer
dispatches into a proper pid - [Kernel] No longer include
:crypto
and:syntax_tools
as dependencies. The former is only needed if you have encrypted debug info (therefore you can add:crypto
as a dependency manually) and the latter is no longer used - [Kernel] Raise when
var.Alias
syntax is used and it does not expand to an atom at compile time (previously it emitted warnings) - [Kernel] Improve generation of argument names for function signatures
- [Kernel]
::/2
is now a special form - [Kernel] Warn when a variable with underscore is used
- [Kernel] Allow underscores in binary, octal and hex literals
- [Kernel] Warn when module attributes, variables, strings and numbers are used in code but the expression has no effect
- [Kernel] Support
\uXXXX
and\u{X*}
in strings and char lists to map to Unicode codepoints - [List] Add
List.keytake/3
- [Module] Improve name inference for function signatures in documentation metadata
- [Process] Add
Process.hibernate/3
- [Process] Allow a list of specs in
Process.info/2
- [Set] Introduce
MapSet
data type. This new data type uses maps behind the scenes and is useful for storing a dozens of items in Erlang 17. In future versions when maps efficiently support large collections, it is meant to be the main Set abstraction in Elixir - [Stream] Add
Stream.dedup/1
,Stream.dedup_by/2
andStream.transform/4
- [String] Support calculation of the jaro distance between strings (usually names) via
String.jaro_distance/2
. This is used by Mix to support "Did you mean?" feature when a task does not exist - [String] Add
String.splitter/3
that splits strings as a stream - [StringIO]
StringIO.flush/1
was added to flush the output of a StringIO device - [Task] Introduce
Task.yield/2
andTask.shutdown/2
to check if a task is still executing and shutdown otherwise - [Tuple] Add
Tuple.append/2
- [URI] Default ports were added for "ws" and "wss" schemas
- [URI] Add
URI.to_string/1
EEx
- [EEx] Add
:trim
option to EEx that automatically trims the left side of<%
and right side%>
if only spaces and new lines preceed/follow them
ExUnit
- [ExUnit] Add number of skipped tests to
ExUnit
output - [ExUnit] Make timeout configurable for the whole test suite via the
:timeout
configuration - [ExUnit] Allow moduledoc to be filtered/skipped in doctests
- [ExUnit] Provide built-in log capturing functionality
- [ExUnit] Allow
assert_receive_timeout
andrefute_receive_timeout
to be configured in the ExUnit application - [ExUnit] Allow tests to be skipped with
@tag :skip
or@tag skip: "reason"
- [ExUnit] Add tests without implementation (missing the do block) which automatically fail. Such tests are also automatically tagged as
:not_implemented
, allowing them to be skipped - [ExUnit] Increase by default stacktrace depth to 20 (this value is also configurable)
- [ExUnit] Improve formatting on
assert_raise
errors for message mismatch - [ExUnit] Improve formatting on
assert_receive
when using pinned variables
IEx
- [IEx] Support
IEx.pry
with--remsh
for remote debugging - [IEx] Add
b/1
helper that shows documentation for behaviour modules and its callback functions - [IEx] Provide tab completion for aliases and allow aliases like
Foo.Bar.Baz
to autocomplete even ifFoo.Bar
is not defined - [IEx] Provide a
pid/3
helper for buildings pids from numbers
Logger
- [Logger] Support printing pids and refs in Logger metadata
- [Logger] Allow Logger metadata to be removed from pdict by setting it to
nil
- [Logger] Add application configuration
translator_inspect_opts
for logger to customize how state and message are formatted when translating OTP errors and reports - [Logger] Automatically include the current application in metadata when compiled via Mix
Mix
- [Mix] Check Elixir version right after archive installation and provide feedback if there is a mismatch
- [Mix] Allow rebar dependencies with
mix.exs
to be compiled with Mix - [Mix] Allow rebar dependencies to be specified via
:path
- [Mix] Also consider subdirectories in
config
directory forMix.Project.config_files/0
- [Mix] Allow dynamic configuration in Mix projects by storing config in an agent
- [Mix] Support rebar3 style Git refs in
rebar.config
files - [Mix] Only recompile compile time dependencies in mix projects. This should considerably speed up recompilation times in Elixir projects
- [Mix] Warn when configuring an application that is not available
- [Mix] Add
mix profile.fprof
for easy code profiling - [Mix] Abort when dependencies have conflicting
:only
definitions - [Mix] Fully recompile projects if Elixir or SCM changes
- [Mix] Allow checksum to be checked on archive install via
--sha512
option - [Mix] Add
mix local.public_keys
to safely manage installation of Hex and Rebar dependencies
2. Bug fixes
Elixir
- [CLI] Ensure Logger messages are flushed when executing commands
- [Code]
:delegate_locals_to
failed to delegate to the chosen module in many situations and messed up stacktraces. This option has therefore been replaced by imports - [Code] Store the documentation line in the metadata returned by
Code.get_docs/2
- [Exception] Do not fail when calculating an exception message, even if the message is invalid
- [File] Ensure
File.touch/2
andFile.stat/2
receive and return universal times. Previously they would work with local times which are not monotonically increasing, which could present issues on scripts. If the times are being shown to the user,time: :local
can be given as argument - [Float] Support complete scientific notation in
Float.parse/1
- [Kernel] Do not expand
in/2
argument in module body - [Kernel] Throw syntax error for undefind atom/alias syntax
:foo.Bar
- [Kernel] Improve error message when we can't compile because the target directory is not writeable
- [Kernel] Allow capture of non-symbolic operators like
&and/2
,¬/1
and others - [Kernel] Raise if heredoc terminal is accidentally found in the middle of a line without escaping
- [Kernel] Don't warn on missing imports if nothing was imported
- [Kernel] Raise if arity bigger than 255 is given to capture operator
- [Macro] Properly convert captures in
Macro.to_string/1
- [Module] Do not accept non-Elixir module names in
Module.split/1
- [Protocol] Guarantee that derived protocols go through
Any
instead ofMap
- [Range] Restrict ranges to integers to fix diverse bugs of values being included in the range when they should not (false positives)
- [Regex] Fix splitting of empty strings with regexes when trim is set to
true
. Now bothString.split/3
andRegex.split/3
return an empty list when called with an empty string and trim is enabled - [Regex] Fix
Regex.replace/4
so it doesn't discard escape characters - [Stream] Ensure suspending
Stream.flat_map/2
andStream.transform/3
does not consume unecessary items from the given enumerable
EEx
- [EEx] Allow EEx interpolation to also apply inside quotations
<%%= ... %>
ExUnit
- [ExUnit] Skipped tests now correctly count towards the total of tests in the result returned by
ExUnit.run/0
- [ExUnit] Fix a bug where failures when inspecting data structure or retrieving error messages could bring the whole ExUnit runner down
- [ExUnit] Do not change the semantics of evaluated code with
assert
/refute
. For example, from now on,assert nil = some_expr()
will now raise as expected, as the expression still evaluates to a falsy value - [ExUnit] Report proper line number for doctest failures
Logger
- [Logger] Include metadata in
Logger.log/3
, useLogger.bare_log/3
for runtime-only, with no metadata behaviour
Mix
- [Mix] Use the safer
https
protocol instead ofgit
for:github
dependencies - [Mix] Ensure automatic protocol consolidation via
:consolidate_protocols
is triggered in umbrella apps - [Mix] Do not raise if wildcard given to
import_config
does not match any file - [Mix] Applications with
:build_embedded
set to true require explicit compilation step - [Mix] Also remove consolidated protocols on
mix clean
- [Mix] Ensure
--exclude
inmix test
concatenates with test helper excludes
3. Soft deprecations (no warnings emitted)
Elixir
- [Behaviour] The module
Behaviour
is deprecated. Instead ofdefcallback
, one can simply use@callback
. Instead ofdefmacrocallback
, one can simply use@macrocallback
- [Enum]
Enum.uniq/2
is deprecated in favor ofEnum.uniq_by/2
- [Kernel]
\x
inside strings and cha...