Skip to content

Commit f41b48b

Browse files
committed
Updated version and docs for release
1 parent af793b1 commit f41b48b

3 files changed

Lines changed: 20 additions & 30 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# v0.6.0-dev
1+
# v0.6.0
22
* Enhancements
33
* Made the Tuple, Range and BitString data structures more immutable
44
* Now replacing characters that can't be used in variable and function names in JavaScript with

README.md

Lines changed: 18 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -66,35 +66,25 @@ $ ex2js -h
6666

6767
#Limitations
6868

69-
#### Must define each module you are going to use upfront
70-
71-
In Elixir, you can use Modules in your code like so
69+
#### ~~Must define each module you are going to use upfront~~
70+
71+
Should now be able to use modules without having to alias them upfront. If you reference a module using it's full name, an alias will automatically be created for it. If an alias already exists, then it will use that one instead. It's still early so there may be some bugs.
72+
73+
Ex.
74+
75+
```elixir
76+
defmodule Hello do
77+
Lions.Tigers.Bears.oh_my(true)
78+
end
79+
```
80+
81+
will turn into this in JavaScript
82+
83+
```JavaScript
84+
import Bears from 'lions/tigers/bears';
85+
Bears.oh_my(true);
86+
```
7287

73-
```elixir
74-
defmodule MyModule do
75-
76-
def my_function() do
77-
Another.Module.their_function()
78-
end
79-
80-
end
81-
```
82-
83-
But in ElixirScript, you must explicitly say you are using the module
84-
85-
```elixir
86-
defmodule MyModule do
87-
alias Another.Module
88-
89-
def my_function() do
90-
Module.their_function()
91-
end
92-
93-
end
94-
95-
```
96-
97-
This is because each module is converted into an ES6 module and `import`, `alias`, and `require` are turned into ES6 import statements. This would also be how you would import third-party JavaScript modules. The only exception is that the standard library or any JavaScript that is global in scope. For instance, the standard library currently is expected to be in the global scope so that you can use it without importing it.
9888

9989
#### Not all of the Kernel.SpecialForms module is defined
10090

mix.exs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ defmodule ElixirScript.Mixfile do
44
def project do
55
[
66
app: :elixir_script,
7-
version: "0.6.0-dev",
7+
version: "0.6.0",
88
elixir: "~> 1.0",
99
compilers: Mix.compilers,
1010
escript: escript_config,

0 commit comments

Comments
 (0)