Releases: elixir-lang/elixir
v1.9.0-rc.0
Release v1.9.0-rc.0
v1.8.2
1. Bug fixes
EEx
- [EEx] Raise readable error message on bad EEx state
Elixir
- [Protocol] Ensure
:debug_info
is kept in protocols
Logger
- [Logger] Make sure Logger v1.8 does not get stuck in discard mode
- [Logger.Translator] Translate remote process crash in Logger
Checksums
- Precompiled.zip SHA1: 661dbf612c4b5fdb4390ff54121d82ff9452c3f3
- Precompiled.zip SHA512: f110669f99f8716e71f66b74d9604edabd1ed5b041e69962c01bae5274165e86ae95773d2e117ebf7f462fb68f3a2ae7891e50df372d676c2f1d975da59aa9e5
- Docs.zip SHA1: 9bafded1b743437938af8e29d63d06dea44ee96e
- Docs.zip SHA512: 409030abaaf1bcc87dbda850058f36a2f4e4b29ef7c086c130b1619f3d44c79276b8ec42796fb9723704a948db1f828146dc85aa15477029e3cceeb6d6007163
v1.8.1
1. Bug fixes
Elixir
- [Float] Fix rounding for subnormal floats
IEx
- [IEx] Fix
IEx.pry
crash when IEx isn't running - [IEx.CLI] Add IEx warning when using
--remsh
with "dumb" terminal - [IEx.Helpers] Sort results by arity on
h
helper
Mix
- [mix compile] Do not include optional dependencies in extra applications as it is incompatible with shared deps in umbrellas
Checksums
- Precompiled.zip SHA1: 9b9a15b299b15c78ec9c1c92cdcf293905290d09
- Precompiled.zip SHA512: 17c2d07eb4bc259031e7b9f1449bc2a16745a6fb1f3685ed5153da624f87fe49cc61b304a0cb531cbda3407f041b517e2b508cf0b3aa9a998e23598c301c7886
- Docs.zip SHA1: 6b98c75d8e905c849898b708b60e3449ba0c5291
- Docs.zip SHA512: d3f9bc4821c0d1c284b3e233d2f46c7eb6a3173d5a58d1066078ae62a9cf06c3235d0073715083fc67dda279603a9ea4fbe937d042c321fdec56531588dd0c9a
v1.8.0
Elixir v1.8 comes with many improvements at the infrastructure level, improving compilation time, speeding up common patterns, and adding features around introspection of the system.
Custom struct inspections
Elixir now provides a derivable implementation of the Inspect
protocol. In a nutshell, this means it is really easy to filter data from your data structures whenever they are inspected. For example, imagine you have a user struct with security and privacy sensitive information:
defmodule User do
defstruct [:id, :name, :age, :email, :encrypted_password]
end
By default, if you inspect a user via inspect(user)
, it will include all fields. This can cause fields such as :email
and :encrypted_password
to appear in logs, error reports, etc. You could always define a custom implementation of the Inspect
protocol for such cases but Elixir v1.8 makes it simpler by allowing you to derive the Inspect
protocol:
defmodule User do
@derive {Inspect, only: [:id, :name, :age]}
defstruct [:id, :name, :age, :email, :encrypted_password]
end
Now all user structs will be printed with all remaining fields collapsed:
#User<id: 1, name: "Jane", age: 33, ...>
You can also pass @derive {Inspect, except: [...]}
in case you want to keep all fields by default and exclude only some.
Time zone database support
In Elixir v1.3, Elixir added four types, known as Calendar types, to work with dates and times: Time
, Date
, NaiveDateTime
(without time zone) and DateTime
(with time zone). Over the last releases we have added many enhancements to the Calendar types but the DateTime
module always evolved at a slower pace since Elixir did not provide support for a time zone database.
Elixir v1.8 now defines a Calendar.TimeZoneDatabase
behaviour, allowing developers to bring in their own time zone databases. By defining an explicit contract for time zone behaviours, Elixir can now extend the DateTime
API, adding functions such as DateTime.shift_zone/3
. By default, Elixir ships with a time zone database called Calendar.UTCOnlyTimeZoneDatabase
that only handles UTC.
Other Calendar related improvements include the addition of Date.day_of_year/1
, Date.quarter_of_year/1
, Date.year_of_era/1
, and Date.day_of_era/1
.
Faster compilation and other performance improvements
Due to improvements to the compiler made over the last year, Elixir v1.8 should compile code about 5% faster on average. This is yet another release where we have been able to reduce compilation times and provide a more joyful development experience to everyone.
The compiler also emits more efficient code for range checks in guards (such as x in y..z
), for charlists with interpolation (such as 'foo #{bar} baz'
), and when working with records via the Record
module.
Finally, EEx templates got their own share of optimizations, emitting more compact code that runs faster.
Improved instrumentation and ownership with $callers
The Task
module is one of the most common ways to spawn light-weight processes to perform work concurrently. Whenever you spawn a new process, Elixir annotates the parent of that process through the $ancestors
key. This information can be used by instrumentation tools to track the relationship between events occurring within multiple processes. However, many times, tracking only the $ancestors
is not enough.
For example, we recommend developers to always start tasks under a supervisor. This provides more visibility and allows us to control how those tasks are terminated when a node shuts down. In your code, this can be done by invoking something like: Task.Supervisor.start_child(MySupervisor, task_specification)
. This means that, although your code is the one who invokes the task, the actual parent of the task would be the supervisor, as the supervisor is the one spawning it. We would list the supervisor as one of the $ancestors
for the task, but the relationship between your code and the task is lost.
In Elixir v1.8, we now track the relationship between your code and the task via the $callers
key in the process dictionary, which aligns well with the existing $ancestors
key. Therefore, assuming the Task.Supervisor
call above, we have:
[your code] -- calls --> [supervisor] ---- spawns --> [task]
which means we store the following relationships:
[your code] [supervisor] <-- ancestor -- [task]
^ |
|--------------------- caller ---------------------|
When a task is spawned directly from your code, without a supervisor, then the process running your code will be listed under both $ancestors
and $callers
.
This small feature is very powerful. It allows instrumentation and monitoring tools to better track and relate the events happening in your system. This feature can also be used by tools like the "Ecto Sandbox". The "Ecto Sandbox" allows developers to run tests concurrently against the database, by using transactions and an ownership mechanism where each process explicitly gets a connection assigned to it. Without $callers
, every time you spawned a task that queries the database, the task would not know its caller, and therefore it would be unable to know which connection was assigned to it. This often meant features that relies on tasks could not be tested concurrently. With $callers
, figuring out this relationship is trivial and you have more tests using the full power of your machine.
1. Enhancements
EEx
- [EEx] Optimize the default template engine to compile and execute more efficiently
Elixir
- [Calendar] Add
Calendar.TimeZoneDatabase
and aCalendar.UTCOnlyTimeZoneDatabase
implementation - [Calendar] Add callbacks
day_of_year/3
,quarter_of_year/3
,year_of_era/1
, andday_of_era/3
- [Code.Formatter] Preserve user's choice of new line after most operators
- [Date] Add
Date.day_of_year/1
,Date.quarter_of_year/1
,Date.year_of_era/1
, andDate.day_of_era/1
- [DateTime] Add
DateTime.from_naive/3
,DateTime.now/1
, andDateTime.shift_zone/3
- [File] Allow
:raw
option inFile.exists?/2
,File.regular?/2
, andFile.dir?/2
- [File] Allow POSIX time as an integer in
File.touch/2
andFile.touch!/2
- [Inspect] Allow
Inspect
protocol to be derivable with the:only
/:except
options - [Kernel] Do not propagate counters to variables in quote inside another quote
- [Kernel] Warn on ambiguous use of
::
and|
in typespecs - [Kernel] Add
:delegate_to
@doc
metadata tag when usingdefdelegate
- [Kernel] Improve compile-time building of ranges via the
..
operator - [Kernel] Compile charlist interpolation more efficiently
- [Kernel] Add
floor/1
andceil/1
guards - [Kernel.SpecialForms] Add
:reduce
option tofor
comprehensions - [List] Add
List.myers_difference/3
andList.improper?/1
- [Macro] Add
Macro.struct!/2
for proper struct resolution during compile time - [Map] Optimize and merge nested maps
put
andmerge
operations - [Range] Add
Range.disjoint?/2
- [Record] Reduce memory allocation when updating multiple fields in a record
- [Registry] Allow associating a value on
:via
tuple - [String] Add
String.bag_distance/2
- [Task] Add
$callers
tracking toTask
- this makes it easier to find which process spawned a task and use it for tracking ownership and monitoring
ExUnit
- [ExUnit] Add
ExUnit.after_suite/1
callback - [ExUnit.Assertions] Show last N messages (instead of first N) from mailbox on
assert_receive
fail
IEx
- [IEx.Helpers] Add
port/1
andport/2
- [IEx.Server] Expose
IEx.Server.run/1
for custom IEx sessions with the ability to broker pry sessions
Mix
- [Mix] Add
Mix.target/0
andMix.target/1
to control dependency management per target - [Mix.Project] Add
:depth
and:parents
options todeps_paths/1
- [mix archive.install] Add a timeout when installing archives
- [mix compile] Include optional dependencies in
:extra_applications
- [mix escript.install] Add a timeout when installing escripts
- [mix format] Warn when the same file may be formatted by multiple
.formatter.exs
- [mix test] Allow setting the maximum number of failures via
--max-failures
- [mix test] Print a message instead of raising on unmatched tests inside umbrella projects
2. Bug fixes
Elixir
- [Calendar] Allow printing dates with more than 9999 years
- [Exception] Exclude deprecated functions in "did you mean?" hints
- [Float] Handle subnormal floats in
Float.ratio/1
- [Kernel] Remove
Guard test tuple_size(...) can never succeed
Dialyzer warning ontry
- [Kernel] Expand operands in
size*unit
bitstring modifier instead of expectingsize
andunit
to be literal integers - [Kernel] Do not deadlock on circular struct dependencies in typespecs
- [Kernel] Raise proper error message when passing flags to the Erlang compiler that Elixir cannot handle
- [Kernel] Do not leak variables in
cond
clauses with a single matching at compile-time clause - [NaiveDateTime] Do not accept leap seconds in builder and parsing functions
- [String] Fix ZWJ handling in Unicode grapheme clusters
- [StringIO] Handle non-printable args in StringIO gracefully
IEx
- [IEx.Helpers] Use typespec info (instead of docs chunk) and properly format callbacks in
b/1
Logger
- [Logger] Allow Logger backends to be dynamically removed when an application is shutting down
Mix
- [mix compile] Ensure changes in deps propagate to all umbrella children - this fix a long standing issue where updating a dependency would not recompile all projects accordingly, requiring a complete removal of
_build
- [mix compile] Av...
v1.8.0-rc.1
Release v1.8.0-rc.1
v1.8.0-rc.0
Release v1.8.0-rc.0
v1.7.4
1. Enhancements
Elixir
- [Kernel] Expand
left..right
at compile time in more cases, which leads to improved performance under different scenarios, especially onx in left..right
expressions
Mix
- [mix deps.loadpaths] Add
--no-load-deps
flag. This is useful for Rebar 3 compatibility
2. Bug fixes
Elixir
- [Calendar] Fix for converting from negative iso days on New Year in a leap year
- [Kernel] Ensure
@spec
,@callback
,@type
and friends can be read accordingly - [Module] Avoid warnings when using Module.eval_quoted in the middle of existing definitions
Mix
- [mix archive.build] Unload previous archive versions before building
- [mix format] Expand paths so mix format
path\for\windows.ex
works - [mix test] Ensure that
--cover
displays correct coverage in an umbrella app
Checksums
- Precompiled.zip SHA1: eb328d3b071b33d80ad4cb4b3b203c1b2d7a5186
- Precompiled.zip SHA512: 807002481ae129fa1610a1facabe19765e2542397923d5c89e16b58f54870f2e444973e136d6b1207190b3117c03a37430860b6e3e6b7d59b3afb1b01852c6e3
- Docs.zip SHA1: 47ae4cea91a2da8ff040e346c059afccbdbffa13
- Docs.zip SHA512: 5b760a37e45640ab5816ad3ef2b581071e534fd0c409aa1a5348ee9a44980b099f54d66a3f9228be4ece1481a24b7109b1c9ac01d0aa0df4713fb0be1ca2de35
v1.7.3
1. Bug fixes
ExUnit
- [ExUnit.Assertions] Do not attempt to expand
try/1
as it is a special form
Mix
- [mix compile.app] Do not include applications with
runtime: false
as a runtime dependency for applications coming from Hex
Checksums
- Precompiled.zip SHA1: 9bfe816aaedeb9c5d40095b4eb4f5cb07eb33c2b
- Precompiled.zip SHA512: f8b0ac405531d46f4b65f459970c4b82892f8db51028f172072748269a922db65cb58e36239cd26dc39e5bdebd08a0e630ecbc267b6ff55a15d188483d78a0e5
- Docs.zip SHA1: 3ef076afc86a10fb422ec340f57079bb2480863c
- Docs.zip SHA512: a3cf7bb9bf31ce4bdbaa44470c2be82f9482f3b8ff3eb7fec86ba89debcf639a27c0a045ea65ce8e80aa86c2e9e4bbb8fa98f6389a6093191518f2180833aa2d
v1.7.2
v1.7.2 (2018-08-05)
1. Bug fixes
Elixir
- [Kernel] Do not emit warnings for repeated docs over different clauses due to false positives
Mix
- [mix compile] Properly mark top-level dependencies as optional and as runtime. This fixes a bug where Mix attempted to start optional dependencies of a package when those optional dependencies were not available
- [mix compile] Avoid deadlock when a config has a timestamp later than current time
- [mix test] Do not fail suite if there are no test files
2. Enhancements
Elixir
- [DateTime] Take negative years into account in
DateTime.from_iso8601/1
Mix
- [mix help] Show task and alias help when both are available
Checksums
- Precompiled.zip SHA1: 97051389559547248d7e7f497ed3866ef11e3072
- Precompiled.zip SHA512: e7ebdfcd301737967d0c04df50d3ba5b5a0663d2a2e2ac771cf61b9aa8d73a8f64dd9a408890ff0e2db4e48df8f94ff4d5fb7060f25592411e54910cdfc567a0
- Docs.zip SHA1: 7fbcff81b1032570c1f9a0dfa232e8b1bdd0490a
- Docs.zip SHA512: 8625522139f6a961fedb18b00cc78cad5e344f17b5a8a72746ceb284aab3f712db4b7ad57a4cfb86cdfa799a6c0f0b0b6c417117865321bbb70b6bbe0d8f0dd6
v1.7.1
v1.7.1 (2018-07-26)
1. Bug fixes
Elixir
- [Calendar] Work-around a Dialyzer bug that causes it to loop for a long time, potentially indefinitely
Checksums
- Precompiled.zip SHA1: fb06a3d238b65705a0e36fe9c308eef3d8bb5d46
- Precompiled.zip SHA512: 75c1601d985988ecdfcd48892cde4058dd36e52a3aa1c2007290ce587d7fa131d066afc6c34ca9138cf66431de80369681c82cf6290c214853335471c1851deb
- Docs.zip SHA1: e1008908b0fb4e692893dcc5c745f1c219fced1e
- Docs.zip SHA512: d05d1df7d9dab315a96fd7c0a49214e743b6bbe66fbbc6a3d8933c37f9baa5995b061396254b55d8c6ce8d337ed1ae3fcc3f97e65dd1cd8be9d091ce3412e27a