This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-07-21
Channels
- # admin-announcements (4)
- # beginners (41)
- # boot (46)
- # cider (8)
- # clojure (132)
- # clojure-austin (15)
- # clojure-belgium (3)
- # clojure-greece (3)
- # clojure-hk (1)
- # clojure-mexico (4)
- # clojure-quebec (5)
- # clojure-russia (46)
- # clojure-spec (225)
- # clojure-taiwan (1)
- # clojure-uk (17)
- # clojurescript (46)
- # clojurewerkz (1)
- # core-async (28)
- # cursive (9)
- # datascript (3)
- # datomic (5)
- # defnpodcast (42)
- # devcards (60)
- # emacs (27)
- # hoplon (7)
- # lein-figwheel (5)
- # leiningen (12)
- # mount (8)
- # om (13)
- # play-clj (2)
- # reagent (47)
- # rethinkdb (5)
- # ring-swagger (7)
- # spacemacs (9)
- # specter (12)
- # testing (1)
- # untangled (1)
- # vim (11)
- # yada (31)
@bhauman: I've discovered something a little strange with Figwheel, and it's why Vim-Fireplace was breaking.
When figwheel is started within a session, and given an id, (e.g. 'abc123'). When figwheel is told to do (println 1)
with an id of 'def456' it writes the *out*
to 'abc123', not 'def456'. This behaviour is different than that of boot-cljs-repl
and "normal" nrepl
.
I can have a go at digging into this, but I wanted to know your opinion first.
---
I have a python script which can demonstrate the issue, but it needs a little refining first.
@dominicm: https://github.com/clojure/clojurescript/blob/master/src/main/clojure/cljs/build/api.clj#L198
https://github.com/bhauman/lein-figwheel/blob/master/sidecar/src/figwheel_sidecar/repl.clj#L254
It is; I'm able to interact with the dropdown
However the functionality isn't working
@nnbosko: i don’t know enough about semantic ui to be able to help. here’s a suggestion: try to reproduce the issue in minimal amount of code without reagent etc.
@bhauman: Looking through the tools.nrepl and your code: The out binding changes between requests normally. Because you sit on the same thread, you don't have the new out being set for that id. This is why figwheel is not working with ids, I think. I'm not sure how to solve this exactly, maybe the channel should pass around the current out for processing.
It is an easy part of the spec to miss 😃 it took me some hunting to find it, and it was the last thing I thought to try.
I will have to capture the *out*
when evaluate is called and use it for any output that comes back from the client
@dominicm: so this has worked for me quite a while, so in my workflow using nrepl and cider there is a stable output stream, why are you getting a new output stream on every request?
@bhauman: This was the design that fireplace selected. I think the id was designed for synchronous workflows like those imposed on vim. I think cider has an alternative, where it does a persistent streaming. I only learned this recently, and may be false. An alternative use case would be where a client wants to know the output of only the code evaluated.
Hmm, tools.nrepl suggested ids were the way to do the alternative case. You may have multiple async threads running in the same session, but with different ids. You can use the id to filter the responses.
@dominicm: https://github.com/bhauman/lein-figwheel/commit/09fd6eaa537f913cb16ff8f806212a426a3e74ba
I just fixed it because it was obvious and if I put it off I would have forgotten the particulars
@bhauman: Looks like that fix didn't work or there is another problem. We'll continue investigating.
wondering what tools people are using currently for unit testing / integration testing using cljs and a react wrapper like om or reagent?
@mattsfrey: I'm pretty much using devcards for all my testing now
@mattsfrey: I’ve used clj-webdriver with reasonable success in the past along with devcards for tests and simple UI prototyping. https://github.com/semperos/clj-webdriver
I’ve set up Figwheel to run all my cljs unit tests upon reload. Output goes to the browser console
In my cljs main, when I call figwheel.client/watch-and-reload
I set :jsload-callback
to call cljs.test/run-all-tests
. Works well, though I don’t have a huge number of tests yet.
@bhauman: Seeing this:
>> {'code': '(println :second-message-5)', 'op': 'eval', 'id': 'prefix-1469082218-5', 'session': 'd23b0b41-3393-4f10-95ec-79a8e6cfba85'}
<< [{}, 'id', 'prefix-1469082218-4', 'repl-type', 'clj', 'session', 'd23b0b41-3393-4f10-95ec-79a8e6cfba85', 'status', ['state'], None, {'out': ':second-message-5\n', 'id': 'prefix-1469082218-3', 'session': 'd23b0b41-3393-4f10-95ec-79a8e6cfba85'}, {'ns': 'cljs.user', 'value': 'nil', 'id': 'prefix-1469082218-5', 'session': 'd23b0b41-3393-4f10-95ec-79a8e6cfba85'}, {'status': ['done'], 'id': 'prefix-1469082218-5', 'session': 'd23b0b41-3393-4f10-95ec-79a8e6cfba85'}]
Where the session d23b0b41-3393-4f10-95ec-79a8e6cfba85
was created in id prefix-1469082218-3
and was where I originally ran the figwheel/cljs-repl
code.