Releases: elixir-lang/elixir
Releases · elixir-lang/elixir
v0.14.0
Enhancements
- [ExUnit] Add
on_exit/1callbacks 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/3andget_and_update_in/3to handle nested data structure operations - [Kernel] Add
get_in/1,put_in/2,update_in/2andget_and_update_in/2to handle nested data structure operations via paths - [Mix] Add
Mix.Configto ease definition of configuration files - [Mix] Add
mix loadconfigtask that can be called multiple times to load external configs - [Mix] Support
--configoption onmix run - [Mix] Support
HTTP_PROXYandHTTPS_PROXYon Mix url commands - [Mix] Support
--namesoptions inmix helpwhich emit only names (useful for autocompletion) - [Protocol] Add
Protocol.consolidate/2,Protocol.consolidated?/1and amix compile.protocolstask for protocol consolidation - [Protocol] Add
Protocol.derive/3for runtime deriving of a struct - [String] Add
String.chunk/2 - [Struct] Add support for
@derivebeforedefstruct/2definitions
Bug fixes
- [File]
File.rmnow consistently deletes read-only across operating systems - [Kernel] Ensure Mix
_buildstructure works on Windows when copying projects - [Kernel] Ensure
1.0E10(with uppercase E) is also valid syntax - [Mix] Fix
mix dotask for Windows' powershell users - [Path] Fix
Path.absname("/")andPath.expand("/")to return the absolute path"/".
Soft deprecations (no warnings emitted)
- [Kernel]
size/1is deprecated, please usebyte_size/1ortuple_size/1instead - [ExUnit]
teardown/2andteardown_all/2are deprecated in favor ofon_exit/1callbacks
Deprecations
- [Access]
Access.access/2is deprecated in favor ofAccess.get/2 - [Dict]
Dict.Behaviouris deprecated in favor ofDict - [Kernel]
Application.Behaviour,GenEvent.Behaviour,GenServer.BehaviourandSupervisor.Behaviourare deprecated in favor ofApplication,GenEvent,GenServerandSupervisor - [Kernel]
defexception/3is deprecated in favor ofdefexception/1 - [Kernel]
raise/3is deprecated in favor ofreraise/2 - [Kernel]
set_elem/3is deprecated in favor ofput_elem/3 - [Kernel] Passing an atom
var!/1is deprecated, variables can be built dynamically withMacro.var/2 - [Mix] Exceptions that define a
:mix_errorfield to be compatible with Mix are no longer supported. Instead please provide a:mixfield and useMix.raise/1andMix.raise/2
Backwards incompatible changes
- [Access]
Kernel.access/2no longer exists and theAccessprotocol now requiresget/2(instead ofaccess/2) andget_and_update/3to be implemented - [Kernel] Retrieving docs as
module.__info__(:docs)is no longer supported, please useCode.get_docs/2instead - [Kernel]
Code.compiler_options/1no longer accepts custom options, only the ones specified by Elixir (use mix config instead) - [Mix]
mix newno longer generates a supevision tree by default, please pass--supinstead - [Task] Tasks are automatically linked to callers and a failure in the task will crash the caller directly
v0.13.3
Enhancements
- [OptionParser] Add
:strictoption that only parses known switches - [OptionParser] Add
next/2useful for manual parsing of options - [Macro] Add
Macro.prewalk/2/3andMacro.postwalk/2/3 - [Kernel]
GenEvent,GenServer,Supervisor,AgentandTaskmodules added - [Kernel] Make deprecations compiler warnings to avoid the same deprecation being printed multiple times
Bug fixes
- [Enum] Fix
Enum.join/2andEnum.map_join/3for empty binaries at the beginning of the collection - [ExUnit] Ensure the formatter doesn't error when printing :EXITs
- [Kernel] Rename
ELIXIR_ERL_OPTStoELIXIR_ERL_OPTIONSfor consistency withERL_COMPILER_OPTIONS - [OptionParser] Parse
-as a plain argument - [OptionParser]
--is always removed from argument list onparse/2and when it is the leading entry onparse_head/2 - [Regex] Properly escape regex (previously regex controls were double escaped)
Soft deprecations (no warnings emitted)
- [Dict]
Dict.Behaviouris deprecated in favor ofDict - [Kernel]
Application.Behaviour,GenEvent.Behaviour,GenServer.BehaviourandSupervisor.Behaviourare deprecated in favor ofApplication,GenEvent,GenServerandSupervisor - [Kernel]
defexception/3is deprecated in favor ofdefexception/1 - [Kernel]
raise/3is deprecated in favor ofreraise/2 - [Kernel]
set_elem/3is deprecated in favor ofput_elem/3
Soft deprecations for conversions (no warnings emitted)
- [Kernel]
atom_to_binary/1andatom_to_list/1are deprecated in favor ofAtom.to_string/1andAtom.to_char_list/1 - [Kernel]
bitstring_to_list/1andlist_to_bitstring/1are deprecated in favor of the:erlangones - [Kernel]
binary_to_atom/1,binary_to_existing_atom/1,binary_to_float/1,binary_to_integer/1andbinary_to_integer/2are deprecated in favor of conversion functions inString - [Kernel]
float_to_binary/*andfloat_to_list/*are deprecated in favor ofFloat.to_string/*andFloat.to_char_list/* - [Kernel]
integer_to_binary/*andinteger_to_list/*are deprecated in favor ofInteger.to_string/*andInteger.to_char_list/* - [Kernel]
iodata_to_binary/1andiodata_length/1are deprecatedIO.iodata_to_binary/1andIO.iodata_length/1 - [Kernel]
list_to_atom/1,list_to_existing_atom/1,list_to_float/1,list_to_integer/1,list_to_integer/2andlist_to_tuple/1are deprecated in favor of conversion functions inList - [Kernel]
tuple_to_list/1is deprecated in favor ofTuple.to_list/1 - [List]
List.from_char_data/1andList.from_char_data!/1deprecated in favor ofString.to_char_list/1 - [String]
String.from_char_data/1andString.from_char_data!/1deprecated in favor ofList.to_string/1
Deprecations
- [Kernel]
is_exception/1,is_record/1andis_record/2are deprecated in favor ofException.exception?1,Record.record?/1andRecord.record?/2 - [Kernel]
defrecord/3is deprecated in favor of structs - [Kernel]
:hygieneinquoteis deprecated - [Mix]
Mix.project/0is deprecated in favor ofMix.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/2andProcess.self/0are deprecated in favor of the ones inKernel
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
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/1andException.format/1 - [File] Add
File.ln_s/1 - [Mix]
mix deps.cleannow works accross environments - [Mix] Support line numbers in
mix test, e.g. test/some/file_test.exs:12 - [Mix] Use
@fileattributes to detect dependencies in between.exand external files. This means changing an.eexfile will no longer recompile the whole project only the files that depend directly on it - [Mix] Support application configurations in
config/config.exswhich can be customized by specifying your own:config_path - [Mix] Support user-wide configuration with
~/.mix/config.exs - [Mix]
mix helpnow uses ANSI formatting to print guides - [Regex] Support functions in
Regex.replace/4 - [String] Support
:partsinString.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.baton 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
Elixirto 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
.gitignorefor--umbrellaprojects - [Mix] Verify if a git dependency in deps has a proper git checkout and clean it automatically when it doesn't
- [Mix] Ensure
mix testworks withIEx.pry/0 - [System] Convert remaining functions in System to rely on char data
Soft deprecations (no warnings emitted)
- [Application]
use Application.Behaviouris deprecated in favor ofuse Application - [Exception]
exception.messageis deprecated in favorException.message/1for retrieving exception messages - [Kernel]
is_exception/1,is_record/1andis_record/2are deprecated in favor ofException.exception?1,Record.record?/1andRecord.record?/2 - [Mix]
Mix.project/0is deprecated in favor ofMix.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/2andProcess.self/0are deprecated in favor of the ones inKernel
Deprecations
- [IEx] IEx.Options is deprecated in favor of
IEx.configure/1andIEx.configuration/0 - [Kernel]
lcandbccomprehensions are deprecated in favor offor - [Macro]
Macro.safe_terms/1is deprecated - [Process]
Process.delete/0is deprecated - [Regex] Deprecate
:globaloption inRegex.split/3in favor ofparts: :infinity - [String] Deprecate
:globaloption inString.split/3in favor ofparts: :infinity
Backwards incompatible changes
- [ExUnit]
ExUnit.TestandExUnit.TestCasehas 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,RegexandVersion.Requirementhave been converted to structs. This meansis_record/2checks will no longer work, instead, you can pattern match on them using%Range{}and similar - [URI] The
URI.Inforecord has now become theURIstruct - [Version] The
Version.Schemarecord has now become theVersionstruct
v0.13.1
Enhancements
- [Mix] Support
MIX_EXSas 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_sizeandiolist_to_binaryare deprecated in favor ofiodata_sizeandiodata_to_binary(this is a soft deprecation, no warnings will be emitted) - [Mix]
:envkey in project configuration is deprecated - [Regex]
Regex.groups/1is deprecated in favor ofRegex.names/1 - [String]
String.to_char_list/1is deprecated in favor ofList.from_char_data/1(this is a soft deprecation, no warnings will be emitted) - [String]
String.from_char_list/1is deprecated in favor ofString.from_char_data/1(this is a soft deprecation, no warnings will be emitted)
Backwards incompatible changes
- [Macro]
Macro.unpipe/1now returns tuples andMacro.pipe/2was removed in favor ofMacro.pipe/3which explicitly expects the second element of the tuple returned by the newMacro.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
uoption
v0.13.0
Enhancements
- [Base] Add
Basemodule which does conversions to bases 16, 32, hex32, 64 and url64 - [Code] Add
Code.eval_file/2 - [Collectable] Add the
Collectableprotocol that empowersEnum.into/2andStream.into/2and the:intooption in comprehensions - [Collectable] Implement
Collectablefor lists, dicts, bitstrings, functions and provide bothFile.StreamandIO.Stream - [EEx] Add
handle_body/1callback toEEx.Engine - [Enum] Add
Enum.group_by/2,Enum.into/2,Enum.into/3,Enum.traverse/2andEnum.sum/2 - [ExUnit] Randomize cases and tests suite runs, allow seed configuration and the
--seedflag viamix test - [ExUnit] Support
--onlyfor filtering when running tests withmix test - [ExUnit] Raise an error if another
capture_ioprocess 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
:promptoption - [IEx] Use werl on Windows
- [Kernel] Support
ERL_PATHinbin/elixir - [Kernel] Support interpolation in keyword syntax
- [Map] Add a Map module and support 17.0 maps and structs
- [Mix] Add dependency option
:onlyto specify the dependency environment.mix deps.getandmix deps.updateworks accross all environment unless--onlyis 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/3and support the--gen-debugoption - [Regex] Regexes no longer need the "g" option when there is a need to use named captures
- [Stream] Add
Stream.into/2andStream.into/3 - [StringIO] Add a
StringIOmodule that allows a String to be used as IO device - [System] Add
System.delete_env/1to remove a variable from the environment
Bug fixes
- [CLI] Ensure
--appis handled as an atom before processing - [ExUnit] Ensure
ExUnit.Assertionsdoes not emit compiler warnings forassert_receive - [Kernel] Ensure the same pid is not queued twice in the parallel compiler
- [Macro]
Macro.to_string/2considers proper precedence when translating!(foo > bar)into a string - [Mix] Automatically recompile on outdated Elixir version and show proper error messages
- [Mix] Ensure generated
.appfile includes core dependencies - [Mix] Allow a dependency with no SCM to be overridden
- [Mix] Allow queries in
mix local.installURL - [OptionParser] Do not recognize undefined aliases as switches
Deprecations
- [Dict]
Dict.empty/1,Dict.new/1andDict.new/2are deprecated - [Exception]
Exception.normalize/1is deprecated in favor ofException.normalize/2 - [Kernel]
lcandbccomprehensions are deprecated in favor offor(this is a soft deprecation, no warning will be emitted) - [ListDict]
ListDictis deprecated in favor ofMap(this is a soft deprecation, no warning will be emitted) - [Record]
defrecord/2,defrecordp/3,is_record/1andis_record/2macros in Kernel are deprecated. Instead, use the new macros and API defined in theRecordmodule (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/2returns a map with results
v0.12.5
Bug fixes
- [Kernel] Ensure
trydoes not generate an after clause. Generating an after clause forbade clauses in theelsepart from being tail recursive. This should improve performance and memory consumption ofStreamfunctions - [Mix] Automatically recompile on outdated Elixir version and show proper error messages
Deprecations
- [File]
File.stream_to!/3is deprecated - [GenFSM]
GenFSMis deprecated - [Kernel]
%for sigils is deprecated in favor of~ - [Kernel]
is_range/1andis_regex/1are deprecated in favor ofRange.range?/1andRegex.regex?/1 - [Stream]
Stream.after/1is deprecated - [URI]
URI.decode_query/1is deprecated in favor ofURI.decode_query/2with explicit dict argument - [URI] Passing lists as key or values in
URI.encode_query/1is deprecated
Backwards incompatible changes
- [Mix] Remove
MIX_GIT_FORCE_HTTPSas Git itself already provides mechanisms for doing so
v0.12.4
Enhancements
- [Mix]
mix deps.getandmix deps.updateno longer compile dependencies afterwards. Instead, they mark the dependencies which are going to be automatically compiled next timedeps.checkis 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]
CaptureIOreturns an empty string instead of nil when there is no capture - [Version] The
Versionmodule now only works with SemVer. The functionsVersion.parse/1andVersion.parse_requirement/1now return{:ok,res} | :errorfor the cases you want to handle non SemVer cases manually. All other functions will trigger errors on non semantics versions
v0.12.3
Enhancements
- [Kernel] Warnings now are explicitly tagged with "warning:" in messages
- [Kernel] Explicit functions inlined by the compiler, including operators. This means that
Kernel.+/2will now expand to:erlang.+/2and so on - [Mix] Do not fail if a Mix dependency relies on an outdated Elixir version
- [Process] Add
Process.send/2andProcess.send_after/3 - [Version] Add
Version.compare/2
Bug fixes
- [Atom] Inspect
:...and:foo@barwithout quoting - [Keyword] The list
[1, 2, three: :four]now correctly expands to[1, 2, {:three, :four}] - [Kernel] Ensure undefined
@attributesshows 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/0has 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/1andterm_to_binary/2are deprecated in favor of their counterparts in the:erlangmodule - [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
@behaviorin favor of@behaviour - [Record]
to_keywords,getterandlist getterfunctionalities indefrecordpare deprecated - [Record]
Record.import/2is deprecated
Backwards incompatible changes
- [Dict] Implementations of
equal?/2andmerge/2inHashDictandListDictare no longer polymorphic. To get polymorphism, use the functions inDictinstead - [File]
File.cp/3andFile.cp_r/3no 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.exsfile instead of.iex - [Kernel] Remove
**from the list of allowed operators - [Kernel] Limit sigils delimiters to one of the following:
<>,{},[],(),||,//,"and' - [Range]
Rangeis no longer a record, instead usefirst .. lastif you need pattern matching - [Set] Implementations of
difference/2,disjoint?/2,equal?/2,intersection/2,subset?/2andunion/2inHashSetare no longer polymorphic. To get polymorphism, use the functions inSetinstead
v0.12.2
Enhancements
- [EEx] Allow
EEx.AssignsEngineto accept any Dict - [Enum] Add
Enum.flat_map_reduce/3 - [ExUnit] Support
@moduletagin 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]
:includein ExUnit only has effect if a test was previously excluded with:exclude - [ExUnit] Only run
setup_allandteardown_allif there are tests in the case - [Kernel] Ensure bitstring modifier arguments are expanded
- [Kernel] Ensure compiler does not block on missing modules
- [Kernel] Ensure
<>/2works only with binaries - [Kernel] Fix usage of string literals inside
<<>>whenutf8/utf16/utf32is used as specifier - [Mix] Ensure mix properly copies _build dependencies on Windows
Deprecations
- [Enum] Deprecate
Enum.first/1in favor ofEnum.at/2andList.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/0is deprecated in favor ofNode.alive? - [Kernel]
Kernel.inspect/2withInspect.Opts[]is deprecated in favor ofInspect.Algebra.to_doc/2 - [Kernel]
Kernel.inspect/2with:rawoption is deprecated, use:recordsoption instead - [Kernel] Deprecate
<-/2in favor ofsend/2
Backwards incompatible changes
- [String] Change
String.next_grapheme/1andString.next_codepoint/1to returnnilon string end
v0.12.1
Enhancements
- [ExUnit] Support
:includeand:excludeconfiguration options to filter which tests should run based on their tags. Those options are also supported viamix testas--includeand--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/1to handle numbers of the form "-0.x" - [IEx] Improve error message for
IEx.Helpers.rwhen module does not exist - [Mix] Ensure
deps.getupdates 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.