Yep, in-ns
is something "special" for ClojureScript. This, for example, doesn't work: (do (in-ns 'foo.bar))
iiuc, in-ns (if it exists for an implementation?) is typically faked by the repl and not available in one's cljs files. does that sound right? i was looking at shadow-cljs' repl implementation the other day and today i took a brief look at what i thought was lumo's. are you finding the same behavior you reported in shadow-cljs?
Yes, exactly the same. Indeed, I've tested the code on shadow-cljs first
i suppose them being consistent might be somewhat of a positive thing...
Yes it is π. But they are inconsistent on other issues: On shadow:
cljs.user=> (ns foo.bar (:require [clojure.string :as str]))
foo.bar=> str/upper-case
#object[clojure$string$upper_case]
foo.bar=> (ns foo.bar)
foo.bar=> str/upper-case
#object[clojure$string$upper_case]
On lumo:
cljs.user=> (ns foo.bar (:require [clojure.string :as str]))
foo.bar=> str/upper-case
#object[Function]
foo.bar=> (ns foo.bar)
foo.bar=> str/upper-case
β¬
WARNING: No such namespace: str, could not locate str.cljs, str.cljc, or JavaScript source providing "str" at line 1
β¬
WARNING: Use of undeclared Var str/upper-case at line 1
str is not defined
Hi all
does chlorine still support connecting to cljs REPL from shadow-cljs?
Yes, but you first need to conect to connect to a Clojure REPL, then use the command "Connect embedded ClojureScript"
The reason is that neither Figwheel nor Shadow-CLJS supports a "ClojureScript Socket REPL" like Lumo or Plank. The Socket they expose is a Clojure REPL
is it the commands that one gets from Ctrl+Shift+P ?
Yes, exactly π
To be precise, the command is Chlorine: Connect Embedded
I can see a
Chlorine: Connect Clojurescript socket REPL
but not connect embeddedYou first connect to a Clojure Socket REPL
Then the command should appear on the command pallete
ah
I have Chlorine REPL window now but I can't type into it
You type on the editor and use the commands "Evaluate Block", "Evaluate Top Block", and "Evaluate Selection" to run commands. Chlorine does not have a "REPL-Like interface"
Also, if you did connect a ClojureScript REPL, the package will only use the ClojureScript environment to evaluate .cljs
files. You can override it on the package's configuration
I see now that the REPL window prints results of blocks I evaluate in the source
thank you for your help and also thanks a lot for your efforts with chlorine
I really like how quick and simple it is to use
You're welcome! I hope you like it π.
I have not used Atom for a while but after listening to the Clojurescript podcast where you appeared I decided to have a look and I am glad I did π
π hi all, occasional/beginner user here, was just using Chlorine 0.2.2 in Atom 1.41.0 and I thought Iβd share a real quick experience report: 1. Overall, itβs feeling very very useful right now. 2. When an object of a class that has a very long name is output to the console, it pushes the tree of the object out of the console so I canβt really see the tree to browse the object.
Yes, this is a problem. I tried some approaches to solve it, but currently there's no easy solution. What I did want is to move that "arrow" to before the tag, but it's not really that easy to do without breaking the other renderers and/or complicating the code a lot.
What I did try to do is to add some CSS to solve this issue, but still didn't found anything satisfactory
I'm even thinking if it would not be a good idea to just add another arrow to the tagged literal, so instead of something like this:
#some-big-literal/some-big-code v [1 2]
1
2
I could render like:
v #some-big-literal/some-big-code [1 2]
v [1 2]
1
2
The problem being that you have to click on two arrows so you can see the sub-elements of the collection
(that may not even be a problem, maybe I'll try to hide this behavior in a feature-flag and collect feedbacks)
I think thatβd be fine
Thanks!
@mauricio.szabo i replicated what you showed for lumo -- may be it's actually recreating a namespace when doing (ns foo.bar). probably you know already, but fwiw:
cljs.user=> (ns foo.bar (:require [clojure.string :as str]))
nil
foo.bar=> str/upper-case
#object[Function]
foo.bar=> (in-ns 'cljs.user)
cljs.user=> (in-ns 'foo.bar)
foo.bar=> str/upper-case
#object[Function]