Closed vansimke closed 7 years ago
@sindilevich, can you try it with this PR now?
@vansimke, looks much better. You want me check the transpilation too?
@sindilevich that would be great!
@vansimke, should I use optimizeOptions
like this:
optimizeOptions: {
languageIn: "ECMASCRIPT6",
languageOut: "ECMASCRIPT5"
}
Yep. Per the compiler's source code, the valid options are (comments included):
ECMASCRIPT3,
/**
* 90's JavaScript
*/
ECMASCRIPT3,
/**
* Traditional JavaScript
*/
ECMASCRIPT5,
/**
* Nitpicky, traditional JavaScript
*/
ECMASCRIPT5_STRICT,
/**
* Shiny new JavaScript
* @deprecated Use ECMASCRIPT_2015 with {@code isStrictModeInput == false}.
*/
@Deprecated
ECMASCRIPT6,
/**
* Nitpicky, shiny new JavaScript
* @deprecated Use ECMASCRIPT_2015 with {@code isStrictModeInput == true}.
*/
@Deprecated
ECMASCRIPT6_STRICT,
/** ECMAScript standard approved in 2015. */
ECMASCRIPT_2015,
/**
* A superset of ES6 which adds Typescript-style type declarations. Always strict.
*/
ECMASCRIPT6_TYPED,
/**
* @deprecated Use ECMASCRIPT_2016.
*/
@Deprecated
ECMASCRIPT7,
/**
* ECMAScript standard approved in 2016.
* Adds the exponent operator (**).
*/
ECMASCRIPT_2016,
/** @deprecated Use {@code ECMASCRIPT_NEXT} */
@Deprecated
ECMASCRIPT8,
/**
* ECMAScript latest draft standard.
*/
ECMASCRIPT_NEXT,
/**
* For languageOut only. The same language mode as the input.
*/
NO_TRANSPILE;
@vansimke, I don't understand how do I use this with dojo build, per Google's recommendation: Use ECMASCRIPT_2015 with {@code isStrictModeInput == false}
.
I don't think we support that right now. We'll have to use the deprecated value, which should work with this version of the compiler.
@vansimke, OK running the dojo build right now.
BTW, when you look on a Dojo build output is has a footer that summarizes errors and warnings, occurred with the build. The deal is it doesn't report any errors nor warnings that occur at the Google Closure Compiler's stage. And dojo itself has a lot of warnings at that stage.
@vansimke, made a function in one of a classes use the ES6 method definition syntax to check transpilation. Set optimizeOptions
as discussed. Now it throws the following: Missing externs definition for Symbol. Did you forget to include the ES6 externs?
. Any ideas?
@vansimke, using Dojo 1.12-rc4 that incorporates PR https://github.com/dojo/util/pull/57, in addition to your changes, I was able to successfully compile with the Java-driven build. It also allowed transpile ES6-specific code (method defintion syntax) to ES5.
This was landed in 477ef1d. Didn't show up because of the squash commit.
add handling for java build with closure compiler when optimizeOptions object is not defined in build profile