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
+48-97Lines changed: 48 additions & 97 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -122,9 +122,9 @@ While Elixir has always compiled the given files in project or a dependency in p
122
122
123
123
### Code loading bottlenecks
124
124
125
-
Prior to this release, Elixir would load modules as soon as they were defined. However, because the Erlang part of code loading happens within a single process (the code server), this would make it a bottleneck, reducing the amount of parallelization, especially on large projects.
125
+
Prior to this release, Elixir would load modules as soon as they were defined. However, because the Erlang part of code loading happens within a single process (the code server), this would make it a bottleneck, reducing parallelization, especially on large projects.
126
126
127
-
This release makes it so modules are loaded lazily. This reduces the pressure on the code server, making compilation up to 2x faster for large projects, and also reduces the overall amount of work done during compilation.
127
+
This release makes it so modules are loaded lazily. This reduces the pressure on the code server and the amount of work during compilation, with reports of more than two times faster compilation for large projects. The benefits depend on the codebase size and the number of CPU cores available.
128
128
129
129
Implementation wise, [the parallel compiler already acts as a mechanism to resolve modules during compilation](https://elixir-lang.org/blog/2012/04/24/a-peek-inside-elixir-s-parallel-compiler/), so we built on that. By making sure the compiler controls both module compilation and module loading, it can also better guarantee deterministic builds.
130
130
@@ -140,7 +140,7 @@ defmodule MyLib.SomeModule do
140
140
end
141
141
```
142
142
143
-
Because the spawned module is not visible by the compiler, it won't be able to load `MyLib.SomeOtherModule`. You have two options, either use `Kernel.ParallelCompiler.pmap/2` or explicitly call `Code.ensure_loaded!(MyLib.SomeOtherModule)` before spawning the process that uses said module.
143
+
Because the spawned process is not visible to the compiler, it won't be able to load `MyLib.SomeOtherModule`. You have two options, either use `Kernel.ParallelCompiler.pmap/2` or explicitly call `Code.ensure_compiled!(MyLib.SomeOtherModule)` before spawning the process that uses said module.
144
144
145
145
The second one is related to `@on_load` callbacks (typically used for [NIFs](https://www.erlang.org/doc/system/nif.html)) that invoke other modules defined within the same project. For example:
The reason this fails is because `@on_load` callbacks are invoked within the code server and therefore they have limited ability to load additional modules. It is generally advisable to limit invocation of external modules during `@on_load` callbacks but, in case it is strictly necessary, you can set `@compile {:autoload, true}` in the invoked module to address this issue in a forward and backwards compatible manner.
164
164
165
-
Both snippets above could actually lead to non-deterministic compilation in the past, and as a result of these changes, compilating these cases are now deterministic.
165
+
Both snippets above could actually lead to non-deterministic compilation failures in the past, and as a result of these changes, compiling these cases are now deterministic.
166
166
167
167
### Parallel compilation of dependencies
168
168
169
169
This release introduces a variable called `MIX_OS_DEPS_COMPILE_PARTITION_COUNT`, which instructs `mix deps.compile` to compile dependencies in parallel.
170
170
171
-
While fetching dependencies and compiling individual Elixir dependencies already happened in parallel, there were pathological cases where performance would be left on the table, such as compiling dependencies with native code or dependencies where one or two large file would take over most of the compilation time.
171
+
While fetching dependencies and compiling individual Elixir dependencies already happened in parallel, as outlined in the previous section, there were pathological cases where performance gains would be left on the table, such as when compiling dependencies with native code or dependencies where one or two large files would take most of the compilation time.
172
172
173
173
By setting `MIX_OS_DEPS_COMPILE_PARTITION_COUNT` to a number greater than 1, Mix will now compile multiple dependencies at the same time, using separate OS processes. Empirical testing shows that setting it to half of the number of cores on your machine is enough to maximize resource usage. The exact speed up will depend on the number of dependencies and the number of machine cores, although some reports mention up to 4x faster compilation times. If you plan to enable it on CI or build servers, keep in mind it will most likely have a direct impact on memory usage too.
174
174
@@ -201,9 +201,9 @@ Given this may reduce the amount of data printed by default, the default limit h
201
201
202
202
## Erlang/OTP 28 support
203
203
204
-
Elixir v1.19 officially supports Erlang/OTP 28.1+ and later. In order to support the new Erlang/OTP 28 representation for regular expressions, structs can now control how they are escaped by defining a `__escape__/1` callback that must return AST.
204
+
Elixir v1.19 officially supports Erlang/OTP 28.1+ and later. In order to support the new Erlang/OTP 28 representation for regular expressions, structs can now control how they are escaped into abstract syntax trees by defining a `__escape__/1` callback.
205
205
206
-
On the other, the new representation for regular expressions implies they can no longer be used as default values for struct fields. Instead of this:
206
+
On the other hand, the new representation for regular expressions implies they can no longer be used as default values for struct fields. Instead of this:
207
207
208
208
```elixir
209
209
defmoduleFoodo
@@ -232,92 +232,9 @@ Elixir v1.19 is also our first release following OpenChain compliance, [as previ
232
232
233
233
These additions offer greater transparency into the components and licenses of each release, supporting more rigorous supply chain requirements.
234
234
235
-
This work was performed by Jonatan Männchen and sponsored by the Erlang Ecosystem Foundation.
235
+
This work was performed by [Jonatan Männchen](https://maennchen.dev) and sponsored by the [Erlang Ecosystem Foundation](https://erlef.org).
236
236
237
-
## v1.19.0-rc.2 (2025-10-07)
238
-
239
-
### 1. Enhancements
240
-
241
-
#### Elixir
242
-
243
-
*[Regex] Raise error message when regexes are used as default values in struct fields for compatibility with Erlang/OTP 28
244
-
*[Registry] Add key-based partitioning of duplicate registries
245
-
246
-
### 2. Bug fixes
247
-
248
-
#### Elixir
249
-
250
-
*[Kernel] Address issue with type checking not completing on protocol consolidation
251
-
252
-
#### ExUnit
253
-
254
-
*[ExUnit] Do not crash on empty test unit groups
255
-
256
-
#### Mix
257
-
258
-
*[mix help] Add `mix help app:APP`
259
-
*[mix test] Fix module preloading in `mix test --slowest-modules=N`
260
-
261
-
## v1.19.0-rc.1 (2025-10-05)
262
-
263
-
### 1. Enhancements
264
-
265
-
#### Elixir
266
-
267
-
*[Kernel] Raise when U+2028 and U+2029 characters are present in comments and strings to avoid line spoofing attacks
268
-
*[Kernel] Include the line for the previous clause in errors/warnings related to conflicts between defaults on function definitions
269
-
*[Macro] Add `__escape__/1` callback so structs can escape references and other runtime data types in `Macro.escape/1`
270
-
*[OptionParser] Support the `:regex` type
271
-
*[OptionParser] Enhance parsing error to display available options
272
-
*[String] Update to Unicode 17.0.0
273
-
274
-
#### ExUnit
275
-
276
-
*[ExUnit] Set a process label for each test
277
-
278
-
#### Logger
279
-
280
-
*[Logger] Accept any enumerable in `Logger.metadata/1`
281
-
282
-
#### Mix
283
-
284
-
*[mix format] Add options to mix format to allow excluding of files
285
-
*[mix test] Add `--name-pattern` option to `mix test`
286
-
*[Mix.install/2] Support the `:compilers` option
287
-
288
-
### 2. Bug fixes
289
-
290
-
#### Elixir
291
-
292
-
*[Code] Return error on invalid unicode sequences in `Code.string_to_quoted/2` instead of raising
293
-
*[Code] Properly handle column annotation for `in` in `not in` expressions
294
-
*[Enum] Fix infinite loop on `Enum.take/2` with negative index on empty enumerable
295
-
*[Inspect] Inspect ill-formed structs as maps
296
-
*[Kernel] Properly increment metadata newline when `?` is followed by a literal newline character
297
-
298
-
#### ExUnit
299
-
300
-
*[ExUnit.Assertions] Fix order in ExUnit results when listing pinned variables
301
-
*[ExUnit.Assertions] Raise if attempting to raise an assertion error with invalid message (not a binary)
302
-
303
-
#### IEx
304
-
305
-
*[IEx] Abort pipelines when there is an error in any step along the way
306
-
307
-
#### Mix
308
-
309
-
*[mix compile] Fix bug where reverting changes to an external resource (such as HEEx template) after a compilation error would make it so the source module would not be compiled
310
-
*[mix compile] Avoid failures when locking compilation across different users
311
-
*[mix compile] Fix race condition when renaming files used by the compilation lock
312
-
*[mix test] Prevent `mix test` from overriding `:failures_manifest_path` option
313
-
314
-
### 3. Hard deprecations
315
-
316
-
#### Elixir
317
-
318
-
*[Code] Warn if line-break characters outside of `\r` and `\r\n` are found in strings according to UX#55. This warning will be fast-tracked into an error for security reasons in Elixir v1.20, following a similar rule to bidirectional control characters. They will already raise if found in comments
319
-
320
-
## v1.19.0-rc.0 (2025-06-09)
237
+
## v1.19.0 (2025-10-16)
321
238
322
239
### 1. Enhancements
323
240
@@ -335,18 +252,26 @@ This work was performed by Jonatan Männchen and sponsored by the Erlang Ecosyst
335
252
*[Inspect] Allow `optional: :all` when deriving Inspect
336
253
*[Inspect.Algebra] Add optimistic/pessimistic groups as a simplified implementation of `next_break_fits`
337
254
*[IO.ANSI] Add ANSI codes to turn off conceal and crossed_out
338
-
*[Kernel] Allow controlling which applications are used during inference
255
+
*[Kernel] Raise when U+2028 and U+2029 characters are present in comments and strings to avoid line spoofing attacks
256
+
*[Kernel] Include the line for the previous clause in errors/warnings related to conflicts between defaults on function definitions
339
257
*[Kernel] Support `min/2` and `max/2` as guards
340
258
*[Kernel.ParallelCompiler] Add `each_long_verification_threshold` which invokes a callback when type checking a module takes too long
341
259
*[Kernel.ParallelCompiler] Include lines in `== Compilation error in file ... ==` slogans
342
260
*[Macro] Print debugging results from `Macro.dbg/3` as they happen, instead of once at the end
261
+
*[Macro] Add `__escape__/1` callback so structs can escape references and other runtime data types in `Macro.escape/1`
343
262
*[Module] Do not automatically load modules after their compilation, guaranteeing a more consistent compile time experience and drastically improving compilation times
263
+
*[OptionParser] Support the `:regex` type
264
+
*[OptionParser] Enhance parsing error to display available options
344
265
*[Protocol] Type checking of protocols dispatch and implementations
345
266
*[Regex] Add `Regex.to_embed/2` which returns an embeddable representation of regex in another regex
267
+
*[Regex] Raise error message when regexes are used as default values in struct fields for compatibility with Erlang/OTP 28
268
+
*[Registry] Add key-based partitioning of duplicate registries
346
269
*[String] Add `String.count/2` to count occurrences of a pattern
270
+
*[String] Update to Unicode 17.0.0
347
271
348
272
#### ExUnit
349
273
274
+
*[ExUnit] Set a process label for each test
350
275
*[ExUnit.CaptureLog] Parallelize log dispatch when multiple processes are capturing log
351
276
*[ExUnit.Case] Add `:test_group` to the test context
352
277
*[ExUnit.Doctest] Support ellipsis in doctest exceptions to match the remaining of the exception
@@ -357,36 +282,61 @@ This work was performed by Jonatan Männchen and sponsored by the Erlang Ecosyst
357
282
*[IEx] Support multi-line prompts (due to this feature, `:continuation_prompt` and `:alive_continuation_prompt` are no longer supported as IEx configuration)
358
283
*[IEx.Autocomplete] Functions annotated with `@doc group: "Name"` metadata will appear within their own groups in autocompletion
359
284
285
+
#### Logger
286
+
287
+
*[Logger] Accept any enumerable in `Logger.metadata/1`
288
+
360
289
#### Mix
361
290
362
291
*[mix] Add support for `MIX_PROFILE_FLAGS` to configure `MIX_PROFILE`
363
292
*[mix compile] Debug the compiler and type checker PID when `MIX_DEBUG=1` and compilation/verification thresholds are met
*[Code] Return error on invalid unicode sequences in `Code.string_to_quoted/2` instead of raising
309
+
*[Code] Properly handle column annotation for `in` in `not in` expressions
376
310
*[DateTime] Do not truncate microseconds regardless of precision in `DateTime.diff/3`
311
+
*[Enum] Fix infinite loop on `Enum.take/2` with negative index on empty enumerable
377
312
*[File] Properly handle permissions errors cascading from parent in `File.mkdir_p/1`
313
+
*[Inspect] Inspect ill-formed structs as maps
314
+
*[Kernel] Properly increment metadata newline when `?` is followed by a literal newline character
378
315
*[Kernel]`not_a_map.key` now raises `BadMapError` for consistency with other map operations
379
316
*[Protocol]`defstruct/1` and `defexception/1` are now disabled inside `defprotocol` as to not allow defining structs/exceptions alongside a protocol
380
317
*[Regex] Fix `Regex.split/2` returning too many results when the chunk being split on was empty (which can happen when using features such as `/K`)
381
318
*[Stream] Ensure `Stream.transform/5` respects suspend command when its inner stream halts
382
319
*[URI] Several fixes to `URI.merge/2` related to trailing slashes, trailing dots, and hostless base URIs
383
320
321
+
#### ExUnit
322
+
323
+
*[ExUnit.Assertions] Fix order of pinned variables in failure reports
324
+
*[ExUnit.Assertions] Raise if attempting to raise an assertion error with invalid message (not a binary)
325
+
*[ExUnit.Case] Do not crash on empty test unit groups
326
+
327
+
#### IEx
328
+
329
+
*[IEx] Abort pipelines when there is an error in any step along the way
330
+
384
331
#### Mix
385
332
386
333
*[mix cmd] Preserve argument quoting in subcommands by no longer performing shell expansion. To revert to the previous behaviour, pass `--shell` before the command name
334
+
*[mix compile] Fix bug where reverting changes to an external resource (such as HEEx template) after a compilation error would make it so the source module would not be compiled
335
+
*[mix compile] Avoid failures when locking compilation across different users
336
+
*[mix compile] Fix race condition when renaming files used by the compilation lock
387
337
*[mix format] Ensure the formatter does not go over the specified limit in certain corner cases
388
338
*[mix release] Fix `RELEASE_SYS_CONFIG` for Windows 11
389
-
*[mix test]Preserve files with no longer filter on `mix test`
339
+
*[mix test]Ensure modules are preloaded in `mix test --slowest-modules=N`
390
340
*[mix xref graph] Provide more consistent output by considering strong connected components only when computing graphs
391
341
392
342
### 3. Soft deprecations (no warnings emitted)
@@ -399,12 +349,13 @@ This work was performed by Jonatan Männchen and sponsored by the Erlang Ecosyst
399
349
#### Mix
400
350
401
351
*[mix compile]`--no-protocol-consolidation` is deprecated in favor of `--no-consolidate-protocols` for consistency with `mix.exs` configuration
402
-
*[mix compile.protocols] Protocol consolidation is now part of `compile.elixir` and has no effect
352
+
*[mix compile.protocols] Protocol consolidation is now part of `compile.elixir` and the task itself has no effect
403
353
404
354
### 4. Hard deprecations
405
355
406
356
#### Elixir
407
357
358
+
*[Code] Warn if line-break characters outside of `\r` and `\r\n` are found in strings according to UX#55. This warning will be fast-tracked into an error for security reasons in Elixir v1.20, following a similar rule to bidirectional control characters. They will already raise if found in comments
408
359
*[Code] The `on_undefined_variable: :warn` is deprecated. Relying on undefined variables becoming function calls will not be supported in the future
409
360
*[File] Passing a callback as third argument to `File.cp/3` is deprecated, pass it as a `on_conflict: callback` option instead
410
361
*[File] Passing a callback as third argument to `File.cp_r/3` is deprecated, pass it as a `on_conflict: callback` option instead
0 commit comments