Skip to content

Releases: elixir-lang/elixir

v1.3.1

28 Jun 10:02
Compare
Choose a tag to compare

1. Enhancements

IEx

  • [IEx.Helpers] Add import_file_if_available for importing files only if they are available
  • [IEx.Helpers] Add import_if_available for importing modules only if they are available

2. Bug fixes

Elixir

  • [Kernel] Ensure structs can be expanded in dynamic module names
  • [Kernel] Ensure aliases warnings are not accidentally discarded when the same module is imported
  • [Kernel.ParallelCompiler] Ensure two modules with cyclic struct dependencies cannot run into a deadlock when compiling
  • [Kernel.Typespec] Support module attributes in remote types
  • [Module] Do not expect stacktraces to be always present when dispatching to locals during the module compilation

IEx

  • [IEx.Helpers] Fix h helper for operators

Mix

  • [Mix] Do not load modules for xref purposes, instead use BEAM info
  • [Mix] Ensure deps.check does not check archives (that's done in loadpaths)
  • [Mix] Validate application properties before traversing them
  • [Mix] Check for proper Makefile when compiling on Windows
  • [Mix] Enforce space after comma in mix do

v1.3.0

21 Jun 10:35
Compare
Choose a tag to compare

Official announcement: https://elixir-lang.org/blog/2016/06/21/elixir-v1-3-0-released/

1. Enhancements

EEx

  • [EEx.Engine] Support an init/1 function in engines that will return the initial buffer (defaults to an empty string)

Elixir

  • [Access] Add support for Access.all/0, Access.elem/1, Access.key/2 and Access.key!/1 for traversing nested data structures
  • [Calendar] Add Calendar and Date, Time, NaiveDateTime and DateTime types
  • [CLI] Add --logger-otp-reports BOOL and --logger-sasl-reports BOOL switches
  • [Compiler] Emit a summary of compilation errors when modules are missing
  • [Enum] Add Enum.group_by/3 that allows developers to map on the value being grouped
  • [Enum] Make list values in maps returned by Enum.group_by/2 and Enum.group_by/3 preserve the order of the input enumerable instead of reversing it.
  • [Enum] Add Enum.drop_every/2 that drops every nth, including the first one
  • [Exception] Suggest possible functions on UndefinedFunctionError for existing modules
  • [Exception] Warn if unknown fields are given to raise/2
  • [File] Support IO devices in File.copy/3
  • [GenServer] Raise a more meaningful exit if you try to GenServer.call/3 yourself
  • [Inspect] Support :base option when inspecting binaries
  • [IO] Add IO.warn/2 that will print a warning message with stacktrace and notify the compiler a warning was printed (in case --warnings-as-errors was enabled)
  • [Kernel] Support generated: true in quote
  • [Kernel] Support Kernel.pop_in/1 and Kernel.pop_in/2 for yanking a value from a nested data structure
  • [Kernel] Allow variable struct names when matching, for example, %module{key: "value"} = struct
  • [Kernel] Allow guards on the left side of <- in for and with special forms
  • [Kernel] Support else chunks in with
  • [Kernel] Track {module, function, arity} imports and warn on unused ones when such are specified in :only
  • [Kernel] Add keyword/0 and keyword/1 built-in types to typespecs
  • [Kernel] Add sigils for date (~D[2015-04-17]), time (~T[08:00:00]) and naive date times ~N[2015-04-17 08:00:00]
  • [Kernel] Support @enforce_keys on defstruct/1 to guarantee some keys are explicitly given when building structs
  • [OptionParser] Add support for :count switch type
  • [OptionParser] Add parse!/2 and parse_head!/2 that raise OptionParser.ParseError in case of errors
  • [Process] Add Process.sleep/1
  • [Range] Range.range?/1 now checks the validity of a range.
  • [Regex] Support :include_captures in Regex.split/3
  • [String] Add String.myers_difference/2 for calculating the difference between two strings
  • [System] Add System.os_time/0 and System.os_time/1
  • [Typespec] Add support for %{required(foo) => bar} and %{optional(foo) => bar} forms (Erlang 19 only)
  • [Typespec] Add support for @optional_callbacks to mark certain that certain callbacks may be optionally implemented
  • [Typespec] Introduce %{...} to mean any map (Erlang 19 only)
  • [URI] Add URI.merge/2
  • [Version] Add Version.parse!/1

ExUnit

  • [ExUnit] Show pinned variables on failed assert ^left = right and assert match?(^left, right) assertions
  • [ExUnit] Add ExUnit.Case.register_attribute which allow attributes to be cleaned up whenever a test is defined
  • [ExUnit] Add ExUnit.Case.register_test and support the ability to tag "tests" by type. This will allow projects like QuickCheck to change the wording in formatters to say "10 properties" instead of "10 tests"
  • [ExUnit] Support diffing of values when using == in assert
  • [ExUnit] Start running tests as soon as cases are loaded. This feature is enabled by default when running tests through Mix
  • [ExUnit] Raise a straight-forward error message in case a duplicate test name is defined
  • [ExUnit] Bump the default number of max cases to double of schedulers to support both IO and CPU bound tests
  • [ExUnit] Support for named setups in setup and setup_all
  • [ExUnit] Support for bundling tests together with describe/2

IEx

  • [IEx] Add nl/2 that loads a given module on a list of nodes
  • [IEx.Helpers] No longer restart applications on recompile/1
  • [IEx.Autocomplete] Improve IEx expand to handle functions after &

Logger

  • [Logger] Introduce Logger.reset_metadata/0,1

Mix

  • [Mix] Add mix xref and mix compile.xref that runs cross-reference checks, with the latter running after compilation by default
  • [Mix] Add mix app.tree and mix deps.tree
  • [Mix] Add Mix.Task.rerun/2 that reenables and re-runs a task
  • [Mix] Integrate OptionParser.ParseError into Mix, automatically converting such exceptions into Mix.Error and embedding the task information
  • [Mix] Support @preferred_cli_env attribute when defining tasks
  • [Mix] Support mix test --raise that will raise when a test suite fails (instead of setting the exit code to 1)
  • [Mix] Enable rebar3 manager by default for Hex dependencies
  • [Mix] Add mix escript.install to install escripts
  • [Mix] Print stacktraces for Mix.Error when MIX_DEBUG=1 is set
  • [Mix] Add a user friendly error for merge conflicts on mix.lock
  • [Mix] Track files between path dependencies. This means umbrella applications will no longer trigger full recompilation when a sibling changes. Instead it will only recompile the files affected by the sibling changes
  • [Mix] No longer print every file being compiled. Instead a generic "Compiling N files (.ext)" will be printed and files will only be logged in case they take more than 5 seconds to compile. This threshold can be customized by passing the --long-compilation-threshold flag and the previous behaviour can be reenabled by giving --verbose to mix compile
  • [Mix] Add mix test --stale that uses static analysis on source files to know which tests should run when source files changes. If any test file changes, it will also re-run. Changing a configuration file or the test helper will trigger a full recompilation

2. Bug fixes

Elixir

  • [Application] Ensure Application.spec/2 returns nil for unknown applications
  • [GenServer] Ensures cast/2 returns :ok if locally registered process is not found
  • [Inspect] Ensure binaries break into new lines when inspected
  • [Kernel] Do not choke on capture operator with argument above &191
  • [Kernel] Raise if defstruct is called multiple times
  • [Kernel] Ensure Module.create/3 respects var/alias hygiene
  • [Kernel] Support non-literal ranges on the right side of in/2
  • [Macro] Fix Macro.to_string/1 on a call of a capture argument, for example &(&1).(:x)
  • [OptionParser] Allow OptionParser to parse negative numbers
  • [Record] Fix Record.is_record/2 when dealing with non-record tuples
  • [String] Ensure strip also removes non-breaking whitespaces (and ensure split still does not split on them)
  • [URI] Use square brackets for IPv6 in URI.to_string/1

Mix

  • [Mix] Improve task not found message when Mix would include the not found task as a suggestion due to different casing
  • [Mix] Ignore lock revision when the lock is out of date when updating Mix dependencies. Before this fix, Git tags and branches in the lock file would erroneously take higher precedence than the one in mix.exs
  • [Mix] Only recompile empty Elixir files if they change instead of recompiling them on every run
  • [Mix] Ensure .app file is written in UTF-8 (this allows app descriptions to contain UTF-8 characters)
  • [Mix.Dep] Always specify the :env option internally for dependencies to avoid false positives in the dependency resolution
  • [Mix.Dep] Correctly detect conflict from cousin optional dependencies in the dependency resolution algorithm

3. Soft deprecations (no warnings emitted)

  • [Float] Float.to_string/2 and Float.to_char_list/2 has been soft-deprecated as Elixir will now attempt to print the shortest and most accurate representation by default. Developers can always fallback to :erlang.float_to_binary/2 and :erlang.float_to_list/2 if they need the previous functionality
  • [Kernel] to_char_list functions have been soft-deprecated in favor of to_charlist. This aligns with the naming conventions in both Erlang and Elixir
  • [String] The confusing String.strip/2, String.lstrip/2 and String.rstrip/2 API has been soft deprecated in favor of String.trim/2, String.trim_leading/2 and String.trim_trailing/2
  • [String] The confusing String.ljust/3 and String.rjust/3 API has been soft deprecated in favor of String.pad_leading/3 and String.pad_trailing/3
  • [Typespec] char_list is soft-deprecated in favor of charlist

4. Deprecations

This release deprecates many APIs that have been soft-deprecated in previous Elixir versions.

Elixir

  • [Dict] Dict is no longer a behaviour and its functions will be deprecated in upcoming releases
  • [Enum] Passing a dictionary to Enum.group_by/3 is deprecated
  • [Kernel] \x{H*} in strings/sigils/charlists is deprecated
  • [Kernel] Add deprecation for defdelegate list arguments and :append_first option. The previously undocumented and deprecated support for matching has been removed
  • [Kernel] Warn if a variable is assigned inside case/if/etc and used outside the block
  • [Keyword] Keyword.size/1 is deprecated in favor of Kernel.length/1
  • [Map] Map.size/1 is deprecated in favor of Kernel.map_size/1
  • [Regex] The option /r (for ungreedy) has been deprecated in favor of /U
  • [Set] Set is no longer a behaviour and its functions will be deprecated in upcoming releases
  • [String] String.valid_character?/1 is deprecated in favor of String.valid?/1 with pattern matching
  • [Task] Task.find/2 is deprecated in favor of explicit message matching
  • [URI] Passing a non-map to URI.decode_query/2 is deprecated

v1.3.0-rc.1

08 Jun 19:19
Compare
Choose a tag to compare
v1.3.0-rc.1 Pre-release
Pre-release
Release v1.3.0-rc.1

v1.2.6

06 Jun 13:38
Compare
Choose a tag to compare

1. Enhancements

  • [Kernel] Support Erlang 19
  • [Kernel] Supported generated: true in the quote special form

2. Bug fixes

  • [Path] Fix a bug in path join with "/" followed by empty segments
  • [String] Fix a bug in NFD normalization when followed by one-byte sized graphemes
  • [Typespec] Correctly support <<_::size, _::_*unit>> syntax

v1.3.0-rc.0

30 May 13:07
Compare
Choose a tag to compare
v1.3.0-rc.0 Pre-release
Pre-release
Release v1.3.0-rc.0

v1.2.5

30 Apr 11:51
Compare
Choose a tag to compare

Bug fixes

  • [Logger] Stringify truncated function data in Logger
  • [Logger] Ensure poorly formatted char data can also be logged by using the replacement character "�" (diamond question mark)
  • [Mix] Do not assume @impl is always a list
  • [String] Fix bugs in String.replace_* functions where it would not include the accumulated value for certain replacements

v1.2.4

01 Apr 10:13
Compare
Choose a tag to compare

Enhancements

  • [Mix] Add :archives configuration to def project that allows projects to list archive dependencies. --no-archives-check (as well as --no-deps-check) will disable the archive check. The :archives option is not checked for dependencies.
  • [Mix] Add deps.precompile task as hook
  • [Mix] Support --include-children in mix deps.compile option
  • [String] Update version of the Unicode database to 8.0.0

Bug fixes

  • [Application] Ensure spec/2 returns nil for unknown applications
  • [Integer] Fix a possible binary leak in parse/1
  • [Mix] Purge Erlang modules on recompilation
  • [String] Ensure split/1 does not break on non-breakable whitespace
  • [String] Ensure NFC and NFD normalization pass all of Unicode 8.0.0 tests
  • [Version] Allow dots in build info for versions in Version.parse/1

v1.2.3

21 Feb 21:36
Compare
Choose a tag to compare

Enhancements

  • [Base] Add :ignore and :padding option to encoding/decoding functions
  • [Mix] Add Mix.Projects.deps_paths that returns the dependencies path as a map

Bug fixes

  • [ExUnit] Do not provide negative line numbers without generated annotation (for compatibility with Erlang 19)
  • [Mix] Reject non fullfilled optional dependencies later on in the convergence resolution for proper dependency sorting
  • [String] Fix incomplete data trimming on both String.replace_trailing and String.rstrip
  • [String] Attach debug_info back into Unicode modules for Dialyzer support

v1.2.2

31 Jan 09:39
Compare
Choose a tag to compare

Enhancements

  • [Kernel] Support @compile {:autoload, false} to disable automatic loading after compilation

Bug fixes

  • [ExUnit] Raise if trying to override reserved tag in setup blocks
  • [Mix] Ensure retrieve compile manifests do fail if some compilers are not yet available
  • [Mix] Automatically merge managers according to the mix > rebar3 > rebar > make order
  • [Mix] Force recompilation if dependency was recently fetched

v1.2.1

14 Jan 18:32
Compare
Choose a tag to compare

Enhancements

  • [IEx] Support remote pids/ports with IEx helper i/1
  • [Protocol] Warn when defimpl is called for a consolidated protocol

Bug fixes

  • [ExUnit] Ensure assert macros can be used from quoted code
  • [ExUnit] Do not warn in match assertion if variable is reused in pattern
  • [Macro] Fix a bug in Macro.to_string/1 where a remote function could be accidentally interpreted as a sigil
  • [Mix] Ensure dependencies are properly skipped when --only option is given to mix deps.get