dojo / dojo/util

Build throws syntax errors for ES6+ code even when transforming back to ES3

Open
#89 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
60
Forks
104
PR merge metrics
No merged PRs in 30d

Description

Look like this is a recurring issue but I wanted to open this anyways.

for reference:
[Stack Overflow Question](https://stackoverflow.com/questions/38557290/dojo-build-systems-does-not-recognize-es6-syntax)
[Dojo Bug Ticket](https://bugs.dojotoolkit.org/ticket/19020#no1)

It is my understanding that by adding `optimizeOptions` with `languageIn`/`languageOut` (which are also defaulted) the Closure Compiler will transform the ES6+ code to an earlier version of ECMAScript.

When we do this, it looks like in the process of the build, there is a `util/build/transform/depsScan` to see if the module and its deps are "Pure AMD" BEFORE the transformation of langIn -> langOut happens.

Is it absolutely necessary to keep the order of the gates as is, or can we reorder them so that the transformation to ES5- happens first and then the AST `depsScan` happens next?

Is there a status on how to solve this issue? Or should I just live with all the console errors and ignore them since what is a syntax error is being transformed anyways?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.