This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2015-12-27
Channels
- # admin-announcements (9)
- # aws (1)
- # beginners (4)
- # boot (197)
- # cider (38)
- # cljsrn (70)
- # clojure (128)
- # clojure-russia (36)
- # clojurecup (1)
- # clojurescript (86)
- # core-typed (2)
- # css (1)
- # datomic (35)
- # editors-rus (4)
- # hoplon (22)
- # ldnclj (2)
- # mount (19)
- # off-topic (45)
- # om (63)
- # onyx (7)
- # parinfer (8)
- # yada (2)
@jbaiter: was the code undergoing advanced compilation? and did you try it at the REPL?
Why is "doc" function lost after moving to another namespace after launching a CLJS REPL?
(ns something.core)
(doc anything)
(cljs.user/doc anything)
(ns cljs.user)
(doc anything)
so when you are in another namespace
you no longer have 'cljs.repl' required
which is the namespace the 'doc' function exists in
how is what possible?
crocket: it's just example, use any editor/plugin you like. johannjohann: and in clj it's different:
dmca-ui.server=> (doc map)
-------------------------
clojure.core/map
([f] [f coll] [f c1 c2] [f c1 c2 c3] [f c1 c2 c3 & colls])
Returns a lazy sequence consisting of the result of applying f to
the set of first items of each coll, followed by applying f to the
set of second items in each coll, until any one of the colls is
exhausted. Any remaining items in other colls are ignored. Function
f should accept number-of-colls arguments. Returns a transducer when
no collection is provided.
nil
dmca-ui.server=> (ns dmca-ui.ws-router)
nil
dmca-ui.ws-router=> (dmca-ui.server/doc map)
CompilerException java.lang.RuntimeException: No such var: dmca-ui.server/doc, compiling:(/tmp/form-init7902851373642829696.clj:1:1)
dmca-ui.ws-router=> (require '[dmca-ui.server :as ss])
nil
dmca-ui.ws-router=> (ss/doc map)
CompilerException java.lang.RuntimeException: No such var: ss/doc, compiling:(/tmp/form-init7902851373642829696.clj:1:1)
'doc' doesnt exist in those namespaces
it exists in clojure.repl in clj, cljs.repl in cljs
so check out
clojure.main/repl-requires
and you'll see the stuff that gets automagically required when you start a repl
heres the injection point in fireplace
i just grepped for it--knew the require stuff was getting injected just didnt know where
let me know if i can clarify anything crocket!
I figured out that auto-completion is broken on cider after moving to another namespace if cider is connected to figwheel via nREPL.
There's this - https://github.com/Day8/re-frame/wiki/Using-Stateful-JS-Components - but it's for reagent.
I think Clojurescript doesn't fully support use
- https://github.com/clojure/clojurescript/wiki/Differences-from-Clojure
Somewhat, and probably won't get all that much better, but it's certainly came a long way since a year or two.
@crocket: ClojureScript REPLs, by default, behave a lot like the Clojure REPL you get when running it from the JAR. Lein's Clojure REPL adds auto-complete, and Planck adds it as well, but it is not a base capability.
@crocket: after switching to a new namespace in the REPL, you should be able to (require-macros '[cljs.repl :refer [doc]])
Is the package listing missing from http://cljsjs.github.io/ ? Or is it just me?
Looking at the pages repo an automatic update was triggered an hour ago, probably that?
@crocket: in my case I put the docset you can download in .local/share/Zeal/Zeal/docsets/ClojureScript.docset/
looking for a good async http lib. CLJS wiki lists cljs-http, cljs-ajax, jeluard/happy.. can anyone recommend any other good one that I might be missing? easy integration with core.async is a huge plus.
@peterbak: You're looking for something to send messages to and from client/server?
anyone have any experience requiring amd foreign-libs with clojurescript? little shaky on my first principles about what seems to be going amok 😞
@peterbak: I'd look into https://github.com/ztellman/aleph or https://github.com/ptaoussanis/sente
Aleph would require some minor work in order to get the stuff into core async
@johannjohann: What are you trying to do
poking around module-rewriting stuff in the cljs compiler
i included an amd module to be included in a cljs build
but when the browser tries to load the file im getting a 'require is not defined' error
seems like theres a race condition with when i include my cljs code and when the require stuff is loaded
will look more closely at examples
@johannjohann: how are you doing this?
hi @jaen lemme garner a gist rn
@johannjohann: oh, sorry, I've missed the gist. This seems to look sensibly. I'm not sure about a race condition though - the :module-type
option means that the module will be translated to GClosure module, so it will be loaded exactly like the rest of your code, so this shouldn't exhibit any behaviours that wouldn't happen with the rest of your Clojurescript codebase, theoretically at least.