> On 16 Jul 2017, at 21:00, Siemen Baader <[email protected]> wrote: > > Hi all, > > I’m trying to transpile the STON class to JavaScript with PharoJS to use it > in a client side web application. The goal is it to retrieve object(graphs) > from the server and deserialize them in the frontend via xhr. > > But PharoJS doesn't support thisContext, I think that's a limitation of the > JavaScript VM. PharoJS raises "PjJavascriptTranspilationError - thisContext > not supported. Found in Collection >> #toBraceStack:". I tried to add the > <pharoJsSkip> pragma to the method in the hope that it will not be needed for > my uses, but no luck. > > Is the use of thisContext needed in STON, can I avoid it? I had hoped to use > STON because it is simple and well documented and unlike JSON handles object > graphs and classes. > > What are my options?
I don't know about PharoJS so I can't comment. The coolest option would be for someone to implement STON in JavaScript directly, it should be doable, but requires good JS skills. > Alternatively, what else could I use to serialize objects? I'm already using > Voyage & Mongo on the backend which deal with JSON internally, and I think > Moose also has a serialization component. Using a JS library in the frontend > is also an option if there is a Pharo implementation for its format as well. > > Thanks, > Siemen
