swimos / swim

Full stack application platform for building stateful microservices, streaming APIs, and real-time UIs
https://www.swimos.org
Apache License 2.0
488 stars 41 forks source link

swim.structure polyglot language bindings #12

Open c9r opened 5 years ago

c9r commented 5 years ago

Flesh out polyglot language bindings for the swim-structure Java library. The bindings are located in the swim-dynamic-structure Java library. The JavaScript bindings should be compatible with the @swim/structure TypeScript library. Make sure to bind static methods, in addition to instance methods.

Structure bindings

Expression bindings

Form bindings

ajay-gov commented 4 years ago

Item 1 is a Slot. This should work I think but maybe this is not what you want to do? assertEquals(context.eval("js", "record.getItem(1).stringValue().asString()"), "number"); assertEquals(context.eval("js", "record.getItem(1).key.numberValue()").asInt(), 78);

freyadyu commented 4 years ago

Hey Chris,

I committed my code with HostItem.java and ItemTypeSpec.java. I converted all methods in Item.java with corresponding functionalities in Item.ts, but I listed some left over questions I had while developing, we can sync when you in the office. At the meantime, I'll keep working on the rest of the list: