dojo / util

Dojo 1 - build utilities. Please submit bugs to https://bugs.dojotoolkit.org/
https://dojotoolkit.org/
Other
60 stars 105 forks source link

Fix Java build failure when optimizeOptions not provided in profile #56

Closed vansimke closed 7 years ago

vansimke commented 7 years ago

add handling for java build with closure compiler when optimizeOptions object is not defined in build profile

vansimke commented 7 years ago

@sindilevich, can you try it with this PR now?

vansimke commented 7 years ago

Closed via https://github.com/dojo/util/commit/477ef1d509aef8a2fd308d01d90c18fb70e36ce1

sindilevich commented 7 years ago

@vansimke, looks much better. You want me check the transpilation too?

vansimke commented 7 years ago

@sindilevich that would be great!

sindilevich commented 7 years ago

@vansimke, should I use optimizeOptions like this:

optimizeOptions: {
languageIn: "ECMASCRIPT6",
languageOut: "ECMASCRIPT5"
}
vansimke commented 7 years ago

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;
sindilevich commented 7 years ago

@vansimke, I don't understand how do I use this with dojo build, per Google's recommendation: Use ECMASCRIPT_2015 with {@code isStrictModeInput == false}.

vansimke commented 7 years ago

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.

sindilevich commented 7 years ago

@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.

sindilevich commented 7 years ago

@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?

sindilevich commented 7 years ago

@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.

dylans commented 7 years ago

This was landed in 477ef1d. Didn't show up because of the squash commit.