This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2015-08-27
Channels
- # admin-announcements (42)
- # aws (15)
- # beginners (8)
- # boot (102)
- # cider (7)
- # clojure (141)
- # clojure-italy (10)
- # clojure-japan (4)
- # clojure-russia (26)
- # clojure-seattle (1)
- # clojurescript (239)
- # core-matrix (13)
- # cursive (19)
- # datascript (54)
- # datomic (21)
- # editors (2)
- # events (1)
- # hoplon (125)
- # instaparse (10)
- # jobs (3)
- # ldnclj (13)
- # ldnproclodo (1)
- # om (1)
- # onyx (2)
- # rdf (206)
- # re-frame (30)
- # reagent (7)
- # yada (4)
what's going on if i get this from a hoplon (page ...)
?
clojure.lang.ExceptionInfo: No reader function for tag js
@onetom: looks related to https://github.com/boot-clj/boot/issues/47
there is a boot.core/load-data-readers!
function, perhaps it needs to be strategically called?
I getting this error in the https://github.com/exicon/foreign-lib-with-cljs-init repo which is a super minimalistic repo. it doesn't have datomic, doesn't have boot-reload, nothing fancy, but the latest (boot-)hoplon. I hit this issue sevaral times in the past 2 weeks but I was always lazy to track it down.
data: {#object[clojure.lang.Keyword 0x38105db8 ":type"] #object[clojure.lang.Keyword 0x4ffa1257 ":reader-exception"]}
clojure.core/ex-info core.clj: 4593
clojure.tools.reader.reader-types/reader-error reader_types.clj: 330
...
clojure.tools.reader/read-string reader.clj: 788
tailrecursion.boot-hoplon.util/read-string util.clj: 31
tailrecursion.boot-hoplon.compiler/as-forms compiler.clj: 46
tailrecursion.boot-hoplon.compiler/compile-string compiler.clj: 112
...
clojure.core/apply core.clj: 632
tailrecursion.boot-hoplon.compiler/compile-file compiler.clj: 124
...
tailrecursion.boot-hoplon.impl/hoplon impl.clj: 46
...
clojure.core/apply core.clj: 630
boot.pod/eval-fn-call pod.clj: 184
boot.pod/call-in* pod.clj: 191
...
boot.pod/call-in* pod.clj: 194
tailrecursion.boot-hoplon/eval374/fn/fn/fn boot_hoplon.clj: 81
cljsjs.boot-cljsjs/eval778/fn/fn/fn boot_cljsjs.clj: 30
pandeiro.boot-http/eval480/fn/fn/fn boot_http.clj: 71
...
clojure.core/binding-conveyor-fn/fn core.clj: 1916
i hope that brings some speed up too, because i was just working on our boot1/hoplon5 homepage today (hopefully for the last time) and it was compiling like lightning compared to boot2/hoplon6...
sure, yet the old one was noticeably/obviously faster and when it comes to recompilations, then it was comparable to the cljs compilation time
but i was working on the layout namespace which ~15 other hoplon pages depended on, so all of them were recompiled every time...
wait you're saying it's taking longer for hoplon to generate cljs namespace than it does for cljs to compiler them?
with newer versions of cljs hoplon compiler is still fast to generate cljs namespaces, but it takes the cljs compiler a long time to recompile them
it's possible that the stuff we did to accomodate hot reloading of test namespaces could be slowing down the cljs compiler, too
but still it mostly bothers myself only really. my other 6 colleagues seem pretty enduring in this regard, so no worries
how can i produce attributes without a value, like: <script async src="...">
?
(script :async true)
produces <script async="async">
and i can see that in the code too,
but is there a way not to provide a value?
it's a purely aesthetic question though.
eg if i do this in js:
s = document.createElement("script"); s.async = true; s
i get
<script async></script>
i tried (script :async nil)
and (script :async "")
but none yields the "desired" result
That makes me sad, but if it makes things easier I'm for it. I only need the multiline thing, don't want to use haml for it.
And about compilation speed I saw this: https://twitter.com/nikitonsky/status/636192947168485376
i think i have something that could almost work, i have the basis implemented already as an instaparse grammar
We probably could have a task that only looks for something like multiline scripts and replaces it with the real clojure thing.
I had problems with lein cljsbuild and wouldn't trade reliability for speed, but if those measurements are precise it's a pretty big difference.
@mynomoto: that sounds ideal
since I don't see any better docs I went through the http://hoplon.io docs and have a couple of questions:
1) there's :on-click
and :do-class
used. Is there a list of available events and what they do?
2) why are all castra requests POST
? If you had a db and wanted to query it would you route it through castra? Wouldn't that be an example of a GET
request? (as you might tell from these questions I'm still not sure what is castra's use case.)
3) does one first check for errors when calling through rpc? The doc says the state cell is only updated when the request is successful
4) since state, error and loading are cells, does one usually just hook up some code on top of that with cell=
? This seems like you don't really need async channels and stuff like that
5) is there an example app like hoplon-minimal
from @mynomoto that includes a server?
or it could be a DOM element, since hoplon makes DOM elements into functions by implementing IFn
on them
the function application semantic on DOM elements denotes setAttribute
and appendChild
, as it does in HTML markup
like for instance only text nodes, comments, and elements can be children of a DOM element
it continues to iterate over all keyword/value pairs in the arglist until it gets to something that could be a child, like a DOM element or a string
for each attribute it can determine what to do by looking at the type of value associated with it
if it's not a function then the attribute is interpreted as either setting an attribute (in the case where the value is a string)
or if the value is a javelin cell it wires up the attribute reactively such that the attribute will be updated wenever the cell changes
when you do something like the button above, what actually happens is the on!
method is called on the element
if you haven't yourself defined a dispatch for :click
in the on!
multimethod it will end up here: https://github.com/tailrecursion/hoplon/blob/master/src/tailrecursion/hoplon.cljs#L560-L562
so to finally answer your question: the list of available events is the same as the list of available jQuery events
@xifi: about question 5) there is https://github.com/tailrecursion/hoplon-demos/tree/hoplon6/castra-simple
http://tmate.io and google hangouts or something