Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Hi I am starting to develop an experimental feature that will allow users to choose if they want to render documents using Ruby or Javascript implementation. But there is a problem with opal.js (the latest one from asciidoctor.js github repo) file when it is used in Rhino, but not in Nashorn.
Let me show the code: ScriptEngine scriptEngine = new ScriptEngineManager().getEngineByName("JavaScript"); SimpleScriptContext simpleScriptContext = new SimpleScriptContext(); Bindings bindings = scriptEngine.createBindings(); simpleScriptContext.setBindings(bindings, ScriptContext.ENGINE_SCOPE); try { scriptEngine.eval(new InputStreamReader(JavaScriptAsciidoctorModule.class.getResourceAsStream("/org/asciidoctor/experimental/js/opal.js"))); } catch (ScriptException e) { throw new IllegalArgumentException(e); } If I run in Nashorn Opal.js file is loaded correctly but if I try with Rhino: Caused by: javax.script.ScriptException: sun.org.mozilla.javascript.internal.EvaluatorException: missing ) after argument list (<Unknown source>#2976) in <Unknown source> at line number 2976 at com.sun.script.javascript.RhinoScriptEngine.eval(RhinoScriptEngine.java:156) at javax.script.AbstractScriptEngine.eval(AbstractScriptEngine.java:232) at org.asciidoctor.experimental.js.JavaScriptAsciidoctorModule.convert(JavaScriptAsciidoctorModule.java:30) ... 24 more I inspected that line and all seems correct. So the first thing is if you see something wrong on it. And the second one is the next question. Because we are compiling with JDK6 and updating to Java8 could be a problem for a lot of users, if we don't find a solution do you think we could release two artifacts on for prior Java8 and another one for Java8? I don't like the idea of having two branches of the same project but do you think there is any other alternative? Maybe create a new brand project called AsciidoctorJJs don't like anyway. WDYT? |
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 Do you need to make a lot of adjustments, or is it just the compiler? -----BEGIN PGP SIGNATURE----- Version: OpenPGP.js v0.6.1-dev Comment: http://openpgpjs.org wsFcBAEBCAAQBQJTtaVbCRC+38+zD7ctEQAAc+0P/ji7aeuWm5eLbgS2+uRg TVv24UlEq9rjydERJoC9xR02SHVAqRhf/0gnZSUEf63i9xpRei8uKGL8bjiR NLBwqNK6SMJZVtge2lf9WYjtWeMFR5ZAX6R+fJ2F/EBTTvoaWKdF8XUNW4n5 1RUnN3Lk8AKPINPfB0l6k2H4K2TpOo3h28aAeBP4IMtODVKBvBGSl4Nq0qCC 6jFmwl3EiGEXMPd8zHl0/twjgEvQE8xKR48TCAgE5QiwUnaHwhn3BYELyKRr FrrMCqD/rmcbga3wj4Yex7CEqqPrtjTnawjJNXGmbstic3oTHA/6rexK4hnk a55qS8X5qByAl6rnooGPE/tG5bukqiWcUSGyOnBupoD2I3opFfy3A3K90AD8 zl9I78KiNE56qxOrA7VrP9qCU/T2RVDYuYwgVaDvBtHOu/QOQPSG2YU7goYF 0h6OqneglWtzMH3CURY8VLpySkzotHoNIohkm4arl6/ZZcFF2i4E6x6fOhMl b5/cY/AmwGE0L8hDIThOSNrQRKTdvXIZ0EWrlRCYjTB/0+WeR+ldYyorjVDh 1OQvtdRyasWo0abItzGQxRDuLx0OqXWEnF9Thq/jUdDW/JdFHu9JrM9a5m9G WmoGrsqmafydDCn8Sudproo1jYaYSqW5RCcv+LGIUarLeYW70DutC2aQUnHM +pwt =yb46 -----END PGP SIGNATURE----- On Thu, Jul 3, 2014 at 12:16 PM, asotobu [via Asciidoctor :: Discussion] <[hidden email]> wrote: Hi I am starting to develop an experimental feature that will allow users to choose if they want to render documents using Ruby or Javascript implementation. But there is a problem with opal.js (the latest one from asciidoctor.js github repo) file when it is used in Rhino, but not in Nashorn. ... [show rest of quote] -- |
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Only compiler the code is just the same jsr based
El dijous, 3 juliol de 2014, LightGuardjp [via Asciidoctor :: Discussion] <[hidden email]> va escriure:
... [show rest of quote] -- Enviat amb Gmail Mobile |
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
If that's the case, then it's just another profile you run and build right? Not terrible.
—
Sent from Mailbox On Thu, Jul 3, 2014 at 1:34 PM, asotobu [via Asciidoctor :: Discussion] <[hidden email]> wrote:
... [show rest of quote] |
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Well the problem is that with rhino the test will fail :( and we would deal with two artifacts but yes of course it is not so terrible we have alternatives :)
El dijous, 3 juliol de 2014, LightGuardjp [via Asciidoctor :: Discussion] <[hidden email]> va escriure: If that's the case, then it's just another profile you run and build right? Not terrible. ... [show rest of quote] -- Enviat amb Gmail Mobile |
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Administrator
|
In reply to this post by asotobu
Alex, If I remember correctly from testing this myself, Rhino is not parsing JavaScript correctly in some cases (perhaps because JavaScript has moved forward, or it just never implemented certain syntax variants).
If you can figure out what it is about the syntax it doesn't like, we could see about getting this fixed upstream in Opal so that Opal generates JavaScript that Rhino can understand. However, my personal opinion is that we shouldn't support Rhino. It's an old engine, considered deprecated (by some?), and it's more heavyweight (as I understand it). While using Nashorn only does limit which JVM implementations people can use, I think that's a reasonable trade-off while this is very much an experimental feature.
Whenever we target platforms, it's important to understand that we do have to put some requirements in place that those platforms be compliant. Unless there's a good argument as to why Rhino is compliant, I'd say we just drop it. We can still leave room for a pluggable JavaScript implementation, we just won't support Rhino as one of those options.
wdyt? -Dan On Thu, Jul 3, 2014 at 12:15 PM, asotobu [via Asciidoctor :: Discussion] <[hidden email]> wrote: Hi I am starting to develop an experimental feature that will allow users to choose if they want to render documents using Ruby or Javascript implementation. But there is a problem with opal.js (the latest one from asciidoctor.js github repo) file when it is used in Rhino, but not in Nashorn. ... [show rest of quote] Dan Allen | http://google.com/profiles/dan.j.allen |
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
In reply to this post by asotobu
The line looks good to me. Maybe you can create a simple test case with that line and open an issue on Rhino project?
For the second question, you want to create a version with Nashorn backend (requires Java8) and a version without (requires Java6) ? I think it's possible to create two artifacts with Maven (classifier jdk6 / jdk8) and include / exclude the Nashorn part no? This will allow you to get everything in one branch. Guillaume. |
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
In reply to this post by mojavelinux
https://github.com/mozilla/rhino
Last commit more than a year ago. Rhino is a) very stable and mature b) dead :) Last commit on one file is 13 years old with message "massive reconfiguration of cvs" old school! |
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Administrator
|
I like the statement on the Wikipedia page the best: "When Netscape stopped work on "Javagator", as it was called, the Rhino project was finished as a JavaScript engine." Like a cat, Rhino has many lives...most of which have been spent :) -Dan
On Thu, Jul 3, 2014 at 4:11 PM, ggrossetie [via Asciidoctor :: Discussion] <[hidden email]> wrote: https://github.com/mozilla/rhino Dan Allen | http://google.com/profiles/dan.j.allen
|
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Yes I Rhino is dead but I tried to create a compatible solution. Well arrived at this point I will try to do some kind of
deployment of two artifacts from a profile so I can release both of them. I have almost done some integration but of course it would be experimental feature so it won't be completed at all (for example accessing do document structure), but of course this is the first part then for 1.6.0 I will try to make them compatible with extensions, document structure, ... and it will be in 1.6.X or 1.7.0 that I will move the experimental part to core. |
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Administrator
|
On Fri, Jul 4, 2014 at 12:56 AM, asotobu [via Asciidoctor :: Discussion] <[hidden email]> wrote: I have almost done some integration but of course it would be experimental feature so it won't be completed at all (for example accessing do document structure), but of course this is the first part then for 1.6.0 I will try to make them compatible with extensions, document structure, ... and it will be in 1.6.X or 1.7.0 that I will move the experimental part to core. Awesome work, Alex! I'm really excited to try it out. |
Free forum by Nabble | Edit this page |