Fork me on GitHub

is it possible to always have functions available in the cljs-repl? e.g. if I'd want (:require [cljs.repl :refer [doc]]) regardless of which ns I'm in

🎉 4

you can just call (cljs.repl/doc foo) from anywhere. having (doc foo) available does not work without you requiring it


okay, thanks. 🙂


Will fully qualified ns'es always work without requiering them in Cljs? This is not the case in Clj, right?


no. I was assuming that at some point in time (require 'cljs.repl) was done somewhere so that the ns is loaded


it won't work if it was not

Jakub HolĂ˝ (HolyJak)06:04:43

Hello! Why does this code from fail in shadow REPL?

(shadow/repl :main)
;=> [:selected :main]
(import 'goog.Uri)
;------ REPL Error while processing ---------------------------------------------
;(import 'goog.Uri)
;ExceptionInfo: ns* not supported (require, require-macros, import, import-macros, ... must be part of your ns form)
; (compiler.clj:95)
? OK, the error says I cannot use import, but why not / why does the page above (which, of course, is not about Shadow) talks about REPL? Is that a limitation of shadow REPL compared to vanilla cljs? (I can use the classes, just not import them)

David Pham07:04:23

Anyone managed to have pprint activated automatically in the repl as well?


for just pprint, in shadow-cljs.edn:

{:devtools {:repl-pprint true}}

David Pham20:04:51

Yeah... I tried but it doesn’t work with Cider.


@holyjak I just haven't implemented import since (require 'goog.Uri) does the same

đź‘Ť 4
Jakub HolĂ˝ (HolyJak)09:04:09

Thanks! I have misunderstood > :import for Closure classes (which are also namespaces, like goog.Uri) and enums as "use import for classes". Now I understand.


you can open a ticket so I don't forget it again. I personally just never use import so I keep forgetting to implement it properly

đź‘Ť 4
Jakub HolĂ˝ (HolyJak)13:04:02

BTW thanks for all your hard work and the amazing tool you have created!