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

CLJS Support #5

Open
IGJoshua opened this issue Mar 24, 2019 · 3 comments
Open

CLJS Support #5

IGJoshua opened this issue Mar 24, 2019 · 3 comments

Comments

@IGJoshua
Copy link
Collaborator

There's been some interest in getting a cljs version of the library working. It ideally shouldn't be too hard, since I should be able to get a replacement for gniazdo for websockets in cljs, and a different http library. Everything should be workable with just some compiler switches.

Currently I'm looking at https://github.com/r0man/cljs-http as a replacement for http-kit on the cljs build version of this.
Websockets is a little harder, since most seem to not follow anything close to the convention of gniazdo, most instead using async channels to represent the websocket connections. However, I tend to prefer that idea of how you handle websockets, so this could be integrated with an effort to do this for the clj version too.

@IGJoshua
Copy link
Collaborator Author

So I've looked into this a little more, this change seems like it won't be all-encompassing, the three things which need to be done for it to work is to write a CLJS replacement for agents and promises which uses core.async, replace the http library with one which works on both CLJ and CLJS, and to replace or supplament gniazdo with a websocket implementation which works on CLJS ans well as CLJ.

However, I don't consider this a high-priority item, and if other decisions later make this more challenging or impossible to do, I don't consider that a problem.

@misterzirillo
Copy link

Unless you've got some work in progress I'd love to take a stab at this.

I think the best way to go is to use a core.async channel as an abstraction for the websocket connection, keep the existing clj implementation and add in a lightweight cljs client. I couldn't find a library that provides a client for both clj and cljs.

Thoughts?

@IGJoshua
Copy link
Collaborator Author

Yeah, that's definitely the way you'll probably need to go if you pick this up. The other thing to be aware of is that you'll need to make either an alternate implementation of the rate limiting on both the websocket and rest api side, or you'll need to implement agents using core.async.

I'd absolutely love it for someone to take a stab at it though, cljs really isn't my specialty so having someone else wanting to take a look at it is very helpful. :)

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

No branches or pull requests

2 participants