This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-08-12
Channels
- # beginners (49)
- # boot (2)
- # cider (62)
- # clara (3)
- # cljdoc (5)
- # cljs-dev (7)
- # cljsrn (2)
- # clojure (68)
- # clojure-spec (23)
- # clojure-uk (4)
- # clojurescript (172)
- # conf-proposals (8)
- # core-async (1)
- # cursive (1)
- # datomic (12)
- # duct (1)
- # figwheel (22)
- # figwheel-main (11)
- # fulcro (23)
- # hoplon (9)
- # jobs-discuss (13)
- # lambdaisland (3)
- # lein-figwheel (119)
- # off-topic (43)
- # onyx (1)
- # re-frame (18)
- # ring (1)
- # shadow-cljs (120)
- # tools-deps (4)
@bhauman as I can see the figwheel-main doesn't have that issue
I will check what is comming to the read fn
@bhauman I think that this is because in figwheel main you are using cljs data readers in figwheel-main/src/figwheel/main/evalback.cljc
It's a problem with my understanding then
I will try to investigate it further then
this is where it comes in https://github.com/bhauman/figwheel-repl/blob/master/src/figwheel/repl.cljc#L693
@kwcharllie379 thanks for taking the time to try and understand this
Yes you do
But the problem is that I'm just the noob. Trying to wrap my head around all that code.
I think I will do this and I really appreciate your help
Trying to search through the regular figwheel to see where the figwheel-repl is
Ok may I ask some questions please?
OK so the client is emacs or browser which sends the form to the figwheel-repl which responds with the result of the evaluation back to the client. Do I understand that correctly?
As I can see the regular figwheel does not depend on figwheel-repl or I cannot see that ;( Therefore communication is slithly different there
Yes but as I said the problem only occurs in regular figwheel. Figwheel-main can get some different form then regular figwheel. Therefore the figwheel-main is able to parse it.
Maybe I will just compare the two forms
but if the problem is on the client side where the data is sent then maybe we can fix it most easiliy there?
I really like you 😛
This is the second time we have a conversation
and in this one I also felt like I was a little kid 😛
but it's good
I especially like that you help me understand all the magic in Clj world.
you'd be surprised how straight forward it is once you take the dive, but its really hard/impossible to learning everything at once especially from the CLJS side
I am thinking whether we should just fix the problem by slicing the string or we should take care to provide the same user experience as in figwheel-main.
Ok so the strategy is to: 1. Rebind the default-data-reader-fn to handle #js parts. 2. Then use it in the read-msg. 3. Ask you whether it's looking good 😛 4. Do PR and merge
Last question: As I can see https://github.com/bhauman/figwheel-repl/blob/master/src/figwheel/repl.cljc#L690 receives the message from the client (Node.js/Javascript/Cljs ecosystem). It could be already parsed by the client to regular map. But in regular figwheel I just receive the form which is not so easy to parse because I do not have the access to data-reader-fn from cljs?
It must be different somewhere
Ok I think I will just focus on solving that issue.
Thank you @bhauman
(binding [*read-eval* false
*default-data-reader-fn* (fn [tag res] res)]
(read-string data))
;(((((((
Very sad I'am 😄
May I please try to tell you how I understand that code?
So while reading the msg you take the tagged literal and throw it away. So you just receiving the safety string which might be then evaluated to the map.
ok so you got the map (data) and the tag 😛 and you ignore the tag
Ok so what was the difference in figwheel.main?
What was the problem?
Looking into the code I can see it's just pprints therefore the error does not look like an error.
This is what you're talking about?
Maybe this is what should be applied to the regular figwheel as well
To ensure consistency between two
PS: In future I will figure the solution by myself so the contribution will be count to me 😛
Yes I want 😛
https://github.com/clojure/clojurescript/blob/master/src/main/clojure/cljs/repl.cljc#L648
Mein God. Does not understand that code but I will 😛 Need 10 minutes of rest
the clojurescript repl wraps all forms with pr-str
except 'ns 'require 'require-macros etc
I'm back
Ok I see 😛
That was pleasure for me to take the lesson from you
I'm still going to mess with it a bit more and try to use clojure.tools.reader.edn/read-string instead as its safer
Last last question 🙂 Is it possible to somehow force the emacs to return to user.ns=> in figwheel-main after the code reloads? The problem is that the compilation succeeds but it does not return to user.ns=> and when I try to evaluate the (println "some-str") form then the result shows on the top of the repl while it should on the bottom.
Ok thanks 🙂 Of course I can switch to repl and just use enter but was looking for a moreprogrammatic way. Thank you one more time for the ride 😉 Have a nice day and see you around.