[x3d-public] JavaScript news from meeting with Don today.

John Carlson yottzumm at gmail.com
Mon May 25 18:31:40 PDT 2020


More news:

We are working on a dual implementation of nodejs-X3DJSAIL stylesheets and
serializers.  Specifically, the technology that binds a high level node.js
API on top of X3DJSAIL is called npm-java.  While some of our code works,
there is some that doesn't.

On github, you can follow many of our examples under:

https://github.com/coderextreme/X3DJSONLD/tree/master/src/main/node/net

the coderextreme/data folder contains code from my NodeSerializer.js, and
the x3djsonld/data folder is from my X3dToNodeJS.xslt (perhaps out of date).

Here are the results from running my abox example:

$ node net/coderextreme/data/abox.js
Warning: ../data/abox.new.x3d does not meet suggested X3D naming
conventions, continuing...
Warning: toFileX3D() is overwriting prior file ../data/abox.new.x3d

[ success ]

$ node net/x3djsonld/data/abox.js
abox execution self-validation test results: TypeError: meta.getName is not
a function

[ failure ???? didn't check for file ]

I'm asking Don to look into the X3dToNodeJS.xslt stylesheet.  Don installed
nodejs on his platform today, so perhaps we can get a little more headway
on this.

www.web3d.org/x3d/stylesheets/java/node/examples/abox.js

run like

node.exe abox.js

or
node.exe examples/abox.js

Thanks!

We'd like to provide at least one working nodejs environment, albiet one
that runs with X3DJSAIL for now. Other implementations such as a XML to
X_ITE SAI converter and ES6 are still experimental or unfinished.  Higher
priority items appear to be my DOM2JSONSerializer.js for the browser, and
the ProtoExpander.js debugging.  Would someone want an XML to X_ITE SAI
converter?   Just asking!

Thanks,

John

On Mon, May 25, 2020 at 7:50 PM John Carlson <yottzumm at gmail.com> wrote:

> 1.   We will only be promoting highly experimental use of a typesafe ES6
> API on the server, at least until we research minifying or client-side
> caching methods. 16MB is too large for downloads. Reducing the
> implementations in interface code may help.  We can also research
> interfaces with TypeScript.
>
> 2.  Don asked for examples of the ProtoExpander running. Note that 8 of
> these do not generate good JavaScript, with the script processor. I did not
> want to present JavaScript examples, because the API is extremely
> experimental, but here goes:
>
> Generated (run through protoexpander) examples are here:
>
> https://github.com/coderextreme/X3DJSONLD/tree/master/src/main/ppp
>
> the *.json file have been run  through the ProtoExpander (no Protos are
> present) and still contain the old script, I believe.  The *.js is expanded
> script, with major modifications.
>
> Here's the original source. Note the files in the ppp file are ones with
> Protos originally in them:
>
> https://github.com/coderextreme/X3DJSONLD/tree/master/src/main/data
>
> If you want try this yourself, use code similar to this script:
>
>
> https://github.com/coderextreme/X3DJSONLD/blob/master/src/main/shell/runppp.sh
>
>
> (use this script at your own risk--I don't know all the places it dumps
> files).
>
> Here's an experimental script with XML processing:
>
>
> https://github.com/coderextreme/X3DJSONLD/blob/master/src/main/node/CompleteXMLPrototypeExpander.js
>
>
> I haven't run this for a long time.
>
> Here's the ProtoPreProcessor file which runs the Proto Expander on a list
> of files:
>
>
> https://github.com/coderextreme/X3DJSONLD/blob/master/src/main/node/PPP.js
>
> Debugging is more helpful than "This doesn't work!"
>
> Here's my current version of the ProtoExpander:
>
>
> https://github.com/coderextreme/X3DJSONLD/blob/master/src/main/node/PrototypeExpander.js
>
> Thanks!
>
> John
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20200525/2075d1f5/attachment.html>


More information about the x3d-public mailing list