Elixir release

1.3.0

Change breakdown

Organization at a glance

Detailed changelog

Enhancement

78 changes

Tool: EEx Module: EEx.Engine

Support an init/1 function in engines that will return the initial buffer (defaults to an empty string)

Tool: Elixir Module: Access

Add support for Access.all/0, Access.elem/1, Access.key/2 and Access.key!/1 for traversing nested data structures

Tool: Elixir Module: Calendar

Add Calendar and Date, Time, NaiveDateTime and DateTime types

Tool: Elixir Module: CLI

Add --logger-otp-reports BOOL and --logger-sasl-reports BOOL switches

Tool: Elixir Module: Compiler

Emit a summary of compilation errors when modules are missing

Tool: Elixir Module: Enum

Add Enum.group_by/3 that allows developers to map on the value being grouped

Tool: Elixir Module: Enum

Make list values in maps returned by Enum.group_by/2 and Enum.group_by/3 preserve the order of the input enumerable instead of reversing it.

Tool: Elixir Module: Enum

Add Enum.drop_every/2 that drops every nth, including the first one

Tool: Elixir Module: Exception

Suggest possible functions on UndefinedFunctionError for existing modules

Tool: Elixir Module: Exception

Warn if unknown fields are given to raise/2

Tool: Elixir Module: File

Support IO devices in File.copy/3

Tool: Elixir Module: GenServer

Raise a more meaningful exit if you try to GenServer.call/3 yourself

Tool: Elixir Module: Inspect

Support :base option when inspecting binaries

Tool: Elixir Module: IO

Add IO.warn/2 that will print a warning message with stacktrace and notify the compiler a warning was printed (in case --warnings-as-errors was enabled)

Tool: Elixir Module: Kernel

Support generated: true in quote

Tool: Elixir Module: Kernel

Support Kernel.pop_in/1 and Kernel.pop_in/2 for yanking a value from a nested data structure

Tool: Elixir Module: Kernel

Allow variable struct names when matching, for example, %module{key: "value"} = struct

Tool: Elixir Module: Kernel

Allow guards on the left side of <- in for and with special forms

Tool: Elixir Module: Kernel

Support else chunks in with

Tool: Elixir Module: Kernel

Track {module, function, arity} imports and warn on unused ones when such are specified in :only

Tool: Elixir Module: Kernel

Add keyword/0 and keyword/1 built-in types to typespecs

Tool: Elixir Module: Kernel

Add sigils for date (~D[2015-04-17]), time (~T[08:00:00]) and naive date times ~N[2015-04-17 08:00:00]

Tool: Elixir Module: Kernel

Support @enforce_keys on defstruct/1 to guarantee some keys are explicitly given when building structs

Tool: Elixir Module: OptionParser

Add support for :count switch type

Tool: Elixir Module: OptionParser

Add parse!/2 and parse_head!/2 that raise OptionParser.ParseError in case of errors

Tool: Elixir Module: Process

Add Process.sleep/1

Tool: Elixir Module: Range

Range.range?/1 now checks the validity of a range.

Tool: Elixir Module: Regex

Support :include_captures in Regex.split/3

Tool: Elixir Module: String

Add String.myers_difference/2 for calculating the difference between two strings

Tool: Elixir Module: System

Add System.os_time/0 and System.os_time/1

Tool: Elixir Module: Typespec

Add support for %{required(foo) => bar} and %{optional(foo) => bar} forms (Erlang 19 only)

Tool: Elixir Module: Typespec

Add support for @optional_callbacks to mark certain that certain callbacks may be optionally implemented

Tool: Elixir Module: Typespec

Introduce %{...} to mean any map (Erlang 19 only)

Tool: Elixir Module: URI

Add URI.merge/2

Tool: Elixir Module: Version

Add Version.parse!/1

Tool: ExUnit Module: ExUnit

Show pinned variables on failed assert ^left = right and assert match?(^left, right) assertions

Tool: ExUnit Module: ExUnit

Add ExUnit.Case.register_attribute which allow attributes to be cleaned up whenever a test is defined

Tool: ExUnit Module: ExUnit

Add ExUnit.Case.register_test and support the ability to tag "tests" by type. This will allow projects like QuickCheck to change the wording in formatters to say "10 properties" instead of "10 tests"

Tool: ExUnit Module: ExUnit

Support diffing of values when using == in assert

Tool: ExUnit Module: ExUnit

Start running tests as soon as cases are loaded. This feature is enabled by default when running tests through Mix

Tool: ExUnit Module: ExUnit

Raise a straight-forward error message in case a duplicate test name is defined

Tool: ExUnit Module: ExUnit

Bump the default number of max cases to double of schedulers to support both IO and CPU bound tests

Tool: ExUnit Module: ExUnit

Support for named setups in setup and setup_all

Tool: ExUnit Module: ExUnit

Support for bundling tests together with describe/2

Tool: IEx Module: IEx

Add nl/2 that loads a given module on a list of nodes

Tool: IEx Module: IEx.Helpers

No longer restart applications on recompile/1

Tool: IEx Module: IEx.Autocomplete

Improve IEx expand to handle functions after &

Tool: Logger Module: Logger

Introduce Logger.reset_metadata/0,1

Tool: Mix Module: Mix

Add mix xref and mix compile.xref that runs cross-reference checks, with the latter running after compilation by default

Tool: Mix Module: Mix

Add mix app.tree and mix deps.tree

Tool: Mix Module: Mix

Add Mix.Task.rerun/2 that reenables and re-runs a task

Tool: Mix Module: Mix

Integrate OptionParser.ParseError into Mix, automatically converting such exceptions into Mix.Error and embedding the task information

Tool: Mix Module: Mix

Support @preferred_cli_env attribute when defining tasks

Tool: Mix Module: Mix

Support mix test --raise that will raise when a test suite fails (instead of setting the exit code to 1)

Tool: Mix Module: Mix

Enable rebar3 manager by default for Hex dependencies

Tool: Mix Module: Mix

Add mix escript.install to install escripts

Tool: Mix Module: Mix

Print stacktraces for Mix.Error when MIX_DEBUG=1 is set

Tool: Mix Module: Mix

Add a user friendly error for merge conflicts on mix.lock

Tool: Mix Module: Mix

Track files between path dependencies. This means umbrella applications will no longer trigger full recompilation when a sibling changes. Instead it will only recompile the files affected by the sibling changes

Tool: Mix Module: Mix

No longer print every file being compiled. Instead a generic "Compiling N files (.ext)" will be printed and files will only be logged in case they take more than 5 seconds to compile. This threshold can be customized by passing the --long-compilation-threshold flag and the previous behaviour can be reenabled by giving --verbose to mix compile

Tool: Mix Module: Mix

Add mix test --stale that uses static analysis on source files to know which tests should run when source files changes. If any test file changes, it will also re-run. Changing a configuration file or the test helper will trigger a full recompilation

Tool: Elixir Module: Float

Float.to_string/2 and Float.to_char_list/2 has been soft-deprecated as Elixir will now attempt to print the shortest and most accurate representation by default. Developers can always fallback to :erlang.float_to_binary/2 and :erlang.float_to_list/2 if they need the previous functionality

Tool: Elixir Module: Kernel

to_char_list functions have been soft-deprecated in favor of to_charlist. This aligns with the naming conventions in both Erlang and Elixir

Tool: Elixir Module: String

The confusing String.strip/2, String.lstrip/2 and String.rstrip/2 API has been soft deprecated in favor of String.trim/2, String.trim_leading/2 and String.trim_trailing/2

Tool: Elixir Module: String

The confusing String.ljust/3 and String.rjust/3 API has been soft deprecated in favor of String.pad_leading/3 and String.pad_trailing/3

Tool: Elixir Module: Typespec

char_list is soft-deprecated in favor of charlist

Tool: Elixir Module: Dict

Dict is no longer a behaviour and its functions will be deprecated in upcoming releases

Tool: Elixir Module: Enum

Passing a dictionary to Enum.group_by/3 is deprecated

Tool: Elixir Module: Kernel

\x{H*} in strings/sigils/charlists is deprecated

Tool: Elixir Module: Kernel

Add deprecation for defdelegate list arguments and :append_first option. The previously undocumented and deprecated support for matching has been removed

Tool: Elixir Module: Kernel

Warn if a variable is assigned inside case/if/etc and used outside the block

Tool: Elixir Module: Keyword

Keyword.size/1 is deprecated in favor of Kernel.length/1

Tool: Elixir Module: Map

Map.size/1 is deprecated in favor of Kernel.map_size/1

Tool: Elixir Module: Regex

The option /r (for ungreedy) has been deprecated in favor of /U

Tool: Elixir Module: Set

Set is no longer a behaviour and its functions will be deprecated in upcoming releases

Tool: Elixir Module: String

String.valid_character?/1 is deprecated in favor of String.valid?/1 with pattern matching

Tool: Elixir Module: Task

Task.find/2 is deprecated in favor of explicit message matching

Tool: Elixir Module: URI

Passing a non-map to URI.decode_query/2 is deprecated

Bugfix

18 changes

Tool: Elixir Module: Application

Ensure Application.spec/2 returns nil for unknown applications

Tool: Elixir Module: GenServer

Ensures cast/2 returns :ok if locally registered process is not found

Tool: Elixir Module: Inspect

Ensure binaries break into new lines when inspected

Tool: Elixir Module: Kernel

Do not choke on capture operator with argument above &191

Tool: Elixir Module: Kernel

Raise if defstruct is called multiple times

Tool: Elixir Module: Kernel

Ensure Module.create/3 respects var/alias hygiene

Tool: Elixir Module: Kernel

Support non-literal ranges on the right side of in/2

Tool: Elixir Module: Macro

Fix Macro.to_string/1 on a call of a capture argument, for example &(&1).(:x)

Tool: Elixir Module: OptionParser

Allow OptionParser to parse negative numbers

Tool: Elixir Module: Record

Fix Record.is_record/2 when dealing with non-record tuples

Tool: Elixir Module: String

Ensure strip also removes non-breaking whitespaces (and ensure split still does not split on them)

Tool: Elixir Module: URI

Use square brackets for IPv6 in URI.to_string/1

Tool: Mix Module: Mix

Improve task not found message when Mix would include the not found task as a suggestion due to different casing

Tool: Mix Module: Mix

Ignore lock revision when the lock is out of date when updating Mix dependencies. Before this fix, Git tags and branches in the lock file would erroneously take higher precedence than the one in mix.exs

Tool: Mix Module: Mix

Only recompile empty Elixir files if they change instead of recompiling them on every run

Tool: Mix Module: Mix

Ensure .app file is written in UTF-8 (this allows app descriptions to contain UTF-8 characters)

Tool: Mix Module: Mix.Dep

Always specify the :env option internally for dependencies to avoid false positives in the dependency resolution

Tool: Mix Module: Mix.Dep

Correctly detect conflict from cousin optional dependencies in the dependency resolution algorithm