Releases: elixir-lang/elixir
Releases · elixir-lang/elixir
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...
v1.0.5
Enhancements
- [Elixir] Support Erlang 18.0
- [IEx] Rely only on loaded applications for autocompletion on IEx
- [Record] Expand attributes and macros in record extractor
- [String] Optimize
String.rstrip/1
- [String] Optimize
String.downcase/1
- [String] Optimize
String.upcase/1
Bug fixes
- [EEx] Ensure blocks do not clobber EEx buffers
- [Enum] Ensure
Enum.take/2
does not consume one extra item when halting on the last emittable item - [ExUnit] Fix
StringIO
processes leakage in theExUnit.CaptureIO
when there are errors inside thecapture_io
block - [Float] Avoid rounding errors on
Float.parse/1
- [GenEvent] Fix
GenEvent
detection of modules that aren't loaded - [IO] Read 4K blocks instead of lines in
IO.binread/2
. This fixes a bug where CRLF were being ignored and is also going to improve performance - [Logger] Handle
:undefined
arity inLogger.Translator
(we get :undefined when a temporary worker of asimple_one_for_one
supervisor crashes) - [Mix] Ensure config is escaped before being injected into escripts. This fixes a bug where escripts failed to build when containing values like maps in config files
- [Mix] Ensure we properly underscore acronyms followed by paths, for example,
HTTP.Foo
- [Stream] Ensure
Stream.flat_map/2
does not consume more items than necessary when piped to anotherStream.flat_map/2
that halts in the inner stream - [Version] Fix
to_string
for versions with numeric pre releases
v1.0.4
Enhancements
- [Elixir] Support Erlang 17.5 and 18.0
- [Mix] Support "--search PATTERN" in "mix help"
- [Mix] Support
:start_permanent
that starts the application as permanent - [Mix] Support
:build_embedded
that compile protocols, avoid symlinks and ensure protocols are loaded on boot - [Mix] Make "mix app.start" public and support "--permanent" and "--temporary" options
- [URI] Speed decoding operations
Bug fixes
- [Elixir] Produce clearer error messages for syntax errors before a sigil
- [Elixir] Return value when matching on
_
in the last line of a block - [Elixir] Ensure changes in child deps forces the parent to recompile
- [Kernel] Fix a bug where
=~/2
returned false when matching on an empty string. The current behaviour was changed to match the behaviour ofString.contains?/2
- [Mix] Store relative paths in erlang manifests
- [Mix] Fix httpc proxy option profile for downloading hex and other safe packges
- [Mix] Fix missing behaviour warning when compiling Erlang modules
v1.0.3
Enhancements
- [Elixir] Do not show exported vars warning
- [Elixir] Improve error messages when using invalid expressions inside maps
- [Elixir] Skip aliases and import warnings when code cannot compile
- [IEx] Improve autocompletion for Erlang/Elixir based on loaded applications
- [IO] Make
IO.ANSI.Docs
readable on white background - [Mix] Provide clearer error message when updating archives on Windows
- [Mix] Don't go through hex.pm API server to install Hex
Bug fixes
- [Elixir] Ensure all Elixir applications work with code upgrades
- [Elixir] Don't leave spurious processes and stale data when the parallel compiler fails
- [Inspect] Keep original stacktrace on Inspect errors
- [IO] Fix
IO.ANSI.Docs
handling of*
,**
,_
where they would be activated in the middle of words - [Logger] Fix logging with
metadata[:function]
- [Mix] Don't show hex update message on mix
local.hex
- [Mix] Ensure tasks are properly underscored and camelized
- [Mix] Ensure Mix does not use ANSI escapes on Windows unless ANSI is enabled
- [Mix] Only shutdown Logger if the Mix application is being actually started
- [Mix] Ensure priv/include are copied on Windows even if source did not change
- [Mix] Ensure rebar dependencies work when user path has a space on Windows
- [Regex] Fix
Regex.replace/4
failures when the number of substitutions in pattern is more than the number of matches and support\g{...}
patterns - [String] Fix LFCR being treated as a grapheme instead of CRLF
- [URI] Do more strict matching on URI schema
v1.0.2
Bug fixes
- [EEx] Remove invalid warning when attempting to inline code in EEx
- [EEx] Unify syntax errors to always include file:line:
- [IEx] Set null prompt function in dumb term mode
- [Kernel] Do not define an ets table with the same name as the module as it clashes with user code
- [Kernel] Fail compiling try expressions if they lack one of catch/after/rescue/else clauses
- [Kernel] Improve error messages when parsing fails on aliases
- [Kernel] Improve warnings coming from compile-time evaluation of arguments
- [String] Fix String.replace/4 typespec
v1.0.1
Enhancements
- [Mix] Add MIX_ENV output to archive.build (as on escript.build)
Bug fixes
- [CLI] Fix Elixir CLI when running on Cygwin
- [ExUnit] Include stacktraces in ExUnit timeouts
- [Mix] Load dependencies before
deps.check
compiles dependencies - [Mix] Ensure
Mix.Config
is deep merged - [Mix] Change version requirement in new apps to
~> MAJOR.MINOR
- [Mix] Report correct location if
local.hex
fails and give higher priority to powershell install on Windows - [Mix] Ensure
--elixirc-paths
option forcompile.elixir
is a subset of the project:elixirc_paths
configuration and it does not remove skipped entries from the manifest - [Mix] Ensure
compile.elixir
writes to manifest when files are removed - [Mix] Ensure
compile.elixir
purges and deletes modules before compiling - [Mix] Do not crash on malformed proxy env var
- [Stream] Ensure
chunk/4
works correctly when halted - [System] Do not allow relative paths in
System.cmd/3
as documented - [System] Fix
:stderr_to_stdout
option inSystem.cmd/3
v1.0.0
v0.15.1
Enhancements
- [GenEvent] Support
:ack
mode for GenEvent streams - [Inspect] Support
:base
option ininspect/2
to choose the base (:binary
,:octal
,:decimal
or:hex
) numbers a printed - [Kernel] Print warnings when used
?
with characters with escape codes - [Logger] Add SASL log forwarding option to Logger
- [Logger] Add
$padlevel
to option Logger formatter - [Logger] Backends receive the exact handler value when added, allowing a key to be passed for configuration lookup
- [Logger] Add
Logger.flush/0
to flush the Logger (useful for testing) - [Logger] Persist backends dynamically added or removed via
add_backend/2
andremove_backend/2
- [Macro] Add
Macro.validate/1
to recursively check if a value is a valid quoted expression - [Mix] Load mix deps only when there is a need to use them (this improves the timing for the majority of tasks in a Mix project)
- [Mix] Make the environment explicit on the success message generated after
escript.build
is invoked - [Mix] Load
config/config.exs
inside escripts - [Mix] Store and check Elixir version requirement for generated archives
Bug fixes
- [CLI] Fix shell bugs when running on Windows with Cygwin or MinGW
- [Kernel] Modules compiled by Elixir now report the correct beam location when
:code.which/1
is invoked. If the bytecode is only available in memory,:code.which/1
returns:in_memory
- [Kernel] Do not expand args for unknown functions/macros
- [Kernel] Ensure
defstruct
,@attr
inside and friends raise a nice error messages when values cannot be properly escaped - [Kernel] Do not raise conflicts on imports used from inside quotes
- [Logger] Metadata is now correctly merged on each
Logger.metadata/1
call - [Logger] Use the Logger PID on
:error_logger
wrapper to avoid race conditions on shutdown - [Macro] Ensure bitstrings work with
Macro.escape/1
- [Mix] Ensure aliases are invoked on umbrella recursive tasks
- [Mix] Leave it up to the application to start the Logger after compilation
- [Mix] Accept more forms of git versions (like "git version 1.9.3 (Apple Git-50)")
- [Path] Do not normalize paths in
Path.join/2
as normalization is beyond the scope of such function - [URI]
to_string/1
now properly converts URI to strings when the schema is missing
Deprecations
- [Collectable] Having a function as collectable is deprecated
- [Module]
Module.function/3
is deprecated, please use:erlang.make_fun/3
instead
v0.15.0
Enhancements
- [Agent] Improve the Agent API to also accept functions that receive explicit module, function and arguments
- [IEx] Support
--werl
call on Windows - [Logger] Add
Logger
- [Map] Add
Map.from_struct/1
- [Mix] Allow
--app
flag to be passed tomix new
- [Mix] Support lowercase
http(s)_proxy
environment variables - [Mix] Allow
elixirc_paths
to also be given through the command line tomix compile.elixir
- [String]
String.slice/2
andString.slice/3
have been optimized
Bug fixes
- [IEx] Ensure functions in
Kernel.SpecialForms
andIEx.Helpers
are also auto-completed - [IEx] Ensure remote shells can be started with
--remsh
- [Kernel] Correctly parse unary/binary operators regardless of number of spaces
- [Kernel] Ensure private functions are not exported
- [Protocol] Do not expose protocol convention on
assert_impl!/2
- [Regex] Do not consider include captures on
Regex.split/3
results - [Stream] Implement the
Inspect
protocol for Streams so we do not leak the Stream representation
Deprecations
- [IEx] IEx color configuration expects a list of atoms instead of a string with colors separated by comma
- [Inspect]
Inspect.Algebra.surround_many/6
now expects Inspect.Opts instead of an integer limit - [Inspect]
Inspect.Algebra.pretty/2
is deprecated in favor ofInspect.Algebra.format/2
that instead returns iodata. This function was used only by documentation examples and it is unlikely to affect actual code - [IO]
IO.ANSI.terminal?
is deprecated in favor ofIO.ANSI.enabled?
- [IO]
IO.ANSI.escape/2
andIO.ANSI.escape_fragment/2
is deprecated in favor ofIO.ANSI.format/2
andIO.ANSI.format_fragment/2
- [Kernel] Leading
0
for octals is deprecated in favor of0o
- [Kernel]
0X
for hexadecimals is deprecated in favor of0x
- [Kernel]
0B
for binaries is deprecated in favor of0b
- [Mix] Mix color configuration expects a list of atoms instead of a string with colors separated by comma
- [String]
\NNN
,\NN
and\N
for octals are deprecated inside string, sigils and chars in favor of hexadecimal entries with\x
Backwards incompatible changes
- [Kernel]
binding/1
andbinding/2
expecting a list were removed - [Regex] Do not consider include captures on
Regex.split/3
results
v0.14.3
Enhancements
- [Access] Allow function access on
get_in/2
andget_and_update_in/3
- [Enum] Add
Enum.sort_by/3
- [ExUnit] Match the line filter by proximity instead of exact match
- [Float] Support precision in
Float.ceil/1
andFloat.floor/1
- [IO] Add
IO.(bin)read(device, :all)
- [Kernel] Print a warning if a dangling
@doc
clause is found - [Mix] Use absolute symbolic links on Windows for
_build
instead of copying - [Mix] Add
Mix.compilers
that returns all default compilers used by mix tasks - [Mix] Issue warning and reset mtime for source files from the future
- [Mix] Support task aliases in Mix
- [OptionParser] Add
OptionParser.split/1
that splits a string into argv - [Record] Allow a record to be converted to a keyword list with
record(some_record)
- [String] Improve performance of
String.split/1
- [Typespec] Allow
%Struct{}
syntax to be used in typespecs - [Typespec] Allow
record(:record, fields)
syntax to be used in typespecs
Bug fixes
- [IEx] Do not print ANSI sequences on
IEx.Helpers.clear/0
if ANSI sequences are not supported - [Inspect] Ensure
Inspect.Algebra.to_doc/2
doesn't go into a loop when there is a failure printing a struct - [Kernel]
|>
,<<<
,>>>
and^^^
made left associative in operator table - [Kernel]
<
,>
,<=
,>=
given higher precedence than comparison operators (==
,!=
, etc) in the operator table - [Kernel] Run command line and escripts in a process that does not trap exits
- [Kernel] Fix a bug where Mix paths had higher priority than CLI ones, causing protocol consolidations to not be properly loaded
- [Kernel] Fix wording on error messages when a check/guard always passes or always fails
- [Kernel] Fix a bug where an unused function warning was printed even when the function was used via
defoverridable
- [Kernel] Improve typespecs so they don't generate supertype dialyzer warnings
- [Macro]
to_string
correctly displays sigils - [Mix] Ensure Mix dependencies are not compiled every second time when
mix deps.compile
is invoked - [Mix] Fix a bug where
Mix.shell.error/1
and friends choked when printing a map - [Mix] Ensure multiple
@external_resource
entries are read by Mix compilers - [Mix] Fix a bug where tasks for umbrella projects were not properly reenabled
- [Stream] Fix bug when
flat_map
is used inside anotherflat_map
with an Enumerable - [Typespec] Fix a bug where the
list
typespec was incorrectly rendered as[]
Soft deprecations (no warnings emitted)
- [Kernel] Using a list for bitstring modifiers is deprecated (as in
<<x :: [little, utf16]>>
), please use-
as the separator instead (as in<<x :: little-utf16>>
) - [System]
System.cmd/1
is deprecated in favor ofSystem.cmd/3
Deprecations
- [Mix]
mix escriptize
is deprecated in favor ofescript.build
- [Mix]
mix local.install
andmix local.uninstall
have been deprecated in favor ofmix archive.install
andmix archive.uninstall
respectively - [Mix]
:embed_extra_apps
for escripts is deprecated, instead list the dependencies insidedef application
- [System] Giving a char list to
System.find_executable/1
is deprecated
Backwards incompatible changes
- [Access] No longer fill in missing intermediate values with empty maps
- [Float]
Float.ceil/2
andFloat.floor/2
now always returns floats and no longer accept integers - [Kernel]
defstruct
no longer automatically defines a type - [Kernel]
exit(integer)
is no longer supported from scripts to configure the exit signal. Useexit({:shutdown, integer})
instead - [Kernel] Default argument values have to be defined in a function head if the function has multiple clauses
- [Mix]
mix archive.build
replaces the functionality ofmix archive
,mix archive
now lists locally installed archives - [Mix]
Mix.shell.info/1
no longer automatically escape ANSI sequences. Instead if has to be explicitly enabled with theansi: true
option - [OptionParser]
--no-SWITCH
are only allowed for declared booleans switches