You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+86-15Lines changed: 86 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,34 +1,91 @@
1
1
# Changelog for Elixir v1.4
2
2
3
-
## Standard library improvements
3
+
Elixir v1.4 brings new features, enhancements and bug fixes into Elixir. The most notable changes are the addition of the `Registry` module and the `Task.async_stream/3` and `Task.async_stream/5` which aids developers in writing concurrent software. Those two features and a couple other improvements are described in detail below.
4
4
5
-
### Registry
5
+
Overall this is the smallest release since Elixir v1.0 was launched. This aligns well with our goals and the community expectations of Elixir being a stable language with incremental improvements.
6
6
7
-
TODO
7
+
## Registry
8
8
9
-
### Syntax coloring
9
+
The registry is a local, decentralized and scalable key-value process storage:
10
10
11
-
TODO
11
+
* Local because keys and values are only accessible to the current node (opposite to distributed)
12
+
* Decentralized because there is no single entity responsible for managing the registry
13
+
* Scalable because performance scales linearly with the addition of more cores upon partitioning
12
14
13
-
How to disable: `IEx.configure [colors: [syntax_colors: []]]`
15
+
A registry is chosen upon start to have unique or duplicate keys. Every key-value pair is associated to the process registering the key. Keys are automatically removed once the owner process terminates.
With the registry, developers can provide dynamic process names, module-function dispatch or even a local pubsub system. See the `Registry` documentation for more information.
18
23
19
-
### Task.async_stream
24
+
##Syntax coloring
20
25
21
-
TODO
26
+
Elixir v1.4 introduces the ability to syntax color inspected data structures:
Coloring is done with ANSI colors as specified in the `IO.ANSI` module.
26
32
27
-
TODO
33
+
IEx automatically relies on this feature to provide syntax coloring for evaluated shell results. This behaviour can be configured via the `:syntax_colors` coloring option:
To disable coloring altogether, pass an empty list to `:syntax_colors`.
38
+
39
+
## Calendar
40
+
41
+
Elixir v1.3 introduced new calendar types. This release continues evolving the Calendar APIs by adding functions for comparing, adding and calculating the difference between types, retrieve the `day_of_week/1`, check if the current date is a `leap_year?/1` and more.
42
+
43
+
## Task.async_stream
44
+
45
+
When there is a need to traverse a collection of items concurrently, Elixir developers often resort to tasks:
While the snippet above works fine in my occasions, for large collections it may be problem as it will spawn as many tasks as there are items in the collection. In many situations, you may want to set a limit of how many tasks will be running concurrently.
52
+
53
+
`Task.async_stream/3` and `Task.async_stream/5` allows developers to process collections concurrently while controlling the maximum amount of concurrent tasks:
Note `Task.async_stream/3` is lazy, allowing developers to partially consume the stream until a condition is reached. Furthermore, `Task.Supervisor.async_stream/4` and `Task.Supervisor.async_stream/6` can be used to ensure the concurrent tasks are spawned under the given supervisor.
59
+
60
+
## Application inflection
61
+
62
+
Mix v1.4 now automatically inflects the list of applications that are used on runtime from your dependencies list.
63
+
64
+
In previous Mix versions, most of your dependencies had to be added both to your dependencies list and applications list. Here is how a `mix.exs` could look like:
65
+
66
+
def application do
67
+
[applications: [:logger, :plug, :postgrex]]
68
+
end
69
+
70
+
def deps do
71
+
[{:plug, "~> 1.2"},
72
+
{:postgrex, "~> 1.0"}]
73
+
end
74
+
75
+
This was error prone as many developers would not list their dependencies in their applications list. Mix v1.4 now automatically inflects your applications list as long as you leave the `:applications` key empty. The `mix.exs` above can be rewritten to:
76
+
77
+
def application do
78
+
[extra_applications: [:logger]]
79
+
end
80
+
81
+
def deps do
82
+
[{:plug, "~> 1.2"},
83
+
{:postgrex, "~> 1.0"}]
84
+
end
85
+
86
+
As shown in the example above, any dependency that comes from Erlang or Elixir that is required at runtime can be added to the `:extra_applications` list. Finally, if there is a dependency you don't want to include in the application runtime list, you can do so by specifying the `runtime: false` option:
87
+
88
+
{:distillery, "> 0.0.0", runtime: false}
32
89
33
90
## v1.4.0-dev
34
91
@@ -50,6 +107,8 @@ TODO
50
107
*[Integer] Add `Integer.mod/2` and `Integer.floor_div/2`
51
108
*[Kernel] Recognize merge conflict markers in source and provide a readable error message
52
109
*[Kernel] Warn on unused module attributes
110
+
*[Kernel] Improve compiler message on unexpected end of line
111
+
*[Kernel] Raise `BadBooleanError` when a non-boolean is given on the left-hand side of `and`/`or`
53
112
*[List] Add `List.pop_at/3`
54
113
*[List] Add `List.myers_difference/2`
55
114
*[OptionParser] Expand multi-letter aliases in `OptionParser`
@@ -64,6 +123,7 @@ TODO
64
123
65
124
#### ExUnit
66
125
126
+
*[ExUnit.Diff] Use red or green background for whitespace-only diffs
67
127
*[ExUnit.Doctest] Allow inspected structures with multiples lines and unicode characters in the doctest result
68
128
*[ExUnit.Formatter] Replace lhs/rhs with left/right in the formatter for clarity
69
129
@@ -83,6 +143,8 @@ TODO
83
143
*[Mix] Check directory existence in `mix new` and ask how to proceed if one exists
84
144
*[Mix] Applications built with the `--sup` flag now have an individual module to work as application callback
85
145
*[Mix] Add `--formatter` option to `mix test`
146
+
*[Mix] Warn if there are non-applications in the `apps` directory for umbrella projects
147
+
*[Mix] Automatically inflect the list of applications for Mix projects
86
148
*[Mix.Dep] Add warning for invalid paths on `mix deps.clean`
87
149
*[Mix.Project] Add `Mix.Project.apps_paths` that returns the paths to children applications in umbrella projects
88
150
*[Mix.Rebar] Add `MIX_REBAR` environment variable for overriding local rebar
@@ -93,6 +155,7 @@ TODO
93
155
94
156
*[Float] Avoid multiple roundings in `Float.{ceil/2, floor/2, round/2}`
95
157
*[Kernel] Don't crash in `macro_exported?/3` when dealing with Erlang modules
158
+
*[Kernel] Ensure locals calls are rewritten when calling a local function or macro from inside a module
96
159
*[Kernel.SpecialForms] Produce meaningful warning when with's else clauses have no effect
97
160
*[Macro] Wrap fn calls in parens in `Macro.to_string/2`
98
161
*[Macro] Do not print aliases as keys inside keyword lists in `Macro.to_string/2`
@@ -105,6 +168,10 @@ TODO
105
168
106
169
*[ExUnit] Fix a race condition in `assert_receive` where we would assert a message was not received but show it in the list of messages when the message is delivered right after the timeout value
107
170
171
+
### IEx
172
+
173
+
*[IEx.Helpers] Purge consolidated protocols before and after `recompile/0`
174
+
108
175
### Mix
109
176
110
177
*[Mix.Dep] Use `gmake` on FreeBSD instead of `make` when compiling make dependencies
@@ -118,6 +185,10 @@ TODO
118
185
*[Enum]`Enum.partition/2` has been deprecated in favor of `Enum.split_with/2`
119
186
*[System] Deprecate plural time units in favor of singular ones to align with future Erlang releases
120
187
188
+
#### ExUnit
189
+
190
+
*[ExUnit] Using GenEvent to implement ExUnit formatters is deprecated. Please use the new `GenServer` based formatters instead
0 commit comments