<div><div dir="auto">Re: synthesized app examples for ECMAScript 6 and VRMLScript; X3DJSONLD v2 for SAI.</div><div dir="auto"><br></div><div dir="auto"><a href="https://raw.githubusercontent.com/coderextreme/X3DJSONLD/master/src/main/node/net/ecma/data/JinLOA4.mjs" target="_blank">https://raw.githubusercontent.com/coderextreme/X3DJSONLD/master/src/main/node/net/ecma/data/JinLOA4.mjs</a></div><div dir="auto"><br></div><div dir="auto">Here’s what I’d like to do:</div><div dir="auto"><br></div><div dir="auto">1) Write a script to translate “new …” to JSON. Wrap property names in strings like JSON. Add @, #, - in front of keys as required by JSON (JavaScript will choke on these).</div><div dir="auto"><br></div><div dir="auto">2) convert JSON property names to standard SAI (createNode…a factory method)!</div><div dir="auto"><br></div><div dir="auto">That way, we can pass both JSON and ECMAScript to the same or similar processor…potentially X3DJSONLD. Or X3DJSONLD built on top of JavaScript SAI (with a new name, so I don’t get confused). X3DJSONLD really has little relationship to JSON anyway, we only use JSON for preprocessing into objects and values (potentially with JSON data structures in non-native JSON)</div><div dir="auto"><br></div><div dir="auto">And at the same time, use the .mjs files as JavaScript programs, no DOM intended.</div><div dir="auto"><br></div><div dir="auto">Here’s also an attempt in X_ITE’s VRMLscript, that is more in line with standard SAI:</div><div dir="auto"><div dir="auto"><br></div></div><div dir="auto"><div><a href="https://github.com/coderextreme/X3DJSONLD/blob/master/src/main/vrml/net/coderextreme/data/JinLOA4.js">https://github.com/coderextreme/X3DJSONLD/blob/master/src/main/vrml/net/coderextreme/data/JinLOA4.js</a></div><div dir="auto"><br></div><div dir="auto">I’m not saying this works yet, I’m looking for feedback.</div><div dir="auto"><br></div><div dir="auto">For VRMLscript, we could use proxies for validation. This is what discombobulates me. I’d like to use a setAttribute() method on the instances instead, for full encapsulation. I’m guessing Andreas’ DOM addition for X_ITE has been fully incorporated? I think adding get and set (ES6?) methods may avoid proxies and/or lots of inline validation.</div><div dir="auto"><br></div><div dir="auto">For me, it’s a lot easier to synthesize a lot of examples than write one by hand. I realize we need to specify such things, and the synthesizer goes into a test suite. Plus it gives us copy/paste features into the standard.</div><div dir="auto"><br></div><div dir="auto">If you’d like me to create a private repo to discuss such things, let me know.</div><div dir="auto"><br></div><div dir="auto">I guess what I’m trying to say is, we can use X3D JSON and a new version of X3DJSONLD.js built around SAI, not DOM.</div><div dir="auto"><br></div><div dir="auto">Thanks to Don to leading me in this direction, I’m not sure I got where I wanted to go! The gist of it is: 1) if necessary, create a new module converting JavaScript SAI to JSON 2) write a new module which takes JSON and creates an SAI scene.</div><div dir="auto"><br></div>John </div><div dir="auto"><br></div><div dir="auto"><br></div><div dir="auto"><br></div>
</div>