-
Enhancements
- Add
defgenanddefgenpfor defining public and private generators - Add
yield/0,yield/1, andyield_to\1toKernel - Updated output folder structure. stdlib code will now go in an
elxiirfolder under the output paths while generated app code will go into anappfolder under the output path
- Add
-
Breaking
- All process macros and functions now expect to receive and/or work using generators as entry points. Using functions defined with
defordefpwill not work correctly with them
- All process macros and functions now expect to receive and/or work using generators as entry points. Using functions defined with
-
Bug fixes
- Correctly returning list if list is only item in body
-
Enhancements
- This is the first release with early support for processes in elixirscript. Creating a process only works currently using
spawn/1,spawn_link/1, andspawn_monitor/1. Inside of a process, you can use functions such assendandreceive, along with some defined in theProcessmodule. From outside of a process, you can send messages to a process, but you cannot receive a message from a process. Eventually all code will run inside processes and this restriction will naturally lift. - The
Processmodule has been implemented with the following functions:alive?/1delete/1demonitor/1exit/2flag/2flag/3get/0get_keys/0get_keys/1link/1list/0monitor/1put/2register/2registered/0send/3sleep/1unlink/1unregister/1whereis/1
- The
receivespecial form has been implemented with the above caveat - The following have been implemented on
Kernel:spawn/1spawn_link/1spawn_monitor/1send/2make_ref/0
- This is the first release with early support for processes in elixirscript. Creating a process only works currently using
-
Fixed
- Scoping on
fnanddef
- Scoping on
- Enhancements
- Add
ElixirScript.Watchermodule andelixirscript.watchmix task - Add logging MatchError exceptions to better show terms that don't match
- Add
-
Enhancements
- Added elixir_script mix compiler
-
Breaking
Html,View, andVDommodules have been removed
-
Enhancements
- Better support for macros. Macros should be defined in .ex or .exs files. ElixirScript code should be in .exjs files
-
Breaking
- The above functionality will cause either compiler errors or no output. Please change extensions of ElixirScript code to .exjs
-
Deprecations
Html,View, andVDommodules will be removed in the next version as they can now be replicated using macros
-
Enhancements
- Incremental Compilation: ElixirScript will now only build files and modules that have changed since the last build
- Added
outputas an option for compiler functions. This controls whether output is returned as a list of tuples, send to stdout, or saved to a file path - Added
:full_buildas an option for compiler functions and--full-buildoption to CLI. These force the compiler to perform a full build - Added
--versionoption to CLI. Outputs current version of elixirscript - Added
--std-liboption to CLI. Takes a path and adds the stdlib to that path
-
Breaking
- Removed
--coreoption from CLI and:corecompiler option. - Renamed
copy_core_to_destinationtocopy_stdlib_to_destination
- Removed
-
Enhancements
-
Bitstring pattern matching
-
Bitstrings in for comprehensions
-
Functions with catch, after, else clauses
-
withspecial form -
Pin operator in map keys and function clauses
-
Added
Kernel.object/1function to make it more natural to create a JavaScript object with string keys Elixirscript, by default turns the following,%{a: "b"}into{[Symbol.for("a")]: "b"}in JavaScript. In order to get string keys, one would have to do%{"a" => "b"}which turns into{a: "b"}in JavaScript. WithKernel.object, you can create string keyed maps conveniently,object(a: "b")which turns into{a: "b"}.NOTE: when updating the created by, you still have to use the string form
%{ my_map | "a" => "c" }
-
-
Bugfixes
- Optional parameters should now work as expected
-
Breaking
JS.update(object, property, value)has been removed and replaced withJS.update(object, map)This allows you to update multiple values on a javascript object at once.
-
Enhancements
- Support for variables as map keys
-
Bug fixes
- Fixed protocol implementations for Integer and Float which where not recognized
- Fixed calling properties on non-objects
- Bug fixes
- Fixed View module so that an element can have multiple elements within
- Removed
catchas a javascript keyword to filter - Fixed struct implementation so that lists of atoms for fields are compiled correctly
- Fixed head-tail pattern match to allow for more complicated scenarios
- Fixed ModuleCollector to properly alias inner modules
- Fixed raise translation to properly translate when string messages are given
-
Enhancements
alias,require, andimportnow work inside lexical scopes__ENV__and__CALLER__are now supported- Some of the standard library originally written in JavaScript has been rewritten in Elixir.
- Added
JS.import/1,JS.typeof/1,JS.instanceof/1, andJS.global/1 - Added support for multi alias/require/imports statements
- Generated JavaScript export statements are now default exports
- When output is sent to standard out, there are now markers to specify where
each module begins as well as what the file name would be.
For the end of a file,
//:ENDFILEis used. For the file name,//<file>:ENDFILENAMEis used where<file>is the name of the file
-
Breaking
compile,compile_path, andcompile_quotedopts parameter now expects a map- The
stdlibcompiler option is nowcore. Thestdlib_pathcompiler options is nowcore_path
- Enhancements
- Removed .DS_Store and LICENSE from output
- Breaking
- Renamed
ex2jstoelixirscript. This effects the escript as well as the mix task
- Renamed
- Enhancements
- Structs are now translated into classes
- Structs and Tuples now match on their types
- Can now match on JavaScript classes. Works just like matching on structs:
def my_func(%HTMLElement{id: "myId"})
- Can now implement protocols using JavaScript types
defimpl MyProtocol, for: HTMLElement
- Added virtual-dom JavaScript library
- Added ElixirScript.Html module for defining a virtual-dom tree
- Added ElixirScript.VDom module for manipulating the virtual-dom tree created using the ElixirScript.Html module
- Added ElixirScript.View module for handling view state and rendering virtual-dom
- Added
stdlib_pathcompiler option to specify the es6 path to the standard library. If used, elixir.js will not be exported with the compiled modules - Moved non-elixir JavaScript code into
corees6 module. This will hopefully make it so ElixirScript Standard Library modules can be defined in Elixir soon.
- Enhancements
- Added
Basemodule with function: encode64, decode64, and decode64! - Added
Stringmodule - Added
Bitwisemodule - Added
Mapmodule - Added
MapSetmodule - Added
Setmodule - Protocol support
- Added
Collectable,Enumerable,Inspect,List.Chars, andString.Charsprotocols. The only one currently being used in the Standard Library, however, is String.Chars
- Added
- Enhancements
- Updated tuple implementation. It's now a class.
- Replaced pattern matching library with custom one
- Added PostOffice. Only thing that current uses it is Agent
- Removed erlang.js. Moved data types to Kernel.SpecialForms
elsenow works for try expressions- for now works with
intofor lists
-
Enhancements
importworks with all options- Added
JSmodule withnew,mutate,importmacros - All Standard libraries are rolled up into one elixir.js file and imported from that
- Added
Keywordmodule with functions,has_key?andget - Added
Agentmodule with functions,start,get,update, andget_and_update - Map keys are now correctly turned into their atom counterparts if atom keys are used
- Modules no longer export a default object
aliasnow translates to a namespace import unlessdefaultoption is given
-
Breaking
Mutable.updatehas been replaced byJS.updatetranspile,transpile_quoted, andtranspile_pathare nowcompile,compile_quoted, andcompile_path
- Enhancements
- Added
envoption forElixirScript.transpileadding macros for compilation - Fixed
caseimplementation to addthisto call - Updated
Kernelmodule to translate some functions to it's JavaScript equivalent - Added
Loggerthat translates Logger functions to console
- Added
- Enhancements
- an implementation for quote. Currently ignores
:locationand:contextoptions - an implementation for unquote and unquote_splicing
- an implementation for quote. Currently ignores
- Enhancements
- Can now support catch blocks in try expressions
- Wrapped try's in function closure to make sure they return a value;
- Added receive
- Updated pattern matching implementation
- Enhancements
- Can now support rescue and after blocks in try expressions
- Enhancements
- Now using the JS code generator from elixir-estree for code generation, improving speed of transpilation
- the parse functions in the ElixirScript module have been renamed to transpile
- Enhancements
- Made the Tuple, Range and BitString data structures more immutable
- Now replacing characters that can't be used in variable and function names in JavaScript with
something that it (i.e.
match?->match__qmark__) - Implemented Integer module
- Atom now translates to an ES6 Symbol
- List now translates to a frozen JS Array
- Added iterators for Range and BitString
- Updated the pattern match binding to use ES6 destructuring for lists and tuples
- Inner modules are now split out into their own files
- Standard lib is now exported with file output from cli
- Standard lib modules are now automatically imported
- No longer have to define modules via aliases ahead of time. They will be automatically be resolved and made into JavaScript import statements
- Enhancements
- For statements now work with pattern matching tuples
- Improved function chaining
- added
fromclause toimport,alias, andrequireso that the import path can be overridden aliasnow acts likerequirein that it is translated into an import default statement- modules now export a default object with def functions added as properties on it.
- for function closures, now calling by using
.call(this)so thatthisis available inside of it
- Enhancements
- bitstrings
- Better Pattern Matching (Does not support bitstrings yet)
- Capture Operator
- Fixed multi arity implementation
- Updated variable implementation to match Elixir's (i.e. Reusing the same variable name creates a new one in the background)
- Throwing ParseError for SpecialForms currently not supported
- Added more functions from the list standard library
- Enhancements
- function and case guards
- function and case pattern matching
- Can now use ^ on a variable during assignment
- Enhancements
- Renamed project to ElixirScript
- Reduced escript file size
- Enhancements
- Pipe operator
- String interpolation
- Adding more functions to the Kernel module
- Now checking to see if a function is a Kernel function and prepending Kernel to it
- Now turning Atoms into an Atom javascript object instead of a Symbol
- Now turning tuples into a Tuple javascript object
- Fully implemented Tuple module
- Fully implemented Atom module
- Fully implemented Range module
- Can now call properties and zero parameter functions correctly
- case, cond, and if are now turned into if statements wrapped in function closures
- Anonymous functions are now turned into anonymous functions in javascript insteed of arrow functions
- Enhancements
-
From standard library implemented:
- Enum.map
- Kernel.tl
- Kernel.hd
- Logger
-
Implemented language features:
- All primitives except bitstrings
- defmodule
- import, alias, and require
- case, cond, if
- def, defp
- defstruct, defexception
- raise
- multiple arity functions
- basic binary operations
- for without into
-
Missing features:
- bitstrings
- pattern matching
- macros
- actors
- try
- regular expressions
- string interpolation
- Most of standard library
-