Open hadriensz opened 5 years ago
(3) since ECMA6 appeared Oracle developed Nashhorn javascript engine. Is there a plan to support Nashhorn if it provides better ECMA6 support and more frequent updates than Rhino ?
Possibly worth updating, Nashhorn has now been removed from the JRE - http://openjdk.java.net/jeps/335.
Any clues on possible workaround for this issue or will there be a patch in the near future?
If i read
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules
and more specifically
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules#other_differences_between_modules_and_standard_scripts
correctly, it should be pretty straight forward to implement <script type="module">
and import
and export
.
The main differences will be in the scoping of individual JS files, which i assume is do-able?
I would help our project very much if this feature was added to HtmlUnit.
Any movement on this?
@scottpettyjohn sorry not really. Have done a lot of work on Rhino during the last months but there is much more to do. And please keep in mind that i'm doing all the stuff in my spare time.
There is a plan to be more independent from core-js and then try to use another more recent js engine. But this is only a plan - maybe i will start on this at the beginning of next year.
see #755
copy of stackoverflow question:
https://stackoverflow.com/questions/52240645/htmlunit-cannot-process-javascript-module?noredirect=1#comment91433014_52240645
To this question RBRi suggested :
Which I'm doing...
Justification (source : https://spring.io/understanding/javascript-modules, 2015)
Complete specification can be found here: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/export https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import
and is discussed here: https://hacks.mozilla.org/2015/08/es6-in-depth-modules/ http://exploringjs.com/es6/ch_modules.html
additionnal considerations:
(1) it should be considered whether to support only ECMA6 or also previous common module technologies such as Asynchronous Module Definition (AMD), node.js / CommonJS Modules or Universal Module Definition (UMD). All of there could be considered as de facto module standards
(2) maybe this issue / feature should be moved to core-js github community. It looks like support for modules (only AMD probably) is already implemented there but not ported to HTMLUnit
(3) since ECMA6 appeared Oracle developed Nashhorn javascript engine. Is there a plan to support Nashhorn if it provides better ECMA6 support and more frequent updates than Rhino ?