From cc0cb4f1d041f5f89a7dd58c8f26e1931376d338 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Valim?= Date: Mon, 23 Sep 2024 10:17:42 +0200 Subject: [PATCH] Update CHANGELOG --- CHANGELOG.md | 41 +++++++++++++++++++++++++++++++-- lib/elixir/lib/list.ex | 2 +- lib/mix/lib/mix/tasks/format.ex | 8 +++---- 3 files changed, 44 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3ca40239939..f36962589ab 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,14 @@ This release no longer supports WERL (a graphical user interface for the Erlang terminal on Windows). For a better user experience on Windows terminals, use Erlang/OTP 26+. +## Support for new types + +[TODO](https://elixir-lang.org/blog/2024/08/28/typing-lists-and-tuples/). + +## `mix format --migrate` + +TODO. + ## v1.18.0-dev ### 1. Enhancements @@ -9,12 +17,17 @@ This release no longer supports WERL (a graphical user interface for the Erlang #### Elixir * [CLI] Add experimental PowerShell scripts for `elixir`, `elixirc`, and `mix` on Windows. Those provide a safer entry point for running Elixir from other platforms + * [Code] Support several migration options in `Code.format_string!/2` + * [Code] Add parenthesis around `--` and `---` in `Code.format_string!/2` to make precedence clearer + * [Config] Add `Config.read_config/1` * [Enumerable] Add `Enum.product_by/2` and `Enum.sum_by/2` * [Exception] Add `MissingApplicationsError` exception to denote missing applications * [Kernel] Update source code parsing to match [UTS #55](https://www.unicode.org/reports/tr55/) latest recommendations. In particular, mixed script is allowed in identifiers as long as they are separate by underscores (`_`), such as `http_сервер`. Previously allowed highly restrictive identifiers, which mixed Latin and other scripts, such as the japanese word for t-shirt, `Tシャツ`, now require the underscore as well * [Kernel] Warn on bidirectional confusability in identifiers + * [Kernel] Now verify the type of the binary generators + * [Kernel] Track the type of tuples in patterns and inside `elem/2` * [List] Add `List.ends_with?/2` - * [Macro] Improve `dbg` handling of `if/2`, `unless/2`, and code blocks + * [Macro] Improve `dbg` handling of `if/2` and of code blocks * [Process] Handle arbitrarily high integer values in `Process.sleep/1` * [String] Inspect special whitespace and zero-width characters using their Unicode representation @@ -25,14 +38,37 @@ This release no longer supports WERL (a graphical user interface for the Erlang #### IEx * [IEx] Add `:dot_iex` support to `IEx.configure/1` + * [IEx] Add report for normal/shutdown exits in IEx + +#### Mix + + * [mix format] Add `mix format --migrate` to migrate from deprecated functionality + * [mix test] Taint failure manifest if requiring or compiling tests fail ### 2. Bug fixes +#### Elixir + + * [Code.Fragment] Properly handle keyword keys as their own entry + * [Inspect.Algebra] Ensure `next_break_fits` respects `line_length` + * [Module] Include module attribute line and name when tracing its aliases + +#### ExUnit + + * [ExUnit.Assertions] Raise if guards are used in `assert/1` with `=` + +#### Mix + + * [mix compile] Ensure warnings from external resources are emitted with `--all-warnings` when files do not change + * [mix deps.compile] Fix escaping issues when invoking `rebar3` in some cases + * [mix escript] Fix escript layout and support storing `priv` directories + * [mix release] Make `.app` files deterministic in releases + ### 3. Soft deprecations (no warnings emitted) #### Elixir - * [List] `List.zip/1` is deprecated in favor of `Enum.zip/1` + * [Kernel] Deprecate `unless` in favor of `if`. Use `mix format --migrate` to automate the migration ### 4. Hard deprecations @@ -44,6 +80,7 @@ This release no longer supports WERL (a graphical user interface for the Erlang #### Elixir * [Enumerable] Deprecate returning a two-arity function in `Enumerable.slice/1` + * [List] `List.zip/1` is deprecated in favor of `Enum.zip/1` * [Module] Deprecate `Module.eval_quoted/3` in favor of `Code.eval_quoted/3` * [Range] Deprecate inferring negative ranges on `Range.new/2` diff --git a/lib/elixir/lib/list.ex b/lib/elixir/lib/list.ex index f8fe874bbeb..739ba91f4dd 100644 --- a/lib/elixir/lib/list.ex +++ b/lib/elixir/lib/list.ex @@ -633,7 +633,7 @@ defmodule List do [other] end - @doc deprecated: "Use Enum.zip/1 instead" + @deprecated "Use Enum.zip/1 instead" def zip(list_of_lists) when is_list(list_of_lists) do Enum.zip(list_of_lists) end diff --git a/lib/mix/lib/mix/tasks/format.ex b/lib/mix/lib/mix/tasks/format.ex index 4572f08e036..66a3f498c65 100644 --- a/lib/mix/lib/mix/tasks/format.ex +++ b/lib/mix/lib/mix/tasks/format.ex @@ -79,12 +79,12 @@ defmodule Mix.Tasks.Format do passed via stdin is valid Elixir code. Defaults to "stdin.exs". * `--migrate` - enables the `:migrate` option, which should be able to - automatically fix some deprecation warnings but is changing the AST. + automatically fix some deprecation warnings but changes the AST. This should be safe in typical projects, but there is a non-zero risk of breaking code for meta-programming heavy projects that relied on a - specific AST, or projects that are re-defining functions from the `Kernel`. - See the "Migration formatting" section in `Code.format_string!/2` for - more information. + specific AST. We recommend running this task in its separate commit and + reviewing its output before committing. See the "Migration formatting" + section in `Code.format_string!/2` for more information. ## When to format code