Update dependency elixir to v1.15.0 #134
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
1.14.5
->1.15.0
Release Notes
elixir-lang/elixir
v1.15.0
Compare Source
Official announcement: https://elixir-lang.org/blog/2023/06/19/elixir-v1-15-0-released/
This release requires Erlang/OTP 24 and later.
Elixir v1.15 is a smaller release with focused improvements
on compilation and boot times. This release also completes
our integration process with Erlang/OTP logger, bringing new
features such as log rotation and compaction out of the box.
You will also find additional convenience functions in
Code
,Map
,Keyword
, all Calendar modules, and others.Compile and boot-time improvements
The last several releases brought improvements to compilation
time and this version is no different. In particular, Elixir
now caches and prunes load paths before compilation, ensuring your
project (and dependencies!) compile faster and in an environment
closer to production.
In a nutshell the Erlang VM loads modules from code paths. Each
application that ships with Erlang and Elixir plus each dependency
become an entry in your code path. The larger the code path, the
more work Erlang has to do in order to find a module.
In previous versions, Mix would only add entries to the load paths.
Therefore, if you compiled 20 dependencies and you went to compile
the 21st, the code path would have 21 entries (plus all Erlang and
Elixir apps). This allowed modules from unrelated dependencies to
be seen and made compilation slower the more dependencies you had.
With this release, we will now prune the code paths to only the ones
listed as dependencies, bringing the behaviour closer to
mix release
.Furthermore, Erlang/OTP 26 allows us to start applications
concurrently and cache the code path lookups, decreasing the cost of
booting applications. The combination of Elixir v1.15 and Erlang/OTP 26
should reduce the boot time of applications, such as when starting
iex -S mix
or running a single test withmix test
, from 5% to 30%.The compiler is also smarter in several ways:
@behaviour
declarationsno longer add compile-time dependencies and aliases in patterns and
guards add no dependency whatsoever, as no dispatching happens. Furthermore,
Mix now tracks the digests of
@external_resource
files, reducing theamount of recompilation when swapping branches. Finally, dependencies
are automatically recompiled when their compile-time configuration changes.
Potential incompatibilities
Due to the code path pruning, if you have an application or dependency
that does not specify its dependencies on Erlang and Elixir application,
it may no longer compile successfully in Elixir v1.15. You can temporarily
disable code path pruning by setting
prune_code_paths: false
in yourmix.exs
, although doing so may lead to runtime bugs that are onlymanifested inside a
mix release
.Compiler warnings and errors
The Elixir compiler can now emit many errors for a single file, making
sure more feedback is reported to developers before compilation is aborted.
In Elixir v1.14, an undefined function would be reported as:
In Elixir v1.15, the new reports will look like:
A new function, called
Code.with_diagnostics/2
, has been added so thisinformation can be leveraged by editors, allowing them to point to several
errors at once.
Potential incompatibilities
As part of this effort, the behaviour where undefined variables were
transformed into nullary function calls, often leading to confusing error
reports, has been disabled during project compilation. You can invoke
Code.compiler_options(on_undefined_variable: :warn)
at the top of your
mix.exs
to bring the old behaviour back.Integration with Erlang/OTP logger
This release provides additional features such as global logger
metadata and file logging (with rotation and compaction) out-of-the-box!
This release also soft-deprecates Elixir's Logger Backends in
favor of Erlang's Logger handlers. Elixir will automatically
convert your
:console
backend configuration into the newconfiguration. Previously, you would set:
Which is now translated to the equivalent:
If you use
Logger.Backends.Console
with a custom device or otherbackends, they are still fully supported and functional. If you
implement your own backends, you want to consider migrating to
:logger_backends
in the long term.
See the new
Logger
documentation for more information on thenew features and on compatibility.
1. Enhancements
EEx
Elixir
%s
) toCalendar.strftime/2
Code.format_string!/2
now converts'charlists'
into~c"charlists"
by default:on_undefined_variable
to the compiler options to preserve the warning behaviour which was deprecated back in Elixir v1.4Code.loaded?/1
andCode.ensure_all_loaded(!)/1
Code.prepend_paths/1
,Code.append_paths/1
, andCode.delete_paths/1
Code.with_diagnostics/2
to return diagnostics when compiling and evaluating codeCode.Fragment.cursor_context/1
Code.Fragment.container_cursor_to_quoted/1
Date.before?/2
andDate.after?/2
DateTime.before?/2
andDateTime.after?/2
DateTime.utc_now/2
File.Stream
Inspect
now renders'charlists'
as~c"charlists"
by defaultcase
andcond
insidedbg/2
t:nonempty_binary/0
andt:nonempty_bitstring/0
@behaviour
s as runtime dependencieserror: ...
messages, similar towarning: ...
Code.compiler_options(on_undefined_variable: :warn)
at the top of yourmix.exs
--sname undefined
/--name undefined
so a name is automatically generatedKeyword.split_with/2
Macro.Env.lookup_alias_as/2
Map.split_with/2
Map.intersect/2
andMap.intersect/3
MapSet.split_with/2
NaiveDateTime.beginning_of_day/1
andNaiveDateTime.end_of_day/1
NaiveDateTime.before?/2
andNaiveDateTime.after?/2
NaiveDateTime.utc_now/2
Module.get_last_attribute/3
:return_separator
optionProcess.alias/0,1
andProcess.unalias/1
Range.split/2
:fast_ascii
mode toString.valid?/2
Supervisor
:lines
inSystem.cmd/3
to capture output line by lineTask.yield_many/2
Task.Supervisor.start_child/2
Time.before?/2
andTime.after?/2
URI.append_path/2
ExUnit
{module, function}
tuples in ExUnitsetup
callbacksExUnit.Case.get_last_registered_test/1
ExUnit.DocTest.doctest_file/2
doctest_data
in doctest tagsIEx
--dbg pry
IEX_HOME
alias
,import
, andrequire
runtime_info(:allocators)
Range
,DateTime
, andRegex
Logger
Logger.add_handlers/1
andLogger.default_formatter/1
default_formatter
anddefault_handler
configuration for Logger which configures Erlang/OTP logger:always_evaluate_messages
configuration to LoggerMix
:start_concurrently
configuration--all-warnings
by default@external_resources
optional_applications
to.app
file--purge-consolidation-path-if-stale
which will purge the given consolidation path if compilation is requiredmix deps.get
/mix deps.update
--check-locked
which raises if changes to the lockfile are required--no-exit
option--check-formatted
fails--trace-to-file
to improve performance when working with large outputseval
command--output
flagdef cli
to unify all CLI defaults in a single placeMix.Project.deps_tree/1
2. Bug fixes
Elixir
Exception.blame/3
File.cp/2
File.rm_rf/1
try/rescue
...
inside typespecsbehaviour_info
andmodule_info
functions from Erlang modulesModule.get_attribute/3
returnsnil
and not the given default value when an attribute has been explicitly set asnil
System.stop/1
executesURI.merge/2
works accordingly with relative pathsExUnit
@tag capture_log: true
was set to true and the Logger application was shut down in the middle of the testsetup_all
IEx
whenever the input reader was killed
Mix
cwd
in compiler cache keyerlsrv.exe
in path with spacesmix xref
is used at the umbrella root3. Soft deprecations (no warnings emitted)
Elixir
File.cp/3
andFile.cp_r/3
with a function as third argumentis deprecated in favor of a keyword list
:return_diagnostics
option to beset to true when compiling or requiring code
Logger
add_backend/2
,remove_backend/2
, andconfigure_backend/2
have been deprecatedin favor of the new
:logger_backends
dependency:console
configuration has been deprecated in favor of:default_formatter
:backends
configuration has been deprecated in favor ofLogger.add_handlers/1
Mix
:preferred_cli_env
is deprecated in favor of:preferred_envs
indef cli
:preferred_cli_target
is deprecated in favor of:preferred_targets
indef cli
HEX_MIRROR
is deprecated in favor ofHEX_BUILDS_URL
4. Hard deprecations
Elixir
Calendar.ISO.day_of_week/3
is deprecated in favor ofCalendar.ISO.day_of_week/4
Exception.exception?/1
is deprecated in favor ofKernel.is_exception/1
...
as a valid function call identifierRegex.regex?/1
is deprecated in favor ofKernel.is_struct/2
Logger
Logger.warn/2
is deprecated in favor ofLogger.warning/2
Configuration
📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR has been generated by Mend Renovate. View repository job log here.