@@ -7,56 +7,99 @@ on compilation and boot times. This release also completes
7
7
our integration process with Erlang/OTP logger, bringing new
8
8
features such as log rotation and compaction out of the box.
9
9
10
- Finally, you will also find additional convenience functions in
11
- ` Map ` , ` Keyword ` , all Calendar modules, and others.
10
+ You will also find additional convenience functions in ` Map ` ,
11
+ ` Keyword ` , all Calendar modules, and others.
12
12
13
13
## Compile and boot-time improvements
14
14
15
15
The last several releases brought improvements to compilation
16
- time and this version is no different. In particular, this version
16
+ time and this version is no different. In particular, Elixir
17
17
now caches and prunes load paths before compilation, ensuring your
18
18
project (and dependencies!) compile faster and in an environment
19
19
closer to production.
20
20
21
21
In a nutshell the Erlang VM loads modules from code paths. Each
22
22
application that ships with Erlang and Elixir plus each dependency
23
- end-up being an entry in your code path. The larger the code path,
24
- the more work Erlang has to do in order to find a module.
23
+ become an entry in your code path. The larger the code path, the
24
+ more work Erlang has to do in order to find a module.
25
25
26
26
In previous versions, Mix would only add entries to the load paths.
27
27
Therefore, if you compiled 20 dependencies and you went to compile
28
28
the 21st, the code path would have 21 entries (plus all Erlang and
29
29
Elixir apps). This allowed modules from unrelated dependencies to
30
30
be seen and made compilation slower the more dependencies you had.
31
+ With this release, we will now prune the code paths to only the ones
32
+ listed as dependencies, bringing the behaviour closer to ` mix release ` .
31
33
32
- In this release, we will now prune the code paths to only the ones
33
- listed as dependencies. Previously if you attempted to use an
34
- Erlang/OTP or Elixir module without adding its dependency, we would warn.
35
- Now the module won't be found altogether (instead of warning as in
36
- previous versions), which is also the behaviour you see if you ran
37
- your application as a ` mix release ` . If you are using an application
38
- that does not correctly lists its dependencies, they will have to
39
- be updated accordingly (as previously warned). You can temporarily
40
- disable this new behaviour by setting ` prune_code_paths: false ` in
41
- your ` mix.exs ` .
42
-
43
- Furthermore, Erlang/OTP 26 allows us to start applications concurrently
44
- and cache the code path lookups, decreasing the cost of booting applications.
45
- The combination of Elixir v1.15 and Erlang/OTP 26 should reduce the boot
46
- time of applications, such as when starting ` iex -S mix ` or running a single
47
- test with ` mix test ` , from 5% to 15%.
34
+ Furthermore, Erlang/OTP 26 allows us to start applications
35
+ concurrently and cache the code path lookups, decreasing the cost of
36
+ booting applications. The combination of Elixir v1.15 and Erlang/OTP 26
37
+ should reduce the boot time of applications, such as when starting
38
+ ` iex -S mix ` or running a single test with ` mix test ` , from 5% to 15%.
39
+
40
+ ### Potential incompatibilities
41
+
42
+ Due to the code path pruning, if you have an application or dependency
43
+ that does not specify its dependencies on Erlang and Elixir application,
44
+ it may no longer compile successfully in Elixir v1.15. You can temporarily
45
+ disable code path pruning by setting ` prune_code_paths: false ` in your
46
+ ` mix.exs ` , although doing so may lead to runtime bugs that are only
47
+ manifested inside a ` mix release ` .
48
48
49
49
## Compiler warnings and errors
50
50
51
- TODO.
51
+ The Elixir compiler can now emit many errors for a single file, making
52
+ sure more feedback is reported to developers before compilation is aborted.
53
+
54
+ In Elixir v1.14, an undefined function would be reported as:
55
+
56
+ ** (CompileError) undefined function foo/0 (there is no such import)
57
+ my_file.exs:1
58
+
59
+ In Elixir v1.15, the new reports will look like:
60
+
61
+ error: undefined function foo/0 (there is no such import)
62
+ my_file.exs:1
63
+
64
+ ** (CompileError) nofile: cannot compile file (errors have been logged)
65
+
66
+ This information can also be leveraged by editors, allowing them to point
67
+ to several errors at once.
52
68
53
69
## Integration with Erlang/OTP logger
54
70
55
- This provides additional features such as global logger metadata and
56
- file logging (with rotation and compaction) out-of-the-box! See
57
- the ` Logger ` documentation for more information.
71
+ This release provides additional features such as global logger
72
+ metadata and file logging (with rotation and compaction) out-of-the-box!
73
+
74
+ This release also soft-deprecates Elixir's Logger Backends in
75
+ favor of Erlang's Logger handlers. Elixir will automatically
76
+ convert your ` :console ` backend configuration into the new
77
+ configuration. Previously, you would set:
78
+
79
+ ``` elixir
80
+ config :logger , :console ,
81
+ level: :error ,
82
+ format: " $time $message $metadata"
83
+ ```
84
+
85
+ Which is now translated to the equivalent:
86
+
87
+ ``` elixir
88
+ config :logger , :default_handler ,
89
+ level: :error
90
+
91
+ config :logger , :default_formatter ,
92
+ format: " $time $message $metadata"
93
+ ```
94
+
95
+ If you use ` Logger.Backends.Console ` or other backends, they are
96
+ still fully supported and functional. If you implement your own
97
+ backends, you want to consider migrating to
98
+ [ ` :logger_backends ` ] ( https://github.com/elixir-lang/logger_backends )
99
+ in the long term.
58
100
59
- TODO: Mention : console vs Logger.Backends.Console
101
+ See the new ` Logger ` documentation for more information on the
102
+ new features and on compatibility.
60
103
61
104
## v1.15.0-dev
62
105
0 commit comments