Releases: elixir-lang/elixir
Releases · elixir-lang/elixir
v1.5.1
1. Enhancements
EEx
- [EEx.Engine] Add
handle_beginandhandle_endto EEx
Elixir
- [Kernel] Do not use references on function/macro definitions - this provides large improvements in compilation times in some rare corner cases
- [Supervisor] Support mixing old and new typespecs in
Supervisor.init/2andSupevisor.start_link/2
Mix
- [mix profile.*] Allow profile tasks to run without a project
2. Bug fixes
EEx
- [EEx.Engine] Do not re-use the value of the
init/1callback throughout the compilation stack
Elixir
- [Kernel] Ensure dialyzer does not emit warnings in some uses of
with - [Kernel] Fix dialyzer warnings when
defmacropis used in modules - [Kernel] Ensure Elixir modules can be dialyzed without starting the Elixir application
- [Kernel] Do not serialize references in quoted expressions
- [Kernel] Make sure structs expansion use the latest definition available when struct modules are recompiled
- [Task] Support
:infinitytimeout on Task streams - [Typespec] Ensure typespecs allow
tupleto be used as variable names
v1.5.0
Official announcement: https://elixir-lang.org/blog/2017/07/25/elixir-v1-5-0-released/
1. Enhancements
Elixir
- [Access] Optimize
Access.get/2 - [Base] Optimize Base encode/decode
- [Calendar] Implement Inspect for DateTime with Calendar.ISO
- [Calendar] Add "ISO days" format for conversions between Calendars and
Date.convert/2,Time.convert/2,NaiveDateTime.convert/2andDateTime.convert/2(as well as bang variants) - [Calendar] Add
:calendarfield toTimestruct - [Calendar] Add
Time.diff/3,Date.add/2,Date.diff/2,DateTime.diff/3 - [Calendar] Add
Date.range/2 - [Calendar] Add
Date.new/4,DateTime.utc_now/1,NaiveDateTime.new/8andTime.new/5that allow specifing calendar - [Enum] Add
Enum.chunk_by/4andStream.chunk_by/4 - [Enum] Add
Enum.chunk_every/2andEnum.chunk_every/4with a more explicit API thanEnum.chunk/2andEnum.chunk/4 - [Exception] Add
Exception.blame/3that adds metadata to exceptions - [File] Add
File.read_link/1andFile.read_link!/1 - [File] Introduce
:trim_bomoption forFile.stream!/2 - [Inspect] Add
:printable_limitto control the limit of printable structures - [Integer] Add
Integer.gcd/2 - [Kernel] Add
left not in rightto check that the left side is not in the enumerable on the right - [Kernel] Use the new
debug_infochunk in OTP 20. This provides a mechanism for tools to retrieve the Elixir AST from beam files - [Kernel]
defoverridable/1accepts a module name as argument and marks all callbacks as overridable - [Kernel] Allow non-quoted Unicode atoms and variables according to Unicode Annex #31 (see Unicode Syntax document)
- [Kernel] Warn when a
:__struct__key is used when building/updating structs - [Kernel] Cache the AST on definitions. This speeds up the compilation time from 10% to 15% measured across different projects
- [Kernel] Improve compiler error message on invalid patterns and guards
- [Keyword] Add
replace/3andreplace!/3for replacing an existing key - [List]
List.starts_with?/2 - [Macro] Introduce
Macro.generate_arguments/2 - [Map] Optimize
Map.merge/3by choosing merging direction - [Map] Add
replace/3andreplace!/3for replacing an existing key - [Map] Raise
BadMapErrorinMap.equal?/2when either of the two arguments is not a map - [MapSet] Reduce
MapSetsize when serialized to approximately half - [Process] Add
Process.cancel_timer/2 - [Protocol] Show available implementations on
Protocol.UndefinedErrorif the protocol has been consolidated - [Registry] Support ETS guard conditions in
Registry.match/3 - [Registry] Support
parallel: trueinRegistry.dispatch/3 - [Registry] Introduce
Registry.unregister_match/4 - [Stream] Add
Stream.chunk_every/2andStream.chunk_every/4with a more explicit API thanStream.chunk/2andStream.chunk/4 - [String] Optimise binary pattern matching in
String.split/1andString.trim_*/1 - [Supervisor] Add
Supervisor.init/2andSupervisor.child_spec/2 - [Supervisor] Allow
moduleand{module, arg}to be given toSupervisor.start_link/2and invokemodule.child_spec(arg)on each argument - [Task] Support
:on_timeoutinTask.async_streamto control how tasks are terminated - [Task] Add
ordered: falsesupport toTask.async_stream
ExUnit
- [ExUnit] Show code snippet from test source file in case of test errors
- [ExUnit] Use
Exception.blame/3when formatting test errors - [ExUnit] Make
assert_raise/2fail if the underlying exception has a brokenmessage/1implementation - [ExUnit] Add
start_supervised/2andstop_supervised/1to ExUnit. Processes started by this function are automatically shut down when the test exits
IEx
- [IEx.Autocomplete] Support autocompletion of variable names
- [IEx.Autocomplete] Support autocompletion of functions imported using
import Mod, only: [...] - [IEx.Evaluator] Use
Exception.blame/3when showing errors in the terminal - [IEx.Helpers] Add
exports/1IEx helper to list all exports in a module - [IEx.Helpers] Add
break!/2,break!/4,breaks/0,continue/0,open/0,remove_breaks/0,remove_breaks/1,reset_break/1,reset_break/3andwhereami/1for code debugging - [IEx.Helpers] No longer emit warnings for IEx commands without parentheses
- [IEx.Helpers] Add
runtime_info/0for printing runtime system information - [IEx.Helpers] Add
open/1to open the source of a given module/function in your editor - [IEx.Info] Implement
IEx.Infoprotocol for calendar types
Logger
- [Logger] Add
metadata: :allconfiguration to log all metadata
Mix
- [mix compile.elixir] Add
--all-warningsoption to Elixir compiler that shows all warnings from the previous compilation (instead of just of the files being compiled) - [mix escript.build] Strip debug information from escripts by default and add option
:strip_beamwhich defaults to true - [mix loadpaths] Ensure
--no-deps-checkdo not trigger SCM callbacks (such asgit) - [mix local.hex] Add
--if-missingflag tolocal.hexmix task - [mix profile.cprof] Add
Mix.Tasks.Profile.Cproffor count-based profiling - [mix new] New styling for generated applications
2. Bug fixes
Elixir
- [Calendar] Ensure
Calendar.ISOraises a readable error when reaching up the year 10000 restriction - [Calendar] Return
{:error, :invalid_time}for wrong precision instead of crashing when parsing ISO dates - [Enumerable] Raise
Protocol.UndefinedErroron bad functions in Enumerable implementation - [File] Ensure recursive file operations raise on paths with null bytes (security issue reported by Griffin Byatt)
- [File] Support
:ram/:rawfiles inFile.copy/2 - [Inspect] Do not use colors when inspecting error messages
- [Kernel] Support guards on anonymous functions of zero arity
- [Kernel] Fix compilation of maps used as maps keys inside matches
- [Kernel] Ensure
doclause inwithis tail call optimizable - [Module]
on_definition/6callback receives body wrapped in a keyword list, such as[do: body]. This solves a bug where it was impossible to distinguish between a bodyless clause and a function that returnsnil. - [Path] Ensure recursive path operations raise on paths with null bytes (security issue reported by Griffin Byatt)
- [Protocol] Do not lose source compile info on protocol consolidation
- [Record] Properly escape quoted expressions passed to
defrecord - [Regex] Fix
inspect/2for regexes with/terminator in them - [Registry] Ensure
Registry.match/4works with:_as key - [Stream] Fix stream cycle over empty enumerable
- [String] Consider Unicode non-characters valid according to the specification in
String.valid?/1 - [StringIO] Fix encoding and performance issues in
StringIO.get_until - [System] Raise on paths with null bytes in
System.cmd/2and inSystem.find_executable/1(security issue reported by Griffin Byatt) - [System] Raise on ill-formed environment variables (security issue reported by Griffin Byatt)
ExUnit
- [ExUnit] Properly account failed tests when
setup_allfails
IEx
- [IEx] Skip autocompletion of module names that are invalid without being quoted
- [IEx] Skip autocompletion of functions with default arguments with
@doc false - [IEx] Do not start oldshell alongside IEx
Mix
- [mix compile.elixir] Store multiple sources in case of module conflicts. This solves an issue where
_buildwould get corrupted when compiling Elixir projects with module conflicts - [mix compile.erlang] Do not silently discard Erlang compile errors
- [mix compile.erlang] Properly track
-compilemodule attribute when specified as a list - [mix compile.protocols] Ensure protocol implementations do not "disappear" when switching between applications in umbrella projects by having separate consolidation paths per project
- [mix compile.protocols] Do not raise when consolidating a protocol that was converted into a module
3. Soft deprecations (no warnings emitted)
Elixir
- [Kernel]
not left in rightis soft-deprecated in favor ofleft not in right
4. Deprecations
Elixir
Atom.to_char_list/1,Float.to_char_list/1,Integer.to_char_list/1,Integer.to_char_list/2,Kernel.to_char_list/1,List.Chars.to_char_list/1,String.to_char_list/1have been deprecated in favor of theirto_charlistversion. This aligns with the naming conventions in both Erlang and Elixir- [Enum] Deprecate
Enum.filter_map/3in favor ofEnum.filter/2+Enum.map/2or for-comprehensions - [GenEvent] Deprecate
GenEventand provide alternatives in its docs - [Kernel] Using
()to meannilis deprecated - [Kernel]
:as_char_lists valueinInspect.Opts.t/0type, in favor of:as_charlists - [Kernel]
:char_listskey inInspect.Opts.t/0type, in favor of:charlists - [Module] Using Erlang parse transforms via
@compile {:parse_transform, _}is deprecated - [Stream] Deprecate
Stream.filter_map/3in favor ofStream.filter/2+Stream.map/2 - [String]
String.ljust/3andString.rjust/3are deprecated in favor ofString.pad_leading/3andString.pad_trailing/3with a binary padding - [String]
String.strip/1andString.strip/2are deprecated in favor ofString.trim/1andString.trim/2 - [String]
String.lstrip/1andString.rstrip/1are deprecated in favor ofString.trim_leading/1andString.trim_trailing/1 - [String]
String.lstrip/2andString.rstrip/2are deprecated in favor ofString.trim_leading/2andString.trim_trailing/2with a binary as second argument - [Typespec]
char_list/0type is deprecated in favor of `...
v1.5.0-rc.2
Release v1.5.0-rc.2
v1.5.0-rc.1
Release v1.5.0-rc.1
v1.5.0-rc.0
Release v1.5.0-rc.0
v1.4.5
This version includes changes that make Elixir fully compatible with Erlang/OTP 20.
1. Enhancements
Logger
- [Logger] Handle changes to crash reports in OTP 20
2. Bug fixes
Elixir
- [DateTime] Fix
DateTime.from_iso8601/2when offset has no colon - [Registry] Do not leak EXIT messages on
Registry.dispatch/3
v1.4.4
v1.4.3
Note: This release had a regression that has been immediately fixed on version 1.4.4.
This version includes changes that make Elixir fully compatible with Erlang OTP 20-rc.1.
1. Enhancements
Elixir
- [Kernel] Improve compilation time for modules with many clauses
- [Map] Warn when attempting to override
__struct__key - [Regex] Add
recompile/1andrecompile!/1to ease transition to OTP 20 for archives and stored regexes
Logger
- [Logger.Translator] Handle OTP 20 GenServer log messages
Mix
- [mix compile] Recompile projects if OTP version changes
2. Bug fixes
Elixir
- [Kernel] Fix code generation when non-binary bitstrings are in AST
- [Record] Properly escape fields passed to
defrecord
ExUnit
- [ExUnit.Diff] Do not fail when comparing maps with nil or boolean keys
IEx
- [IEx.Helpers] Do not log exits on
IEx.Helpers.c/2failures
Mix
- [mix archive.install] Detect proper path on URLs with query strings
- [mix loadpaths] Do not assume all paths in loadpaths exist
v1.4.2
1. Bug fixes
EEx
- [EEx] Support middle expressions on trim mode
Elixir
- [Calendar] Correct typo on Calendar types
- [Kernel] Ensure redefined functions point to the proper source
- [OptionParser] Add
:allow_nonexistent_atomsto support unsafe behaviour prior to v1.4 - [Stream] Allow consuming multiple items from suspended enumerable in
Stream.transform/3 - [String] Incorporate new grapheme rules in Unicode 9
IEx
- [IEx.Autocomplete] Do not crash on aliases which are not known at compile time
Mix
- [Mix.Umbrella] Ensure umbrella projects can depend on other umbrella projects
- [Mix.Archive] Ensure previous archives with
.ezextension are deleted
v1.4.1
1. Bug fixes
Elixir
- [Kernel] Remove warning when making private functions overridable
- [Path] Ensure
Path.join/1returns strings for lists of one element - [Regex] Ensure
Regex.escape/1also escapes-
IEx
- [IEx] Disable ANSI detection for powershell to avoid false positives
Mix
- [Mix.Make] Run
make cleanforerlang.mk - [Mix.Rebar] Support all of rebar3 dependency package declaration
- [Mix.Rebar] Only pass overrides from parent to child in Rebar dep