Skip to content

Releases: elixir-lang/elixir

v0.14.1

18 Jun 14:18
Compare
Choose a tag to compare
v0.14.1 Pre-release
Pre-release

Enhancements

  • [Base] Decoding and encoding functions now accept the :case as an option
  • [ExUnit] The test process now exits with :shutdown reason
  • [GenEvent] GenEvent.stream/2 now accepts :sync and :async modes
  • [Node] Add Node.start/3 and Node.stop/0
  • [String] Updated Unicode database to 7.0
  • [Task] Log when tasks crash

Bug fixes

  • [Enum] Enum.slice/2 and Enum.slice/3 always returns a list (and never nil)
  • [Kernel] Disambiguate (w)erl to (w)erl.exe
  • [Mix] Ensure umbrella project is recompiled when a dependency inside an umbrella child changes
  • [OptionParser] Do not allow underscores in option names
  • [Path] Fix path expansion of "/.."
  • [Path] Do not match files starting with . in Path.wildcard/2 by default
  • [Process] Process.info(pid, :registered_name) returns {:registered_name, nil} if there is no registered name
  • [String] String.slice/2 and String.slice/3 always returns a list (and never nil)
  • [URI] encode/1 does not escape reserved/unreserved characters by default nor encodes whitespace as + (check URI.encode_www_form/1 and URI.decode_www_form/1 for previous behaviour)

Deprecations

  • [Mix] :escript_* options were moved into a single :escript group

Backwards incompatible changes

  • [GenEvent] GenEvent.stream/2 defaults to :sync mode
  • [Kernel] Remove get_in/1

v0.14.0

08 Jun 19:19
Compare
Choose a tag to compare
v0.14.0 Pre-release
Pre-release

Enhancements

  • [ExUnit] Add on_exit/1 callbacks that are guaranteed to run once the test process exits and always in another process
  • [Kernel] Store documentation in the abstract code to avoid loading them when the module is loaded
  • [Kernel] Add get_in/2, put_in/3, update_in/3 and get_and_update_in/3 to handle nested data structure operations
  • [Kernel] Add get_in/1, put_in/2, update_in/2 and get_and_update_in/2 to handle nested data structure operations via paths
  • [Mix] Add Mix.Config to ease definition of configuration files
  • [Mix] Add mix loadconfig task that can be called multiple times to load external configs
  • [Mix] Support --config option on mix run
  • [Mix] Support HTTP_PROXY and HTTPS_PROXY on Mix url commands
  • [Mix] Support --names options in mix help which emit only names (useful for autocompletion)
  • [Protocol] Add Protocol.consolidate/2, Protocol.consolidated?/1 and a mix compile.protocols task for protocol consolidation
  • [Protocol] Add Protocol.derive/3 for runtime deriving of a struct
  • [String] Add String.chunk/2
  • [Struct] Add support for @derive before defstruct/2 definitions

Bug fixes

  • [File] File.rm now consistently deletes read-only across operating systems
  • [Kernel] Ensure Mix _build structure works on Windows when copying projects
  • [Kernel] Ensure 1.0E10 (with uppercase E) is also valid syntax
  • [Mix] Fix mix do task for Windows' powershell users
  • [Path] Fix Path.absname("/") and Path.expand("/") to return the absolute path "/".

Soft deprecations (no warnings emitted)

  • [Kernel] size/1 is deprecated, please use byte_size/1 or tuple_size/1 instead
  • [ExUnit] teardown/2 and teardown_all/2 are deprecated in favor of on_exit/1 callbacks

Deprecations

  • [Access] Access.access/2 is deprecated in favor of Access.get/2
  • [Dict] Dict.Behaviour is deprecated in favor of Dict
  • [Kernel] Application.Behaviour, GenEvent.Behaviour, GenServer.Behaviour and Supervisor.Behaviour are deprecated in favor of Application, GenEvent, GenServer and Supervisor
  • [Kernel] defexception/3 is deprecated in favor of defexception/1
  • [Kernel] raise/3 is deprecated in favor of reraise/2
  • [Kernel] set_elem/3 is deprecated in favor of put_elem/3
  • [Kernel] Passing an atom var!/1 is deprecated, variables can be built dynamically with Macro.var/2
  • [Mix] Exceptions that define a :mix_error field to be compatible with Mix are no longer supported. Instead please provide a :mix field and use Mix.raise/1 and Mix.raise/2

Backwards incompatible changes

  • [Access] Kernel.access/2 no longer exists and the Access protocol now requires get/2 (instead of access/2) and get_and_update/3 to be implemented
  • [Kernel] Retrieving docs as module.__info__(:docs) is no longer supported, please use Code.get_docs/2 instead
  • [Kernel] Code.compiler_options/1 no longer accepts custom options, only the ones specified by Elixir (use mix config instead)
  • [Mix] mix new no longer generates a supevision tree by default, please pass --sup instead
  • [Task] Tasks are automatically linked to callers and a failure in the task will crash the caller directly

v0.13.3

24 May 09:03
Compare
Choose a tag to compare
v0.13.3 Pre-release
Pre-release

Enhancements

  • [OptionParser] Add :strict option that only parses known switches
  • [OptionParser] Add next/2 useful for manual parsing of options
  • [Macro] Add Macro.prewalk/2/3 and Macro.postwalk/2/3
  • [Kernel] GenEvent, GenServer, Supervisor, Agent and Task modules added
  • [Kernel] Make deprecations compiler warnings to avoid the same deprecation being printed multiple times

Bug fixes

  • [Enum] Fix Enum.join/2 and Enum.map_join/3 for empty binaries at the beginning of the collection
  • [ExUnit] Ensure the formatter doesn't error when printing :EXITs
  • [Kernel] Rename ELIXIR_ERL_OPTS to ELIXIR_ERL_OPTIONS for consistency with ERL_COMPILER_OPTIONS
  • [OptionParser] Parse - as a plain argument
  • [OptionParser] -- is always removed from argument list on parse/2 and when it is the leading entry on parse_head/2
  • [Regex] Properly escape regex (previously regex controls were double escaped)

Soft deprecations (no warnings emitted)

  • [Dict] Dict.Behaviour is deprecated in favor of Dict
  • [Kernel] Application.Behaviour, GenEvent.Behaviour, GenServer.Behaviour and Supervisor.Behaviour are deprecated in favor of Application, GenEvent, GenServer and Supervisor
  • [Kernel] defexception/3 is deprecated in favor of defexception/1
  • [Kernel] raise/3 is deprecated in favor of reraise/2
  • [Kernel] set_elem/3 is deprecated in favor of put_elem/3

Soft deprecations for conversions (no warnings emitted)

  • [Kernel] atom_to_binary/1 and atom_to_list/1 are deprecated in favor of Atom.to_string/1 and Atom.to_char_list/1
  • [Kernel] bitstring_to_list/1 and list_to_bitstring/1 are deprecated in favor of the :erlang ones
  • [Kernel] binary_to_atom/1, binary_to_existing_atom/1, binary_to_float/1, binary_to_integer/1 and binary_to_integer/2 are deprecated in favor of conversion functions in String
  • [Kernel] float_to_binary/* and float_to_list/* are deprecated in favor of Float.to_string/* and Float.to_char_list/*
  • [Kernel] integer_to_binary/* and integer_to_list/* are deprecated in favor of Integer.to_string/* and Integer.to_char_list/*
  • [Kernel] iodata_to_binary/1 and iodata_length/1 are deprecated IO.iodata_to_binary/1 and IO.iodata_length/1
  • [Kernel] list_to_atom/1, list_to_existing_atom/1, list_to_float/1, list_to_integer/1, list_to_integer/2 and list_to_tuple/1 are deprecated in favor of conversion functions in List
  • [Kernel] tuple_to_list/1 is deprecated in favor of Tuple.to_list/1
  • [List] List.from_char_data/1 and List.from_char_data!/1 deprecated in favor of String.to_char_list/1
  • [String] String.from_char_data/1 and String.from_char_data!/1 deprecated in favor of List.to_string/1

Deprecations

  • [Kernel] is_exception/1, is_record/1 and is_record/2 are deprecated in favor of Exception.exception?1, Record.record?/1 and Record.record?/2
  • [Kernel] defrecord/3 is deprecated in favor of structs
  • [Kernel] :hygiene in quote is deprecated
  • [Mix] Mix.project/0 is deprecated in favor of Mix.Project.config/0
  • [Process] Process.spawn/1, Process.spawn/3, Process.spawn_link/1, Process.spawn_link/3, Process.spawn_monitor/1, Process.spawn_monitor/3, Process.send/2 and Process.self/0 are deprecated in favor of the ones in Kernel

Backwards incompatible changes

  • [Exception] Exceptions now generate structs instead of records
  • [OptionParser] Errors on parsing returns the switch and value as binaries (unparsed)
  • [String] String.to_char_list/1 (previously deprecated) no longer returns a tuple but the char list only and raises in case of failure

v0.13.2

11 May 10:33
Compare
Choose a tag to compare
v0.13.2 Pre-release
Pre-release

Enhancements

  • [Application] Add an Application module with common functions to work with OTP applications
  • [Exception] Add Exception.message/1, Exception.format_banner/1, Exception.format_exit/1 and Exception.format/1
  • [File] Add File.ln_s/1
  • [Mix] mix deps.clean now works accross environments
  • [Mix] Support line numbers in mix test, e.g. test/some/file_test.exs:12
  • [Mix] Use @file attributes to detect dependencies in between .ex and external files. This means changing an .eex file will no longer recompile the whole project only the files that depend directly on it
  • [Mix] Support application configurations in config/config.exs which can be customized by specifying your own :config_path
  • [Mix] Support user-wide configuration with ~/.mix/config.exs
  • [Mix] mix help now uses ANSI formatting to print guides
  • [Regex] Support functions in Regex.replace/4
  • [String] Support :parts in String.split/3

Bug fixes

  • [Code] Ensure we don't lose the caller stacktrace on code evaluation
  • [IEx] Exit signals now exits the IEx evaluator and a new one is spawned on its place
  • [IEx] Ensure we don't prune too much stacktrace when reporting failures
  • [IEx] Fix an issue where iex.bat on Windows was not passing the proper parameters forward
  • [Kernel] Ensure modules defined on root respect defined aliases
  • [Kernel] Do not wrap single lists in :__block__
  • [Kernel] Ensure emitted beam code works nicely with dialyzer
  • [Kernel] Do not allow a module named Elixir to be defined
  • [Kernel] Create remote funs even if mod is a variable in capture &mod.fun/arity
  • [Kernel] Improve compiler message when duplicated modules are detected
  • [Mix] Generate .gitignore for --umbrella projects
  • [Mix] Verify if a git dependency in deps has a proper git checkout and clean it automatically when it doesn't
  • [Mix] Ensure mix test works with IEx.pry/0
  • [System] Convert remaining functions in System to rely on char data

Soft deprecations (no warnings emitted)

  • [Application] use Application.Behaviour is deprecated in favor of use Application
  • [Exception] exception.message is deprecated in favor Exception.message/1 for retrieving exception messages
  • [Kernel] is_exception/1, is_record/1 and is_record/2 are deprecated in favor of Exception.exception?1, Record.record?/1 and Record.record?/2
  • [Mix] Mix.project/0 is deprecated in favor of Mix.Project.config/0
  • [Process] Process.spawn/1, Process.spawn/3, Process.spawn_link/1, Process.spawn_link/3, Process.spawn_monitor/1, Process.spawn_monitor/3, Process.send/2 and Process.self/0 are deprecated in favor of the ones in Kernel

Deprecations

  • [IEx] IEx.Options is deprecated in favor of IEx.configure/1 and IEx.configuration/0
  • [Kernel] lc and bc comprehensions are deprecated in favor of for
  • [Macro] Macro.safe_terms/1 is deprecated
  • [Process] Process.delete/0 is deprecated
  • [Regex] Deprecate :global option in Regex.split/3 in favor of parts: :infinity
  • [String] Deprecate :global option in String.split/3 in favor of parts: :infinity

Backwards incompatible changes

  • [ExUnit] ExUnit.Test and ExUnit.TestCase has been converted to structs
  • [ExUnit] The test and callback context has been converted to maps
  • [Kernel] File.Stat, HashDict, HashSet, Inspect.Opts, Macro.Env, Range, Regex and Version.Requirement have been converted to structs. This means is_record/2 checks will no longer work, instead, you can pattern match on them using %Range{} and similar
  • [URI] The URI.Info record has now become the URI struct
  • [Version] The Version.Schema record has now become the Version struct

v0.13.1

27 Apr 08:59
Compare
Choose a tag to compare
v0.13.1 Pre-release
Pre-release

Enhancements

  • [Mix] Support MIX_EXS as configuration for running the current mix.exs file
  • [Mix] Support Hex out of the box. This means users do not need to install Hex directly, instead, Mix will prompt whenever there is a need to have Hex installed

Bug fixes

  • [ExUnit] Ensure doctest failures are properly reported
  • [Kernel] Fix a bug where comprehensions arguments were not properly take into account in the variable scope
  • [Mix] Fix issue on rebar install when the endpoint was redirecting to a relative uri

Deprecations

  • [Kernel] iolist_size and iolist_to_binary are deprecated in favor of iodata_size and iodata_to_binary (this is a soft deprecation, no warnings will be emitted)
  • [Mix] :env key in project configuration is deprecated
  • [Regex] Regex.groups/1 is deprecated in favor of Regex.names/1
  • [String] String.to_char_list/1 is deprecated in favor of List.from_char_data/1 (this is a soft deprecation, no warnings will be emitted)
  • [String] String.from_char_list/1 is deprecated in favor of String.from_char_data/1 (this is a soft deprecation, no warnings will be emitted)

Backwards incompatible changes

  • [Macro] Macro.unpipe/1 now returns tuples and Macro.pipe/2 was removed in favor of Macro.pipe/3 which explicitly expects the second element of the tuple returned by the new Macro.unpipe/1
  • [Path] The functions in Path now only emit strings as result, regardless if the input was a char list or a string
  • [Path] Atoms are no longer supported in Path functions
  • [Regex] Regexes are no longer unicode by default. Instead, they must be explicitly marked with the u option

v0.13.0

20 Apr 14:26
Compare
Choose a tag to compare
v0.13.0 Pre-release
Pre-release

Enhancements

  • [Base] Add Base module which does conversions to bases 16, 32, hex32, 64 and url64
  • [Code] Add Code.eval_file/2
  • [Collectable] Add the Collectable protocol that empowers Enum.into/2 and Stream.into/2 and the :into option in comprehensions
  • [Collectable] Implement Collectable for lists, dicts, bitstrings, functions and provide both File.Stream and IO.Stream
  • [EEx] Add handle_body/1 callback to EEx.Engine
  • [Enum] Add Enum.group_by/2, Enum.into/2, Enum.into/3, Enum.traverse/2 and Enum.sum/2
  • [ExUnit] Randomize cases and tests suite runs, allow seed configuration and the --seed flag via mix test
  • [ExUnit] Support --only for filtering when running tests with mix test
  • [ExUnit] Raise an error if another capture_io process already captured the device
  • [ExUnit] Improve formatter to show source code and rely on lhs and rhs (instead of expected and actual)
  • [IEx] Allow prompt configuration with the :prompt option
  • [IEx] Use werl on Windows
  • [Kernel] Support ERL_PATH in bin/elixir
  • [Kernel] Support interpolation in keyword syntax
  • [Map] Add a Map module and support 17.0 maps and structs
  • [Mix] Add dependency option :only to specify the dependency environment. mix deps.get and mix deps.update works accross all environment unless --only is specified
  • [Mix] Add Mix.Shell.prompt/1
  • [Mix] Ensure the project is compiled in case Mix' CLI cannot find a task
  • [Node] Add Node.ping/1
  • [Process] Include Process.send/3 and support the --gen-debug option
  • [Regex] Regexes no longer need the "g" option when there is a need to use named captures
  • [Stream] Add Stream.into/2 and Stream.into/3
  • [StringIO] Add a StringIO module that allows a String to be used as IO device
  • [System] Add System.delete_env/1 to remove a variable from the environment

Bug fixes

  • [CLI] Ensure --app is handled as an atom before processing
  • [ExUnit] Ensure ExUnit.Assertions does not emit compiler warnings for assert_receive
  • [Kernel] Ensure the same pid is not queued twice in the parallel compiler
  • [Macro] Macro.to_string/2 considers proper precedence when translating !(foo > bar) into a string
  • [Mix] Automatically recompile on outdated Elixir version and show proper error messages
  • [Mix] Ensure generated .app file includes core dependencies
  • [Mix] Allow a dependency with no SCM to be overridden
  • [Mix] Allow queries in mix local.install URL
  • [OptionParser] Do not recognize undefined aliases as switches

Deprecations

  • [Dict] Dict.empty/1, Dict.new/1 and Dict.new/2 are deprecated
  • [Exception] Exception.normalize/1 is deprecated in favor of Exception.normalize/2
  • [Kernel] lc and bc comprehensions are deprecated in favor of for (this is a soft deprecation, no warning will be emitted)
  • [ListDict] ListDict is deprecated in favor of Map (this is a soft deprecation, no warning will be emitted)
  • [Record] defrecord/2, defrecordp/3, is_record/1 and is_record/2 macros in Kernel are deprecated. Instead, use the new macros and API defined in the Record module (this is a soft deprecation, no warnings will be emitted)

Backwards incompatible changes

  • [ExUnit] Formatters are now required to be a GenEvent and ExUnit.run/2 returns a map with results

v0.12.5

10 Mar 00:12
Compare
Choose a tag to compare
v0.12.5 Pre-release
Pre-release

Bug fixes

  • [Kernel] Ensure try does not generate an after clause. Generating an after clause forbade clauses in the else part from being tail recursive. This should improve performance and memory consumption of Stream functions
  • [Mix] Automatically recompile on outdated Elixir version and show proper error messages

Deprecations

  • [File] File.stream_to!/3 is deprecated
  • [GenFSM] GenFSM is deprecated
  • [Kernel] % for sigils is deprecated in favor of ~
  • [Kernel] is_range/1 and is_regex/1 are deprecated in favor of Range.range?/1 and Regex.regex?/1
  • [Stream] Stream.after/1 is deprecated
  • [URI] URI.decode_query/1 is deprecated in favor of URI.decode_query/2 with explicit dict argument
  • [URI] Passing lists as key or values in URI.encode_query/1 is deprecated

Backwards incompatible changes

  • [Mix] Remove MIX_GIT_FORCE_HTTPS as Git itself already provides mechanisms for doing so

v0.12.4

12 Feb 08:28
Compare
Choose a tag to compare
v0.12.4 Pre-release
Pre-release

Enhancements

  • [Mix] mix deps.get and mix deps.update no longer compile dependencies afterwards. Instead, they mark the dependencies which are going to be automatically compiled next time deps.check is invoked (which is done automatically by most mix tasks). This means users should have a better workflow when migrating in between environments

Deprecations

  • [Kernel] // for default arguments is deprecated in favor of \\
  • [Kernel] Using % for sigils is deprecated in favor of ~. This is a soft deprecation, no warnings will be emitted for it in this release
  • [Kernel] Using ^ inside function clause heads is deprecated, please use a guard instead

Backwards incompatible changes

  • [ExUnit] CaptureIO returns an empty string instead of nil when there is no capture
  • [Version] The Version module now only works with SemVer. The functions Version.parse/1 and Version.parse_requirement/1 now return {:ok,res} | :error for the cases you want to handle non SemVer cases manually. All other functions will trigger errors on non semantics versions

v0.12.3

02 Feb 18:57
Compare
Choose a tag to compare
v0.12.3 Pre-release
Pre-release

Enhancements

  • [Kernel] Warnings now are explicitly tagged with "warning:" in messages
  • [Kernel] Explicit functions inlined by the compiler, including operators. This means that Kernel.+/2 will now expand to :erlang.+/2 and so on
  • [Mix] Do not fail if a Mix dependency relies on an outdated Elixir version
  • [Process] Add Process.send/2 and Process.send_after/3
  • [Version] Add Version.compare/2

Bug fixes

  • [Atom] Inspect :... and :foo@bar without quoting
  • [Keyword] The list [1, 2, three: :four] now correctly expands to [1, 2, {:three, :four}]
  • [Kernel] Ensure undefined @attributes shows proper stacktrace in warnings
  • [Kernel] Guarantee nullary funs/macros are allowed in guards
  • [Process] Ensure monitoring functions are inlined by the compiler

Deprecations

  • [IEx] The helper m/0 has been deprecated. The goal is to group all runtime statistic related helpers into a single module
  • [Kernel] binary_to_term/1, binary_to_term/2, term_to_binary/1 and term_to_binary/2 are deprecated in favor of their counterparts in the :erlang module
  • [Kernel] // for default arguments is deprecated in favor of \\. This is a soft deprecation, no warnings will be emitted for it in this release
  • [Kernel] Deprecated @behavior in favor of @behaviour
  • [Record] to_keywords, getter and list getter functionalities in defrecordp are deprecated
  • [Record] Record.import/2 is deprecated

Backwards incompatible changes

  • [Dict] Implementations of equal?/2 and merge/2 in HashDict and ListDict are no longer polymorphic. To get polymorphism, use the functions in Dict instead
  • [File] File.cp/3 and File.cp_r/3 no longer carry Unix semantics where the function behaves differently if the destination is an existing previous directory or not. It now always copies source to destination, doing it recursively in the latter
  • [IEx] IEx now loads the .iex.exs file instead of .iex
  • [Kernel] Remove ** from the list of allowed operators
  • [Kernel] Limit sigils delimiters to one of the following: <>, {}, [], (), ||, //, " and '
  • [Range] Range is no longer a record, instead use first .. last if you need pattern matching
  • [Set] Implementations of difference/2, disjoint?/2, equal?/2, intersection/2, subset?/2 and union/2 in HashSet are no longer polymorphic. To get polymorphism, use the functions in Set instead

v0.12.2

15 Jan 15:07
Compare
Choose a tag to compare
v0.12.2 Pre-release
Pre-release

Enhancements

  • [EEx] Allow EEx.AssignsEngine to accept any Dict
  • [Enum] Add Enum.flat_map_reduce/3
  • [ExUnit] Support @moduletag in ExUnit cases
  • [Kernel] Improve stacktraces to be relative to the compilation path and include the related application
  • [Stream] Add Stream.transform/3

Bug fixes

  • [ExUnit] :include in ExUnit only has effect if a test was previously excluded with :exclude
  • [ExUnit] Only run setup_all and teardown_all if there are tests in the case
  • [Kernel] Ensure bitstring modifier arguments are expanded
  • [Kernel] Ensure compiler does not block on missing modules
  • [Kernel] Ensure <>/2 works only with binaries
  • [Kernel] Fix usage of string literals inside <<>> when utf8/utf16/utf32 is used as specifier
  • [Mix] Ensure mix properly copies _build dependencies on Windows

Deprecations

  • [Enum] Deprecate Enum.first/1 in favor of Enum.at/2 and List.first/1
  • [Kernel] Deprecate continuable heredocs. In previous versions, Elixir would continue parsing on the same line the heredoc started, this behavior has been deprecated
  • [Kernel] is_alive/0 is deprecated in favor of Node.alive?
  • [Kernel] Kernel.inspect/2 with Inspect.Opts[] is deprecated in favor of Inspect.Algebra.to_doc/2
  • [Kernel] Kernel.inspect/2 with :raw option is deprecated, use :records option instead
  • [Kernel] Deprecate <-/2 in favor of send/2

Backwards incompatible changes

  • [String] Change String.next_grapheme/1 and String.next_codepoint/1 to return nil on string end