dojo / util Goto Github PK
View Code? Open in Web Editor NEWDojo 1 - build utilities. Please submit bugs to https://bugs.dojotoolkit.org/
Home Page: https://dojotoolkit.org/
License: Other
Dojo 1 - build utilities. Please submit bugs to https://bugs.dojotoolkit.org/
Home Page: https://dojotoolkit.org/
License: Other
When installing dojo/util via bower, I receive the error "Package dijit-themes not found". See below
$ bower install --save dojo/util
bower util#* cached https://github.com/dojo/util.git#1.16.3
bower util#* validate 1.16.3 against https://github.com/dojo/util.git#*
bower dojox#1.16.3 cached https://github.com/dojo/dojox.git#1.16.3
bower dojox#1.16.3 validate 1.16.3 against https://github.com/dojo/dojox.git#1.16.3
bower dijit-themes#1.15.0-pre ENOTFOUND Package dijit-themes not found
Look like this is a recurring issue but I wanted to open this anyways.
for reference:
Stack Overflow Question
Dojo Bug Ticket
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?
In 1.16.2
-> 1.16.3
, the closure compiler was updated.
1.16.2
jand@Desjani:pictoperfect-buildenv>java -jar src/uiBuild/yymmdd-HHMM/lib/util/closureCompiler/compiler.jar --version
Closure Compiler (http://github.com/google/closure-compiler)
Version: v20160911
Built on: 2016-09-13 16:51
1.16.3
jand@Desjani:pictoperfect-buildenv>java -jar src/uiBuild/yymmdd-HHMM/lib/util/closureCompiler/compiler.jar --version
Closure Compiler (http://github.com/google/closure-compiler)
Version: v20200112
Built on: 2020-01-13 22:21
That's quite a jump, of over 3 years.
A new build, created with util [email protected]
, fails on legacy infrastructure.
The reason is that the closure compiler outputs a more modern version of JavaScript. As an example, 1.16.3
outputs shorthand property names:
c.definitions = {
Math,
window,
global: window,
module: k.selfResolving(function(a, b) {
…
where 1.16.2
does not:
root.definitions = {
…
Math: Math,
window: window,
global: window,
module: expression.selfResolving(function(mid, lazy){
As far as I know, shorthand property names are an ECMAScript 2015 feature.
From the closure compiler release notes, I learn that a command line property --language_out
was added in release
The release notes for v20170806
say
August 6, 2017 (v20170806)
…
ECMASCRIPT_2017 is now the default language mode.
…
The output language defaults to ES5 instead of to the input language.
…
The release notes for v20170806
say
August 5, 2018 (v20180805)
You can now specify STABLE for input and/or output language level to request the latest version of JavaScript that is fully supported by the compiler. Currently, this means ES_2017 for input and ES5 for output.
I can find no other references to changes in the output language level in the release notes, so I need to assume that it is
still (intended to be) ES5. So either this is wrong, or the dojo build system is actively requesting another output language level. I cannot find prove of this. Yet, experiments show that the new setup by default generates at least ECMASCRIPT_2015
.
The more recent closure compiler supports a --language_out
command line property;
v20200112
--help
says:
--language_out VAL : Sets the language spec to which
output should conform. Options:
ECMASCRIPT3, ECMASCRIPT5, ECMASCRIPT5_
STRICT, ECMASCRIPT_2015, ECMASCRIPT_20
16, ECMASCRIPT_2017, ECMASCRIPT_2018,
ECMASCRIPT_2019, STABLE
After much searching, I found out that we can add a optimizeOptions
property to our build profile build.profile.js
:
…
mini: true,
optimize: "closure",
layerOptimize: "closure",
optimizeOptions: {
languageOut: "ECMASCRIPT3"
},
stripConsole: "normal",
…
that generates a working build.
languageOut: "ECMASCRIPT5"
generated a build that does not work, so it seems that 1.16.2
-> 1.16.3
does a jump from ECMASCRIPT3
to ECMASCRIPT_2015
or later.
The use of optimizeOptions
in the build profile is not documented. But, in our build process at least, it is copied into bc
, which is included from util/build/buildControl.js
, which is used in util/build/transforms/optimizer/sendJob.js
which calls util/build/optimizeRunner.js
, where it is used as command line argument in the runJava
call.
This is quite a jump for a patch version 1.16.2
-> 1.16.3
.
I suggest
1.16.4
where
--languageOut
parameter passed to the closure compiler defaults to "ECMASCRIPT3"
(by adding it in util/build/buildControlBase.js
, which would then be used both by util/build/transforms/optimizer/sendJob.js
and util/build/transforms/optimizer/closure.js
); alternatively, we can try to use the closure compiler option --browser_featureset_year
optimizeOptions.languageOut
in the build profile is documented--languageOut
parameter passed to the closure compiler not earlier than 1.17
The CLDR shipped with dojo 1.16.3 is the version 30, if I'm correct.
The last version should be shipped.
Tried to build from CLDR 38 (following https://dojotoolkit.org/reference-guide/1.10/dojo/cldr.html) but there are some errors during the build process.
Ie:
Syntax error in C:\Users\username\Downloads\dojo-release-1.16.3-src\dojo\cldr\nls\de\number.js// generated from ldml/main/*.xml, xpath: ldml/numbers
and, the number.js for de is malformed:
....
'currencyFormat-short':"0 Mrd'.' ¤",
'currencyFormat-short':"0 Mrd'.' ¤",
'currencyFormat-short':"00 Mrd'.' ¤",
'currencyFormat-short':"00 Mrd'.' ¤",
'currencyFormat-short':"000 Mrd'.' ¤",
'currencyFormat-short':"000 Mrd'.' ¤",
'currencyFormat-short':"0 Bio'.' ¤",
'currencyFormat-short':"0 Bio'.' ¤",
'currencyFormat-short':"00 Bio'.' ¤",
'currencyFormat-short':"00 Bio'.' ¤",
'currencyFormat-short':"000 Bio'.' ¤",
'currencyFormat-short':"000 Bio'.' ¤"{0} Tag{0} Tage{0}. Abzweigung nach rechts nehmen… für {0} …… mit {0} …Anstatt {0} …{0} kostet (kosten) € 3,50.Die {0} ist …Der {0} ist …Das {0} ist …
})
In our product, we use the dojo build to deploy a number of layers, which are optimized using the closure compiler.
After updating to 1.17 we find that, while it does produce the .consoleStripped.js
and .uncompressed.js
output files, the actually optimized files are no longer generated.
Please note that we already (locally) upgraded the closureCompiler to version 20210601 to allow us to use the newer style JavaScript syntax. Just swapping the 1.17.3 version with this older version fixes the problem of the generated output files.
https://discourse.dojo.io/t/closure-compiler-strict-errors/456
As reported by yassam:
I’m using Dojo 1.16.0.
The Dojo build system is giving me INTERNAL COMPILER ERROR on my ES6 code. I figure this might be due to a buggy version of the Closure compiler shipped with Dojo, so I downloaded the latest version of the Closure compiler and I now get a bunch of errors in the dojo code itself.
It complains about dojo code not compiling in strict mode, even though I haven’t set strict mode.
Specifically, here’s the relevant part of my build profile:
layerOptimize: 'closure',
optimize: 'closure',
optimizeOptions: {
languageIn: 'ECMASCRIPT6',
languageOut: 'ECMASCRIPT5'
},
Note that the input language is ECMASCRIPT6 not ECMASCRIPT6_STRICT
Is there an easy way to get the latest version of the closure compiler to work?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.