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
+41-1Lines changed: 41 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -128,7 +128,21 @@ This release makes it so modules are loaded lazily. This reduces the pressure on
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
131
-
The only potential regression in this approach happens if you have a module, which is used at compile time and defines an `@on_load` callback (typically used for [NIFs](https://www.erlang.org/doc/system/nif.html)) that invokes another modules within the same project. For example:
131
+
There are two potential regressions with this approach. The first one happens if you spawn processes during compilation which invoke other modules defined within the same project. For example:
132
+
133
+
```elixir
134
+
defmoduleMyLib.SomeModuledo
135
+
list = [...]
136
+
137
+
Task.async_stream(list, fn item ->
138
+
MyLib.SomeOtherModule.do_something(item)
139
+
end)
140
+
end
141
+
```
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.
144
+
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.
150
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.
166
+
151
167
### Parallel compilation of dependencies
152
168
153
169
This release introduces a variable called `MIX_OS_DEPS_COMPILE_PARTITION_COUNT`, which instructs `mix deps.compile` to compile dependencies in parallel.
@@ -183,6 +199,30 @@ The outer list is the first element, the first nested list is the second, follow
183
199
184
200
Given this may reduce the amount of data printed by default, the default limit has also been increased from 50 to 100. We may further increase it in upcoming releases based on community feedback.
185
201
202
+
## Erlang/OTP 28 support
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.
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:
207
+
208
+
```elixir
209
+
defmoduleFoodo
210
+
defstructregex:~r/foo/
211
+
end
212
+
```
213
+
214
+
You must do this:
215
+
216
+
```elixir
217
+
defmoduleFoodo
218
+
defstruct [:regex]
219
+
220
+
defnewdo
221
+
%Foo{regex:~r/foo/}
222
+
end
223
+
end
224
+
```
225
+
186
226
## OpenChain certification
187
227
188
228
Elixir v1.19 is also our first release following OpenChain compliance, [as previously announced](https://elixir-lang.org/blog/2025/02/26/elixir-openchain-certification/). In a nutshell:
0 commit comments