nrepl / weasel

ClojureScript browser REPL using WebSockets
The Unlicense
324 stars 35 forks source link

add callback to websocket-setup-env #65

Closed piranha closed 9 years ago

piranha commented 9 years ago

As mentioned in #63, I need to be able to determine a port where weasel is listening in order to connect there. What do you think of this approach?

tomjakubowski commented 9 years ago

Nice! I didn't know http-kit supported running on an arbitrary available port. That's good to know about.

LGTM, but I'd prefer to name it something better than init. If we (or someone) can't come up a better one I'll happily merge though.

piranha commented 9 years ago

Yeah, init was a fast one and I don't like it either. It was a callback initially, which also doesn't convey a lot of information. How about connection-hook?

tomjakubowski commented 9 years ago

Since the callback is called before the connection is accepted what do you think of pre-connect? It has a nice symmetry with on-connect et al. in the client.

piranha commented 9 years ago

I like that! Changed. :)

tomjakubowski commented 9 years ago

Thanks so much!

piranha commented 9 years ago

Tom, can you please make a release? :-) I really want to stop supporting my own forks of weasel and boot-cljs-repl, and if you release weasel, boot-cljs-repl can be fixed for everyone. :)

martinklepsch commented 9 years ago

That sounds great, fixing boot-cljs-repl as well has been long outstanding. :)

tomjakubowski commented 9 years ago

Will release 0.7.0 after work today.

tomjakubowski commented 9 years ago

0.7.0 is released. Thanks for reminding me.

piranha commented 9 years ago

Thanks! :)

defclass commented 9 years ago

Hi @piranha , I have one strange problem, when client connected ,the console will be blocked . The cursor can move , but can never evaluate forms any more.

user=> (require 'weasel.repl.websocket)
nil
user=> (cemerick.piggieback/cljs-repl
  #_=>         (weasel.repl.websocket/repl-env :ip "0.0.0.0" :port 9001))
<< started Weasel server on ws://0.0.0.0:9001 >>
<< waiting for client to connect ...  connected! >>

version is below

[weasel "0.7.0" :exclusions [org.clojure/clojurescript]]