If I try to use ember script with EmberCLI (which uses ES6 style import modules) it doesn't work anymore (e.g. with EmberCLI 0.37).
This problem is always reproducible when using ES6 because of the lack of global namespaces. Now Ember is not globally available so I have to import it (import Ember from "ember"
).
The problem is that the substitution of import Ember from "ember"
is after the generated getters and setters generated lines, so I always get the TypeError: undefined Ember
in any project using both EmberScript and ES6.
I think that the problem is more generic because somehow the EmberScript compiler is twisting the rows (which is generally bad).
As a programmer if I write
`import Ember from "ember"`
class IndexRoute extends Ember.Route
I expect that the import thing happens before the class definition thing.
Instead, this is what has been generated:
var IndexRoute;
var get$ = Ember.get;
var set$ = Ember.set;
import Ember from "ember";
IndexRoute = Ember.Route.extend();
export default IndexRoute;
As you can see the fourth line should happen before to the first three lines, in order to have the same semantics has the EmberScript defined code.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4