Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

buildControl: set default values for Closure languageIn/languageOut #83

Merged
merged 3 commits into from
Mar 20, 2021

Conversation

msssk
Copy link
Contributor

@msssk msssk commented Sep 11, 2020

The Google Closure Compiler has a default language output setting that may change by release. v20170806 changed the default output language to ECMASCRIPT5.

This PR adds a default values for languageIn (ECMASCRIPT_2017) and languageOut (ECMASCRIPT3) if the build tool is configured to use the Google Closure Compiler. These can be overridden in optimizeOptions in the build profile.

ECMASCRIPT_2017 is used for languageIn to allow existing code to continue working. With the addition of block scope in ES6 the Google Closure Compiler treats block-scoped functions as errors in pre-ES6 code.

Fixes #81

The Google Closure Compiler has a default language output setting that may
change by release. v20170806 changed the default output language to
ECMASCRIPT5.

This PR adds a default value of 'NO_TRANSPILE' if the build tool is configured
to use the Google Closure Compiler.
@msssk msssk changed the title buildControl: set default languageOut for Closure to 'NO_TRANSPILE' buildControl: set default values for Closure languageIn/languageOut Sep 14, 2020
bc.optimizeOptions = bc.optimizeOptions || {};
// ECMASCRIPT_2017 is necessary to avoid throwing errors on block-scoped functions
// https://github.com/google/closure-compiler/issues/3189
bc.optimizeOptions.languageIn = bc.optimizeOptions.languageIn || 'ECMASCRIPT_2017';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another option would be to upgrade Closure to v20201006 and use ECMASCRIPT_2020: https://github.com/google/closure-compiler/wiki/Releases#october-6-2020-v20201006

@dylans dylans merged commit 71f486a into dojo:master Mar 20, 2021
dylans pushed a commit that referenced this pull request Mar 20, 2021
)

* buildControl: set default languageOut for Closure to 'NO_TRANSPILE'

The Google Closure Compiler has a default language output setting that may
change by release. v20170806 changed the default output language to
ECMASCRIPT5.

This PR adds a default value of 'NO_TRANSPILE' if the build tool is configured
to use the Google Closure Compiler.

* Set default languageIn/languageOut to ECMASCRIPT3 to maintain previous behavior

* built tool: set default languageIn to ES2017

(cherry picked from commit 71f486a)
dylans pushed a commit that referenced this pull request Mar 20, 2021
)

* buildControl: set default languageOut for Closure to 'NO_TRANSPILE'

The Google Closure Compiler has a default language output setting that may
change by release. v20170806 changed the default output language to
ECMASCRIPT5.

This PR adds a default value of 'NO_TRANSPILE' if the build tool is configured
to use the Google Closure Compiler.

* Set default languageIn/languageOut to ECMASCRIPT3 to maintain previous behavior

* built tool: set default languageIn to ES2017

(cherry picked from commit 71f486a)
dylans pushed a commit that referenced this pull request Mar 20, 2021
)

* buildControl: set default languageOut for Closure to 'NO_TRANSPILE'

The Google Closure Compiler has a default language output setting that may
change by release. v20170806 changed the default output language to
ECMASCRIPT5.

This PR adds a default value of 'NO_TRANSPILE' if the build tool is configured
to use the Google Closure Compiler.

* Set default languageIn/languageOut to ECMASCRIPT3 to maintain previous behavior

* built tool: set default languageIn to ES2017

(cherry picked from commit 71f486a)
dylans pushed a commit that referenced this pull request Mar 20, 2021
)

* buildControl: set default languageOut for Closure to 'NO_TRANSPILE'

The Google Closure Compiler has a default language output setting that may
change by release. v20170806 changed the default output language to
ECMASCRIPT5.

This PR adds a default value of 'NO_TRANSPILE' if the build tool is configured
to use the Google Closure Compiler.

* Set default languageIn/languageOut to ECMASCRIPT3 to maintain previous behavior

* built tool: set default languageIn to ES2017

(cherry picked from commit 71f486a)
dylans pushed a commit that referenced this pull request Mar 20, 2021
)

* buildControl: set default languageOut for Closure to 'NO_TRANSPILE'

The Google Closure Compiler has a default language output setting that may
change by release. v20170806 changed the default output language to
ECMASCRIPT5.

This PR adds a default value of 'NO_TRANSPILE' if the build tool is configured
to use the Google Closure Compiler.

* Set default languageIn/languageOut to ECMASCRIPT3 to maintain previous behavior

* built tool: set default languageIn to ES2017

(cherry picked from commit 71f486a)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1.16.3 by default generates at least ECMAScript 2015, while it was ECMASCRIPT3 in 1.16.2 and earlier
3 participants