Elixir release

1.10.0

Change breakdown

Organization at a glance

Detailed changelog

Enhancement

58 changes

Tool: Elixir Module: Application

Add Application.compile_env/3 and Application.compile_env!/2 for reading values at compilation time and tracking if they accidentally change during runtime

Tool: Elixir Module: Calendar

Allow custom calendar representations in calendar sigils

Tool: Elixir Module: Calendar

Add c:Calendar.parse_time/1, c:Calendar.parse_date/1, c:Calendar.parse_naive_datetime/1 and c:Calendar.parse_utc_datetime/1 callbacks to calendar behaviour

Tool: Elixir Module: CLI

Add support for NO_COLOR environment variable

Tool: Elixir Module: Code

Add :token_metadata and :literal_encoder support to Code.string_to_quoted/2

Tool: Elixir Module: Code

Add compiler tracing to lift events done by the compiler

Tool: Elixir Module: Code

Return {:error, :unavailable} in Code.ensure_compiled/1 if module is in a deadlock

Tool: Elixir Module: DateTime

Add DateTime.now!/2 and DateTime.shift_zone!/3

Tool: Elixir Module: Enum

Speed up getting one random element from enumerables

Tool: Elixir Module: Enum

Add Enum.frequencies/1, Enum.frequencies_by/2, and Enum.map_intersperse/2

Tool: Elixir Module: Enum

Allow a sorting function on Enum.min/max/min_by/max_by

Tool: Elixir Module: Enum

Add asc/desc and compare/1 support to Enum.sort/2

Tool: Elixir Module: Exception

Add version alongside app names in stacktraces

Tool: Elixir Module: Function

Add Function.identity/1

Tool: Elixir Module: Kernel

Add Kernel.is_struct/1 and Kernel.is_map_key/2

Tool: Elixir Module: Kernel

Warn when function head comes immediately after the implementation instead of before the implementation

Tool: Elixir Module: Kernel

Warn if duplicate key is found in struct declaration

Tool: Elixir Module: Kernel

Print all undefined functions as warnings and then raise. This allows users to see all undefined calls at once, when it would otherwise require them to compile the code multiple times

Tool: Elixir Module: Keyword

Add Keyword.pop!/2 and Keyword.pop_values/2

Tool: Elixir Module: Map

Add Map.pop!/2

Tool: Elixir Module: MapSet

Optimize multiple operations

Tool: Elixir Module: Module

Add Module.has_attribute?/2

Tool: Elixir Module: Module

Add @compile {:no_warn_undefined, mfa_or_module} to turn off undefined function warnings

Tool: Elixir Module: NaiveDateTime

Add NaiveDateTime.local_now/0

Tool: Elixir Module: Record

Warn if duplicate key is found in record declaration

Tool: Elixir Module: String

Update to Unicode 12.1

Tool: Elixir Module: StringIO

Add :encoding option to StringIO and optimize get_chars operation

Tool: ExUnit Module: ExUnit.Assertions

Support diffs in pattern matching and in assert_receive

Tool: ExUnit Module: ExUnit.CaptureIO

Supports capturing named devices in asynchronous tests

Tool: IEx Module: IEx

Warn on circular file imports when loading default .iex.exs

Tool: IEx Module: IEx

Allow customization of the continuation prompt on IEx

Tool: Logger Module: Logger

Allow start_options to be configured on Logger's GenEvent

Tool: Logger Module: Logger

Integrate Elixir's Logger with Erlang/OTP 21+'s logger. This means setting up the logger level in Elixir will automatically change the logger level for Erlang and vice-versa

Tool: Mix Module: mix compile

Add --profile time flag to profile compilation steps

Tool: Mix Module: mix deps.compile

Add --skip-umbrella-children flag. The new flag does not compile umbrella apps. This is useful for building caches in CD/CI pipelines

Tool: Mix Module: mix deps.unlock

Add --check-unused flag. The new flag raises if there are any unused dependencies in the lock file

Tool: Mix Module: mix release

Allow RELEASE_DISTRIBUTION to be set to none

Tool: Mix Module: mix release

Support overlays in rel/overlays

Tool: Mix Module: mix release

Allow configuration reboot to be disabled in releases

Tool: Mix Module: mix test

Add support for simple round-robin test partitioning across multiple machines

Tool: Mix Module: Mix.Project

Add MIX_DEPS_PATH environment variable for setting :deps_path

Tool: Mix Module: Mix.Project

Add Mix.Project.deps_scms/1 that returns deps with their SCMs

Tool: Mix Module: Mix.Task

Add Mix.Task.Compiler.after_compiler/2 callback, to simplify compilers that may need to run something at multiple steps

Tool: Elixir Module: Code

compiler_options/0 is deprecated in favor of compiler_option/1

Tool: Mix Module: Mix.Config

Mix.Config.persist/1 has been deprecated. Instead of Mix.Config.persist(config) use Application.put_all_env(config, persistent: true) (Application.put_all_env/2 was added in v1.9)

Tool: Mix Module: mix xref

calls/0 is deprecated in favor of compiler tracer

Tool: Mix Module: mix xref

The xref.exclude option has been moved to elixirc_options.no_warn_undefined as the xref pass has been moved into the compiler

Tool: Elixir Module: Code

Code.load_file/2 has been deprecated in favor of Code.require_file/2 or Code.compile_file/2

Tool: Elixir Module: Code

Code.loaded_files/0 and Code.unload_file/1 have been deprecated in favor of Code.required_files/0 and Code.unrequire_file/1 respectively

Tool: Elixir Module: Code

Code.ensure_compiled?/1 is deprecated in favor of Code.ensure_compiled/1

Tool: Elixir Module: String

String.normalize/2 has been deprecated in favor of :unicode.characters_to_nfc_binary/1 or :unicode.characters_to_nfd_binary/1 which ship as part of Erlang/OTP 20+

Tool: Elixir Module: Supervisor

Supervisor.Spec.supervise/2 has been deprecated in favor of the new Supervisor child specification

Tool: Elixir Module: Supervisor

The :simple_one_for_one strategy in Supervisor has been deprecated in favor of DynamicSupervisor

Tool: Logger Module: Logger

:compile_time_purge_level application environment configuration has been deprecated in favor of the more general :compile_time_purge_matching config

Tool: Logger Module: Logger

Deprecate logging non-chardata values

Tool: Mix Module: mix compile.xref

This check has been moved into the compiler and has no effect now

Tool: Mix Module: mix xref deprecations

This check has been moved into the compiler and has no effect now

Tool: Mix Module: mix xref unreachable

This check has been moved into the compiler and has no effect now

Bugfix

18 changes

Tool: EEx Module: EEx

Ensure multiline do/end with no spaces compile under trim mode

Tool: Elixir Module: Enum

Allow positive range slices on infinite streams given to Enum.slice/2

Tool: Elixir Module: Kernel

Raise error on functions/guards without implementation

Tool: Elixir Module: Keyword

Ensure keyword replace and update preserve order

Tool: Elixir Module: Module

Raise instead of silently failing when performing a write module operation during after-compile

Tool: Elixir Module: Module

Fix @macrocallback definitions with a when clause

Tool: Elixir Module: Path

Fix Path.absname/1 to correctly handle UNC paths on Windows

Tool: Elixir Module: Stream

Close with correct accumulator in Stream.resource/3 when called for a single-element list

Tool: Elixir Module: Stream

Allow Stream.cycle/1 to be double nested inside Stream.cycle/1

Tool: Elixir Module: URI

Preserve slashes in URIs without authority

Tool: Elixir Module: URI

Require a nil or an absolute path on URIs with host or authority

Tool: IEx Module: IEx

Exit IEx session if the group leader exits

Tool: IEx Module: IEx

Allow pry to be used in non-tty terminals

Tool: Mix Module: mix compile

Do not filter out warning for external files from diagnostics

Tool: Mix Module: Mix.Project

Ensure user given :manager to dependencies has higher precedence than the SCM one

Tool: Mix Module: Mix.Project

Recompile umbrella children when config files change and mix compile is called from the umbrella root

Tool: Mix Module: Mix.Task

Always recompile before running tasks from dependencies

Tool: Mix Module: Mix.Task

Ensure project's Logger config is used when running Mix tasks