Skip to content

Releases: elixir-lang/elixir

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

v0.12.1

04 Jan 09:43
Compare
Choose a tag to compare
v0.12.1 Pre-release
Pre-release

Enhancements

  • [ExUnit] Support :include and :exclude configuration options to filter which tests should run based on their tags. Those options are also supported via mix test as --include and --exclude
  • [ExUnit] Allow doctests to match against #MyModule<>

Bug fixes

  • [CLI] Abort when a pattern given to elixirc does not match any file
  • [Float] Fix Float.parse/1 to handle numbers of the form "-0.x"
  • [IEx] Improve error message for IEx.Helpers.r when module does not exist
  • [Mix] Ensure deps.get updates origin if lock origin and dep origin do not match
  • [Mix] Use relative symlinks in _build
  • [Typespec] Fix conversion of unary ops from typespec format to ast
  • [Typespec] Fix handling of tuple() and {}

Deprecations

  • [Kernel] Do not leak clause heads. Previously, a variable defined in a case/receive head clauses would leak to the outer scope. This behaviour is deprecated and will be removed in the next release.
  • [Kernel] Deprecate __FILE__ in favor of __DIR__ or __ENV__.file

Backwards incompatible changes

  • [GenFSM] GenServer now stops on unknown event/sync_event requests
  • [GenServer] GenServer now stops on unknown call/cast requests
  • [Kernel] Change how -> is represented in AST. Now each clause is represented by its own AST node which makes composition easier. See commit 51aef55 for more information.

v0.12.0

15 Dec 22:14
Compare
Choose a tag to compare
v0.12.0 Pre-release
Pre-release

Enhancements

  • [Exception] Allow exception/1 to be overriden and promote it as the main mechanism to customize exceptions
  • [File] Add File.stream_to!/3
  • [Float] Add Float.floor/1, Float.ceil/1 and Float.round/3
  • [Kernel] Add List.delete_at/2 and List.updated_at/3
  • [Kernel] Add Enum.reverse/2
  • [Kernel] Implement defmodule/2, @/1, def/2 and friends in Elixir itself. case/2, try/2 and receive/1 have been made special forms. var!/1, var!/2 and alias!/1 have also been implemented in Elixir and demoted from special forms
  • [Record] Support dynamic fields in defrecordp
  • [Stream] Add Stream.resource/3
  • [Stream] Add Stream.zip/2, Stream.filter_map/3, Stream.each/2, Stream.take_every/2, Stream.chunk/2, Stream.chunk/3, Stream.chunk/4, Stream.chunk_by/2, Stream.scan/2, Stream.scan/3, Stream.uniq/2, Stream.after/2 and Stream.run/1
  • [Stream] Support Stream.take/2 and Stream.drop/2 with negative counts

Bug fixes

  • [HashDict] Ensure a HashDict stored in an attribute can be accessed via the attribute
  • [Enum] Fix bug in Enum.chunk/4 where you'd get an extra element when the enumerable was a multiple of the counter and a pad was given
  • [IEx] Ensure c/2 helper works with full paths
  • [Kernel] quote location: :keep now only affects definitions in order to keep the proper trace in definition exceptions
  • [Mix] Also symlink include directories in _build dependencies
  • [Version] Fix Version.match?/2 with ~> and versions with alphanumeric build info (like -dev)

Deprecations

  • [Enum] Enumerable.count/1 and Enumerable.member?/2 should now return tagged tuples. Please see Enumerable docs for more info
  • [Enum] Deprecate Enum.chunks/2, Enum.chunks/4 and Enum.chunks_by/2 in favor of Enum.chunk/2, Enum.chunk/4 and Enum.chunk_by/2
  • [File] File.binstream!/3 is deprecated. Simply use File.stream!/3 which is able to figure out if stream or binstream operations should be used
  • [Macro] Macro.extract_args/1 is deprecated in favor of Macro.decompose_call/1

Backwards incompatible changes

  • [Enum] Behaviour of Enum.drop/2 and Enum.take/2 has been switched when given negative counts
  • [Enum] Behaviour of Enum.zip/2 has been changed to stop as soon as the first enumerable finishes
  • [Enum] Enumerable.reduce/3 protocol has changed to support suspension. Please see Enumerable docs for more info
  • [Mix] Require :escript_main_module to be set before generating escripts
  • [Range] Range.Iterator protocol has changed in order to work with the new Enumerable.reduce/3. Please see Range.Iterator docs for more info
  • [Stream] The Stream.Lazy structure has changed to accumulate functions and accumulators as we go (its inspected representation has also changed)
  • [Typespec] when clauses were moved to the outer part of the spec and should be in the keywords format. So add(a, b) when is_subtype(a, integer) and is_subtype(b, integer) :: integer should now be written as add(a, b) :: integer when a: integer, b: integer

v0.11.2

14 Nov 11:51
Compare
Choose a tag to compare
v0.11.2 Pre-release
Pre-release

Enhancements

  • [Mix] Add mix iex that redirects users to the proper iex -S mix command
  • [Mix] Support build_per_environment: true in project configuration that manages a separete build per environment, useful when you have per-environment behaviour/compilation

Backwards incompatible changes

  • [Mix] Mix now compiles files to _build. Projects should update just fine, however documentation and books may want to update to the latest information

v0.11.1

07 Nov 17:47
Compare
Choose a tag to compare
v0.11.1 Pre-release
Pre-release

Enhancements

  • [Mix] Improve dependency convergence by explicitly checking each requirement instead of expecting all requirements to be equal
  • [Mix] Support optional dependencies with optional: true. Optional dependencies are downloaded for the current project but they are automatically skipped when such project is used as a dependency

Bug fixes

  • [Kernel] Set compilation status per ParallelCompiler and not globally
  • [Mix] Ensure Mix does not load previous dependencies versions before deps.get/deps.update
  • [Mix] Ensure umbrella apps are sorted before running recursive commands
  • [Mix] Ensure umbrella apps run in the same environment as the parent project
  • [Mix] Ensure dependency tree is topsorted before compiling
  • [Mix] Raise error when duplicated projects are pushed into the stack
  • [URI] Allow lowercase escapes in URI

Deprecations

  • [Mix] Setting :load_paths in your project configuration is deprecated

v0.11.0

02 Nov 09:30
Compare
Choose a tag to compare
v0.11.0 Pre-release
Pre-release

Enhancements

  • [Code] Eval now returns variables from other contexts
  • [Dict] Document and enforce all dicts use the match operator (===) when checking for keys
  • [Enum] Add Enum.slice/2 with a range
  • [Enum] Document and enforce Enum.member?/2 to use the match operator (===)
  • [IEx] Split IEx.Evaluator from IEx.Server to allow custom evaluators
  • [IEx] Add support for IEx.pry which halts a given process for inspection
  • [IO] Add specs and allow some IO APIs to receive any data that implements String.Chars
  • [Kernel] Improve stacktraces on command line interfaces
  • [Kernel] Sigils can now handle balanced tokens as in %s(f(o)o)
  • [Kernel] Emit warnings when an alias is not used
  • [Macro] Add Macro.pipe/3 and Macro.unpipe/1 for building pipelines
  • [Mix] Allow umbrella children to share dependencies between them
  • [Mix] Allow mix to be escriptize'd
  • [Mix] Speed mix projects compilation by relying on more manifests information
  • [Protocol] Protocols now provide impl_for/1 and impl_for!/1 functions which receive a structure and returns its respective implementation, otherwise returns nil or an error
  • [Set] Document and enforce all sets use the match operator (===) when checking for keys
  • [String] Update to Unicode 6.3.0
  • [String] Add String.slice/2 with a range

Bug fixes

  • [Exception] Ensure defexception fields can be set dynamically
  • [Kernel] Guarantee aliases hygiene is respected when the current module name is not known upfront
  • [Kernel] Kernel.access/2 no longer flattens lists
  • [Mix] Ensure cyclic dependencies are properly handled
  • [String] Implement the extended grapheme cluster algorithm for String operations

Deprecations

  • [Kernel] pid_to_list/1, list_to_pid/1, binary_to_atom/2, binary_to_existing_atom/2 and atom_to_binary/2 are deprecated in favor of their counterparts in the :erlang module
  • [Kernel] insert_elem/3 and delete_elem/2 are deprecated in favor of Tuple.insert_at/3 and Tuple.delete_at/2
  • [Kernel] Use of in inside matches (as in x in [1,2,3] -> x) is deprecated in favor of the guard syntax (x when x in [1,2,3])
  • [Macro] Macro.expand_all/2 is deprecated
  • [Protocol] @only and @except in protocols are now deprecated
  • [Protocol] Protocols no longer fallback to Any out of the box (this functionality needs to be explicitly enabled by setting @fallback_to_any to true)
  • [String] String.to_integer/1 and String.to_float/1 are deprecated in favor of Integer.parse/1 and Float.parse/1

Backwards incompatible changes

  • [CLI] Reading .elixirrc has been dropped in favor of setting env vars
  • [Kernel] Kernel.access/2 now expects the second argument to be a compile time list
  • [Kernel] fn -> end quoted expression is no longer wrapped in a do keyword
  • [Kernel] Quoted variables from the same module must be explicitly shared. Previously, if a function returned quote do: a = 1, another function from the same module could access it as quote do: a. This has been fixed and the variables must be explicitly shared with var!(a, __MODULE__)
  • [Mix] Umbrella apps now treat children apps as dependencies. This means all dependencies will be checked out in the umbrela deps directory. On upgrade, child apps need to point to the umbrella project by setting deps_path: "../../deps_path", lockfile: "../../mix.lock" in their project config
  • [Process] Process.group_leader/2 args have been reversed so the "subject" comes first
  • [Protocol] Protocol no longer dispatches to Number, but to Integer and Float