Elixir release

1.6.0

Change breakdown

Organization at a glance

Detailed changelog

Enhancement

68 changes

Tool: EEx Module: EEx

Allow markers / and | to be used in a custom EEx engine

Tool: Elixir Module: Calendar

Add truncate to Time, DateTime and NaiveDateTime to facilitate microsecond precision pruning

Tool: Elixir Module: Code

Add format_string!/2 and format_file!/2 for automatic code formatting

Tool: Elixir Module: Code

Support column annotations in quoted expressions with columns: true in Code.string_to_quoted/2

Tool: Elixir Module: DynamicSupervisor

Add DynamicSupervisor designed to manage children that are added and removed dynamically

Tool: Elixir Module: Exception

Make Exception.blame/3 extensible by adding an optional blame/2 callback to exceptions

Tool: Elixir Module: Exception

Improve the printing of guards on blamed exceptions

Tool: Elixir Module: Enumerable

Add Enumerable.slice/1 and optimize many Enum operations with the new protocol. This allows data-structures with index-based random access to provide a non-linear implementation

Tool: Elixir Module: Inspect

Show UTF-8 BOM on inspected strings

Tool: Elixir Module: Inspect.Algebra

Add :strict and :flex breaks - this gives more control over the document fitting

Tool: Elixir Module: Inspect.Algebra

Allow a group to inherit the parent group break

Tool: Elixir Module: Inspect.Algebra

Add force_unfit/1 and next_break_fits/2 which give more control over document fitting

Tool: Elixir Module: Inspect.Algebra

Add collapse_lines/1 for collapsing multiple lines to a maximum value

Tool: Elixir Module: Inspect.Algebra

Allow nest/2 to be :reset or be set to the current :cursor position

Tool: Elixir Module: Kernel

Prefix variables with V when emitting Erlang code. This improves the integration with tools such as Erlang code formatters and the GUI debugger

Tool: Elixir Module: Kernel

Warn on the use of length(x) == 0 in guards

Tool: Elixir Module: Kernel

Warn if catch comes before rescue in try

Tool: Elixir Module: Kernel

Warn if heredoc is outdented compared to its closing quotes

Tool: Elixir Module: Kernel

Add defguard/1 and defguardp/1 to make it easier to build guard-safe macros

Tool: Elixir Module: Kernel.ParallelCompiler

Add compile/2, compile_to_path/3 and require/2 which provide detailed information about warnings and errors

Tool: Elixir Module: Kernel.SpecialForms

Support the uniq: true flag in for comprehensions

Tool: Elixir Module: Module

Introduce @deprecated and @since attributes

Tool: Elixir Module: List

Rearrange equals and inserts for shorter diff scripts in List.myers_difference/2

Tool: Elixir Module: Record

Allow :macros and :includes to be given to Record.extract/2

Tool: Elixir Module: Stream

Add Stream.intersperse/2

Tool: Elixir Module: String

Update to Unicode 10

Tool: Elixir Module: String

Allow passing empty string match to String.replace/4

Tool: Elixir Module: String

Support context and language sensitive operations in String.upcase/2 and String.downcase/2. Currently only the :greek context is supported

Tool: Elixir Module: String

Support :ascii conversion in String.upcase/2 and String.downcase/2

Tool: Elixir Module: Time

Add Time.add/3

Tool: ExUnit Module: ExUnit.Assertions

Perform inclusive checks in assert_in_delta

Tool: ExUnit Module: ExUnit.Callbacks

Add ExUnit.Callbacks.start_supervised!/2

Tool: ExUnit Module: ExUnit.Case

Generate a random seed per test based on the test suite seed

Tool: IEx Module: IEx.Autocomplete

Provide contextual autocompletion: t Enum. will autocomplete types, b Enum will autocomplete callbacks

Tool: IEx Module: IEx.CLI

Provide hints for developers when a bad host name is given to --remsh

Tool: IEx Module: IEx.Helpers

Automatically include specs when showing documentation for functions/macros

Tool: IEx Module: IEx.Helpers

Improve formatting of behaviours and typespecs by using the formatter

Tool: IEx Module: IEx.Helpers

Allow pattern matching and guard expressions when on IEx.break!

Tool: Logger Module: Logger

Add :discard_threshold to Logger to help with message queue overflow

Tool: Mix Module: mix app.start

Add --preload-modules to mix app.start

Tool: Mix Module: mix archive.build

Allow mix archive.build to bundle dot files via an option

Tool: Mix Module: mix compile

Define a behavior for Mix compiler tasks and return diagnostics from compiler tasks

Tool: Mix Module: mix compile

Track struct dependencies between files and recompile them only if the struct changes

Tool: Mix Module: mix deps

Support :system_env option when specifying dependencies

Tool: Mix Module: mix format

Add a mix format task that formats the given files (or the files specified in a .formatter.exs file)

Tool: Mix Module: mix profile.eprof

Add a new task for time-based profiling with eprof

Tool: Mix Module: mix test

Run all functions in a describe block by giving the file:line the describe block starts

Tool: Mix Module: mix test

Report the top N slowest tests with the --slowest N flag

Tool: Mix Module: mix test

Report the number of doctests and tests separately

Tool: Mix Module: mix xref

Support --include-siblings in reports for umbrella support

Tool: Mix Module: mix xref

Add mix xref graph --format stats

Tool: Mix Module: mix xref

Add --only-nodes and --label filters to mix xref graph

Tool: Mix Module: mix xref

Add mix xref deprecated that shows the callsite of deprecated functions

Tool: Elixir Module: GenServer

Warn if init/1 is not defined in GenServer. This brings GenServer closer to the implementation in OTP and aligns all behaviours to require the init/1 callback

Tool: Elixir Module: Inspect.Algebra

surround/3 and surround_many/6 are deprecated in favor of container_doc/6

Tool: Elixir Module: Kernel

Specifying map types with variable keys without defining the type as required/optional is deprecated

Tool: Elixir Module: Kernel.ParallelCompiler

files/2 and files_to_path/3 are deprecated in favor of compile/2 and compile_to_path/3

Tool: Elixir Module: Kernel.ParallelRequire

files/2 is deprecated in favor of Kernel.ParallelCompiler.require/2

Tool: Elixir Module: Supervisor

The :simple_one_for_one strategy is deprecated in favor of DynamicSupervisor

Tool: Elixir Module: Supervisor

Passing a list of args to Supervisor.start_child/2 is deprecated in favor of DynamicSupervisor

Tool: Elixir Module: Task.Supervisor

Passing :restart and :shutdown to Task.Supervisor.start_link/2 is deprecated (it should be passed on start child instead)

Tool: ExUnit Module: ExUnit.Formatter

:case_started and :case_finished events are deprecated in favor of :module_started and :module_finished

Tool: Mix Module: Mix.Compilers.Erlang

Returning {:ok, val} | :error from custom Erlang compilers is deprecated in favor of {:ok, val, warnings} | {:error, errors, warnings}

Tool: Elixir Module: Enum

Enum.partition/2 is deprecated in favor of Enum.split_with/2

Tool: Elixir Module: Keyword

Keyword.replace/3 is deprecated in favor of Keyword.fetch/2 and Keyword.put/3

Tool: Elixir Module: Map

Map.replace/3 is deprecated in favor of Map.fetch/2 and Map.put/3

Tool: Elixir Module: Macro

Macro.unescape_tokens/1 and Macro.unescape_tokens/2 are deprecated in favor of Enum.map/2

Tool: Elixir Module: Range

Deprecate Range.range?/1 in favor of pattern matching on _ .. _

Bugfix

19 changes

Tool: Elixir Module: CLI

Support path with spaces as argument to elixir.bat

Tool: Elixir Module: Inspect

Properly handle minus signal for non-decimal negative integers

Tool: Elixir Module: Integer

Do not raise on non-integer values in is_odd/is_even

Tool: Elixir Module: Kernel

Solve a precedence issue between & and |, such as [&Foo.bar/1 | &Baz.bat/2]

Tool: Elixir Module: 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.

Tool: Elixir Module: Kernel

Validate variable struct name is atom when used in pattern matching

Tool: Elixir Module: Kernel

No longer generate documentation for defdelegate functions automatically to avoid overriding previously specified @doc

Tool: Elixir Module: Macro

Fix Macro.to_string/2 for tuple calls, such as alias Foo.{Bar, Baz}

Tool: Elixir Module: MapSet

Return valid MapSet when unioning a legacy MapSet

Tool: Elixir Module: Regex

Return a leading empty space when splitting on empty pattern. This makes the split operation consistent with the other operations in the Regex module

Tool: Elixir Module: Stream

Ensure Stream.chunk_while/4 does not emit more elements than necessary when halted

Tool: Elixir Module: String

Return a leading empty space when splitting on empty string. This makes the split operation consistent with the other operations in the String module

Tool: Elixir Module: URI

Preserve empty fragments in URI.parse/1

Tool: Mix Module: mix app.start

Improve the quality of reports if app fails to boot

Tool: Mix Module: mix cmd

Allow mix cmd to be invoked multiple times without marking it as executed

Tool: Mix Module: mix deps

Ensure optional dependencies in umbrella applications are loaded

Tool: Mix Module: mix deps.update

Ensure transitive new non-Hex dependencies are also fetched when a repo is updated

Tool: Mix Module: mix xref

Take compile dependencies with higher priority than runtime ones when building a graph

Tool: Mix Module: mix xref

Handle external files for xref callers and warnings