Releases: elixirscript/elixirscript
Release list
0.23.0
[0.23.0] - 2016-11-15
Added
-
New compiler pipeline
-
@on_js_load. Expects a 0 arity function. This function will be called when the compiled module is loaded in JavaScript -
JS.import\3. Just likeJS.import\2but expects options to decide if the import should be a default one or a namespace on. Only option allowed isdefault. Set totrueby default# translates to "import A from 'a'" JS.import A, "a" #translates to "import * as A from 'a'" JS.import A, "a", default: false
Removed
- The form of
JS.importthat accepted a list of atoms as the first arg. UsedJS.import\3withdefault: falseinstead to create a namespace import envandrootare no longer options forElixirScript's compile functions and cli- Syntax once supported by Elixirscript
JQuery.("#element"), is no longer supported
Changed
-
Changed CHANGELOG.md to adhere the format from Keep a Changelog
-
defmacronow supported. No longer have to separate macros from functions in separate files.defmacropstill unsupported -
To use anything in the
JSmodule, you mustrequiretheJSmodule first -
Elixirscript files must now contain valid Elixir syntax.
-
Now compiles
exjsandexfiles within the path can be compiled all the same. Dependencies from hex are still unsupported so these files must not rely on any code outside of the path. What this does mean is that it is now possible to share code between Elixir and Elixirscript as long as the Elixir files functionality fall within what Elixirscript currently supports. -
defgen,defgenp,yield,yield_to, andobjectare now in theJSmodule -
To access functions in the global JavaScript scope, either use
JS.global\0or use the erlang module call syntax#calling alert JS.global().alert("hi") #calling alert :window.alert("hi")
Calling JavaScript modules in the global scope works without using the above methods
#calls window.Date.now() Date.now()
0.22.0
- 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
0.21.0
v0.21.0
- 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
0.20.0
0.19.0
0.18.0
- Enhancements
- Better support for macros. Macros should be defined in
.exor.exsfiles. ElixirScript code should be in.exjsfiles
- Better support for macros. Macros should be defined in
- Breaking
- The above functionality will cause either compiler errors or no output. Please change extensions of ElixirScript code to
.exjs
- The above functionality will cause either compiler errors or no output. Please change extensions of ElixirScript code to
- Deprecations
Html,View, andVDommodules will be removed in the next version as they can now be replicated using macros
0.17.0
- 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
- Incremental Compilation:
- Breaking
- Removed
--coreoption from CLI and:corecompiler option. - Renamed
copy_core_to_destinationtocopy_stdlib_to_destination
- Removed
0.16.0
- 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.
0.15.2
0.15.1
- 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