[x3d-public] JSweet translation of X3DJSAIL to JavaScript: need specific design goals first
John Carlson
yottzumm at gmail.com
Fri Apr 10 17:24:11 PDT 2020
On Tue, Mar 24, 2020 at 8:20 AM Don Brutzman wrote:
Authoring use-case environments are
> 1. Script inside X3D scene graph,
> 2. Script in outer HTML5 web page,
> 3. Standalone programmatic use in node.js
>
> Now get specific.
>
Not yet. We need to discuss the environments. X_ITE does inside X3D,
and with the addition of X_ITE_DOM, in outer HTML5. X3DOM does outer HTML5.
X3DJSAIL is a standalone library.
So what we really need is a standalone EAI for node.js without rendering
except to an encoding. Can we turn either X3DJSAIL, X_ITE or X3DOM into
such an environment? I provided a solution for Nashorn on top of X3DJSAIL,
but not a solution for node.js. Have we had any take up on the Nashorn
solution, enough to warrant a node.js solution?
So I would recommend that before researching all the various Transforms,
that we just try to develop a single Transform.js class for node.js, with
an encoding rendering. It will be throwaway code, just a proof of concept.
Suggestions for next steps are welcome, and I will review Don's email again
and see what he said.
For node.js, I believe there are packages that emulate the browser
enviroment, i think that jsdom (?) and xmldom are two popular ones, so we
can look at turning node.js into a headless browser. There are also ways
to run browsers in headless mode, PhantomJs comes to mind, but I haven't
researched this extensively.
There are environments for running Java and node.js together, as I
demonstrated with RunSaxon.java in X3DJSONLD. My approach for that was
simplistic, and won't really work for a multiclass approach. There is also
the java npm package that may lead towards a solution.
So a possible path forward is generating the glue code between node.js and
Java, similar to what we did for PyJNIus.
I suggest that we do a very simple single class solution, not unlike the
RunSaxon.java solution. This required various node.js files. I think the
new solution will be more complex to deal with the npm java peculiarities.
So this is throwaway code for now, just a single class.
Note that I have been stripping RunSaxon code out of my code, since I have
a XML to JSON solution.
What do you think?
John
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20200410/b2caf5bc/attachment.html>
More information about the x3d-public
mailing list