Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Typescript? #89

Open
vestild opened this issue May 27, 2017 · 7 comments
Open

Typescript? #89

vestild opened this issue May 27, 2017 · 7 comments

Comments

@vestild
Copy link

vestild commented May 27, 2017

May be change language to typescript while code base is small?

@cblp
Copy link

cblp commented May 28, 2017

yes!

@gritzko
Copy link
Owner

gritzko commented May 28, 2017

I absolutely like the idea, except I am short of time.

@vestild
Copy link
Author

vestild commented May 28, 2017

Ok, I will start translation

@jhuiting
Copy link

@vestild Any updates on this? Would also be interested to see Swarm being ported to TypeScript, also willing to helping getting this done.

Off topic: really like the idea of swarm, exactly the level of abstraction I was looking for to start using CRDT's.

@gritzko
Copy link
Owner

gritzko commented Jul 30, 2017

Hi @jhuiting !
Here is the core package of the 2.0 version https://github.com/gritzko/swarm-ron
Currently, it is ES6.
The hourglass-waist interface is RON frames. The next big thing I will try there is possibly migrating it from strings to typed arrays to make those immutable frames cheaper to iterate on (less gc strain).
I believe, TypeScript should live higher up the chain, at the API tier (i.e. it is a mapper: RON -> objects).
It does not make much sense to introduce TypeScript into the core tier.

Hence, someone should design that TypeScript API package: objects on the outside, RON frames inside and on the wire. Named swarm-api-ts maybe.

@gritzko
Copy link
Owner

gritzko commented Jul 30, 2017

@cblp @vestild @jhuiting @andreypopp So, guys, in case you have any ideas on that RON-to-objects API, please share now. MVC-ish? Redux-ish? GraphQL-ish? What are your personal experiences with those technologies?
Physically, you get a bunch of RON frames from the server. Incremental updates will follow up in real time. How would you expose that in your dream API?

@jhuiting
Copy link

jhuiting commented Aug 5, 2017

@gritzko That makes sense, the RON frames and all core seems to be low level indeed so TS wouldn't add much there. I've worked with MVC for quite a while (BackboneJS, and a bunch of server-side frameworks) and have some experience with Redux. I'm not sure if GraphQL fit's here, I would expect that at a different abstraction level (e.g. an endpoint that exposes operations on the objects).

One option that's not mentioned is Mobx, we're using that at Mendix for an extensive, typed SDK that sends deltas over HTTP in the background (Mobx is originally built by a colleague for that purpose). So the end-user is just modifying objects, and everything they do in there is typed. The JS SDK (not the TS sources) are available on NPM if you want to have a quick peek. I'm happy to explain it in more detail if anyone finds it relevant/interesting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants