Skip to content

Commit 76b804f

Browse files
author
José Valim
committed
Start v1.11
1 parent 033c738 commit 76b804f

File tree

4 files changed

+13
-219
lines changed

4 files changed

+13
-219
lines changed

CHANGELOG.md

+4-211
Original file line numberDiff line numberDiff line change
@@ -1,222 +1,15 @@
1-
# Changelog for Elixir v1.10
1+
# Changelog for Elixir v1.11
22

3-
## Support for Erlang/OTP 21+
4-
5-
Elixir v1.10 requires Erlang/OTP 21+, allowing Elixir to integrate with Erlang/OTP's new logger. Currently, this means that the logger level, logger metadata, as well as all log messages are now shared between Erlang and Elixir APIs.
6-
7-
We will continue improving the relationship between the logging systems in future releases. In particular, we plan to expose all log levels and runtime filtering functionalities available in Erlang directly into Elixir in the next Elixir version.
8-
9-
This release also adds two new guards, `is_struct/1` and `is_map_key/2`, thanks to the strict requirement on Erlang/OTP 21+.
10-
11-
## Releases improvements
12-
13-
Elixir v1.9 introduced releases as a mechanism to package self-contained applications. Elixir v1.10 further improves releases with bug fixes and new enhancements based on feedback we got from the community. The highlights are:
14-
15-
* Allow the dual boot system of releases to be disabled on environments that are boot-time sensitive, such as embedded devices
16-
17-
* Track and raise if compile-time configuration is set or changes at runtime (more in the next section)
18-
19-
* Support for easily adding extra files to releases via overlays
20-
21-
* Allow `RELEASE_DISTRIBUTION` to be set to `none` in order to fully disable it
22-
23-
* Add a built-in `:tar` step that automatically packages releases
24-
25-
See the full CHANGELOG for more improvements.
26-
27-
## Improvements to sort-based APIs in Enum
28-
29-
`Enum.sort/1` in Elixir always sorts from lowest to highest. If you want to sort from highest to lowest, you need to call `Enum.sort/2` with a custom sorting function, such as `Enum.sort(collection, &>=/2)`, which is not immediately obvious to someone reading the code.
30-
31-
To make matters worse, comparison operators, such as `<=` and `>=`, perform structural sorting, instead of a semantic one. For example, using `>=` to sort dates descendingly won't yield the correct result. Therefore, to sort dates from more recent to oldest, one has to write `Enum.sort(dates, &(Date.compare(&1, &2) != :lt))`.
32-
33-
Elixir v1.10 streamlines the sorting functions by introducing both `:asc` and `:desc` shortcuts:
34-
35-
Enum.sort(collection, :asc) # the default
36-
Enum.sort(collection, :desc) # in reverse
37-
38-
Furthermore, if you want to perform semantic comparison, you can pass a module that provides the relevant comparison function. For example, to sort dates:
39-
40-
Enum.sort(birth_dates, Date)
41-
Enum.sort(birth_dates, {:asc, Date})
42-
Enum.sort(birth_dates, {:desc, Date})
43-
44-
This new API has also been added to `Enum.sort_by`, `Enum.min_by`, `Enum.max_by`, and friends.
45-
46-
### Tracking of compile-time configuration
47-
48-
All applications in Elixir come with an application environment. This environment is a key-value store that allows us to configure said application. While reading the application environment at runtime is the preferred approach, in some rare occasions you may want to use the application environment to configure the compilation of a certain project. This is often done by calling `Application.get_env/3` outside of a function:
49-
50-
defmodule MyApp.DBClient do
51-
@db_host Application.get_env(:my_app, :db_host, "db.local")
52-
53-
def start_link() do
54-
SomeLib.DBClient.start_link(host: @db_host)
55-
end
56-
end
57-
58-
This approach has one big limitation: if you change the value of the application environment after the code is compiled, the value used at runtime is not going to change! For example, if you are using `mix release` and your `config/releases.exs` has:
59-
60-
config :my_app, :db_host, "db.production"
61-
62-
The new value will have no effect as the code was compiled to connect to "db.local", which is mostly likely unavailable in the production environment.
63-
64-
For those reasons, reading the application environment at runtime should be the first choice. However, if you really have to read the application environment during compilation, Elixir v1.10 introduces a `Application.compile_env/3` function:
65-
66-
@db_host Application.compile_env(:my_app, :db_host, "db.local")
67-
68-
By using `compile_env/3`, Elixir will store the values used during compilation and compare the compilation values with the runtime values whenever your system starts, raising an error in case they differ. This helps developers ensure they are running their production systems with the configuration they intend to.
69-
70-
### Compiler tracing
71-
72-
This release brings enhancements to the Elixir compiler and adds new capabilities for developers to listen to compilation events.
73-
74-
In previous Elixir releases, Elixir would compile a database of cross references between modules (such as function calls, references, structs, etc) for each project. Although developers could traverse this database, they often requested more events or more information to be made available.
75-
76-
In Elixir v1.10, we have replaced this database by compiler tracing. This means that developers can now directly listen to events emitted by the compiler to store and collect all the information they need (and only the information they need).
77-
78-
Elixir itself is already using the new compiler tracing to provide new functionality. In particular, the compiler now checks for undefined function warnings more consistently. In previous versions, we would emit undefined function warnings only for files in `lib`, skipping test files and scripts.
79-
80-
Furthermore, in Elixir v1.10 developers can now disable undefined function warnings directly on the callsite. For example, imagine you have an optional dependency which may not be available in some cases. You can tell the compiler to skip warning on calls to optional modules with:
81-
82-
@compile {:no_warn_undefined, OptionalDependency}
83-
defdelegate my_function_call(arg), to: OptionalDependency
84-
85-
Finally, as consequence of these improvements, some functionality related to `xref` (our previous database), has been deprecated in favor of the new compiler tracing.
86-
87-
### Other enhancements
88-
89-
The calendar data types got many improvements, such as sigil support for third-party calendars, as well as the additions of `DateTime.now!/2`, `DateTime.shift_zone!/3`, and `NaiveDateTime.local_now/0`.
90-
91-
There are many improvements related to the Elixir AST in this release too. First of all, `Code.string_to_quoted/2` has two new options, `:token_metadata` and `:literal_encoder`, that give more control over Elixir's parser. This information has already been available to the Elixir formatter for a couple versions and has now been made public. Furthermore, all public metadata entries in the AST nodes have been extensively documented. These changes alongside the compiler improvements from previous section means tools like Credo and Boundary now have a better foundation to analyze the source code.
92-
93-
Finally, ExUnit comes with two small but important improvements: `ExUnit.CaptureIO` can now be used in tests that run asynchronously and we have added "data-structure diffing" when performing assertions with pattern matching. So now, whenever an assertion such `assert %{field: value} = expression()` fails, ExUnit will show both left-hand and right-hand sides, highlighting the parts that did not match in red.
94-
95-
## v1.10.0
3+
## v1.11.0-dev
964

975
### 1. Enhancements
986

99-
#### Elixir
100-
101-
* [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
102-
* [Calendar] Allow custom calendar representations in calendar sigils
103-
* [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
104-
* [CLI] Add support for `NO_COLOR` environment variable
105-
* [Code] Add `:token_metadata` and `:literal_encoder` support to `Code.string_to_quoted/2`
106-
* [Code] Add compiler tracing to lift events done by the compiler
107-
* [Code] Return `{:error, :unavailable}` in `Code.ensure_compiled/1` if module is in a deadlock
108-
* [DateTime] Add `DateTime.now!/2` and `DateTime.shift_zone!/3`
109-
* [Enum] Speed up getting one random element from enumerables
110-
* [Enum] Add `Enum.frequencies/1`, `Enum.frequencies_by/2`, and `Enum.map_intersperse/2`
111-
* [Enum] Allow a sorting function on `Enum.min/max/min_by/max_by`
112-
* [Enum] Add `asc/desc` and `compare/1` support to `Enum.sort/2`
113-
* [Exception] Add version alongside app names in stacktraces
114-
* [Function] Add `Function.identity/1`
115-
* [Kernel] Add `Kernel.is_struct/1` and `Kernel.is_map_key/2`
116-
* [Kernel] Warn when function head comes immediately after the implementation instead of before the implementation
117-
* [Kernel] Warn if duplicate key is found in struct declaration
118-
* [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
119-
* [Keyword] Add `Keyword.pop!/2` and `Keyword.pop_values/2`
120-
* [Map] Add `Map.pop!/2`
121-
* [MapSet] Optimize multiple operations
122-
* [Module] Add `Module.has_attribute?/2`
123-
* [Module] Add `@compile {:no_warn_undefined, mfa_or_module}` to turn off undefined function warnings
124-
* [NaiveDateTime] Add `NaiveDateTime.local_now/0`
125-
* [Record] Warn if duplicate key is found in record declaration
126-
* [String] Update to Unicode 12.1
127-
* [StringIO] Add `:encoding` option to StringIO and optimize `get_chars` operation
128-
129-
#### ExUnit
130-
131-
* [ExUnit.Assertions] Support diffs in pattern matching and in `assert_receive`
132-
* [ExUnit.CaptureIO] Supports capturing named devices in asynchronous tests
133-
134-
#### IEx
135-
136-
* [IEx] Warn on circular file imports when loading default `.iex.exs`
137-
* [IEx] Allow customization of the continuation prompt on IEx
138-
139-
#### Logger
140-
141-
* [Logger] Allow `start_options` to be configured on Logger's GenEvent
142-
* [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
143-
144-
#### Mix
145-
146-
* [mix compile] Add `--profile time` flag to profile compilation steps
147-
* [mix deps.compile] Add `--skip-umbrella-apps` flag. The new flag does not compile umbrella apps. This is useful for building caches in CD/CI pipelines
148-
* [mix deps.unlock] Add `--check-unused` flag. The new flag raises if there are any unused dependencies in the lock file
149-
* [mix release] Allow `RELEASE_DISTRIBUTION` to be set to `none`
150-
* [mix release] Support overlays in `rel/overlays`
151-
* [mix release] Allow configuration reboot to be disabled in releases
152-
* [mix test] Add support for simple round-robin test partitioning across multiple machines
153-
* [Mix.Project] Add `MIX_DEPS_PATH` environment variable for setting `:deps_path`
154-
* [Mix.Project] Add `Mix.Project.deps_scms/1` that returns deps with their SCMs
155-
* [Mix.Task] Add `Mix.Task.Compiler.after_compiler/2` callback, to simplify compilers that may need to run something at multiple steps
156-
1577
### 2. Bug fixes
1588

159-
#### EEx
160-
161-
* [EEx] Ensure multiline do/end with no spaces compile under trim mode
162-
163-
#### Elixir
164-
165-
* [Enum] Allow positive range slices on infinite streams given to `Enum.slice/2`
166-
* [Kernel] Raise error on functions/guards without implementation
167-
* [Keyword] Ensure keyword replace and update preserve order
168-
* [Module] Raise instead of silently failing when performing a write module operation during after-compile
169-
* [Module] Fix `@macrocallback` definitions with a `when` clause
170-
* [Stream] Close with correct accumulator in `Stream.resource/3` when called for a single-element list
171-
* [Stream] Allow `Stream.cycle/1` to be double nested inside `Stream.cycle/1`
172-
* [URI] Preserve slashes in URIs without authority
173-
174-
#### IEx
175-
176-
* [IEx] Exit IEx session if the group leader exits
177-
* [IEx] Allow `pry` to be used in non-tty terminals
178-
179-
#### Mix
180-
181-
* [mix compile] Do not filter out warning for external files from diagnostics
182-
* [Mix.Project] Ensure user given `:manager` to dependencies has higher precedence than the SCM one
183-
* [Mix.Project] Recompile umbrella children when config files change and `mix compile` is called from the umbrella root
184-
* [Mix.Task] Always recompile before running tasks from dependencies
185-
* [Mix.Task] Ensure project's Logger config is used when running Mix tasks
186-
1879
### 3. Soft-deprecations (no warnings emitted)
18810

189-
#### Elixir
190-
191-
* [Code] `compiler_options/0` is deprecated in favor of `compiler_option/1`
192-
193-
#### Mix
194-
195-
* [mix xref] `calls/0` is deprecated in favor of compiler tracer
196-
* [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
197-
19811
### 4. Hard-deprecations
19912

200-
#### Elixir
201-
202-
* [Code] `Code.load_file/2` has been deprecated in favor of `Code.require_file/2` or `Code.compile_file/2`
203-
* [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
204-
* [Code] `Code.ensure_compiled?/1` is deprecated in favor of `Code.ensure_compiled/1`
205-
* [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+
206-
* [Supervisor] `Supervisor.Spec.supervise/2` has been deprecated in favor of the new Supervisor child specification
207-
* [Supervisor] The `:simple_one_for_one` strategy in `Supervisor` has been deprecated in favor of `DynamicSupervisor`
208-
209-
#### Logger
210-
211-
* [Logger] `:compile_time_purge_level` application environment configuration has been deprecated in favor of the more general `:compile_time_purge_matching` config
212-
* [Logger] Deprecate logging non-chardata values
213-
214-
#### Mix
215-
216-
* [mix compile.xref] This check has been moved into the compiler and has no effect now
217-
* [mix xref deprecations] This check has been moved into the compiler and has no effect now
218-
* [mix xref unreachable] This check has been moved into the compiler and has no effect now
219-
220-
## v1.9
13+
## v1.10
22114

222-
The CHANGELOG for v1.9 releases can be found [in the v1.9 branch](https://github.com/elixir-lang/elixir/blob/v1.9/CHANGELOG.md).
15+
The CHANGELOG for v1.10 releases can be found [in the v1.10 branch](https://github.com/elixir-lang/elixir/blob/v1.10/CHANGELOG.md).

SECURITY.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ Elixir applies bug fixes only to the latest minor branch. Security patches are a
66

77
| Elixir version | Support
88
| -------------- | ------------------------------
9-
| 1.10 | Development
10-
| 1.9 | Bug fixes and security patches
9+
| 1.11 | Development
10+
| 1.10 | Bug fixes and security patches
11+
| 1.9 | Security patches only
1112
| 1.8 | Security patches only
1213
| 1.7 | Security patches only
1314
| 1.6 | Security patches only
14-
| 1.5 | Security patches only
1515

1616
## Announcements
1717

VERSION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.10.0-dev
1+
1.11.0-dev

lib/elixir/pages/Compatibility and Deprecations.md

+5-4
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ Elixir applies bug fixes only to the latest minor branch. Security patches are a
88

99
Elixir version | Support
1010
:------------- | :-----------------------------
11-
1.10 | Development
12-
1.9 | Bug fixes and security patches
11+
1.11 | Development
12+
1.10 | Bug fixes and security patches
13+
1.9 | Security patches only
1314
1.8 | Security patches only
1415
1.7 | Security patches only
1516
1.6 | Security patches only
16-
1.5 | Security patches only
1717

1818
New releases are announced in the read-only [announcements mailing list](https://groups.google.com/group/elixir-lang-ann). All security releases [will be tagged with `[security]`](https://groups.google.com/forum/#!searchin/elixir-lang-ann/%5Bsecurity%5D%7Csort:date).
1919

@@ -171,4 +171,5 @@ Version | Deprecated feature | Replaced by (ava
171171
[v1.7]: https://github.com/elixir-lang/elixir/blob/v1.7/CHANGELOG.md#4-hard-deprecations
172172
[v1.8]: https://github.com/elixir-lang/elixir/blob/v1.8/CHANGELOG.md#4-hard-deprecations
173173
[v1.9]: https://github.com/elixir-lang/elixir/blob/v1.9/CHANGELOG.md#4-hard-deprecations
174-
[v1.10]: https://github.com/elixir-lang/elixir/blob/master/CHANGELOG.md#4-hard-deprecations
174+
[v1.10]: https://github.com/elixir-lang/elixir/blob/v1.10/CHANGELOG.md#4-hard-deprecations
175+
[v1.11]: https://github.com/elixir-lang/elixir/blob/master/CHANGELOG.md#4-hard-deprecations

0 commit comments

Comments
 (0)