This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-01-16
Channels
- # beginners (115)
- # boot (13)
- # boot-dev (13)
- # chestnut (1)
- # cider (1)
- # clara (10)
- # cljs-dev (21)
- # cljsjs (1)
- # cljsrn (2)
- # clojure (120)
- # clojure-dusseldorf (2)
- # clojure-greece (13)
- # clojure-ireland (1)
- # clojure-italy (3)
- # clojure-nlp (3)
- # clojure-russia (2)
- # clojure-spec (13)
- # clojure-uk (82)
- # clojured (5)
- # clojurescript (47)
- # core-async (2)
- # core-logic (8)
- # cursive (45)
- # datomic (2)
- # editors (1)
- # emacs (39)
- # fulcro (166)
- # graphql (1)
- # hoplon (16)
- # keechma (5)
- # off-topic (202)
- # perun (4)
- # protorepl (7)
- # re-frame (28)
- # reagent (13)
- # ring (27)
- # ring-swagger (16)
- # rum (1)
- # shadow-cljs (25)
- # spacemacs (20)
- # sql (141)
- # yada (4)
db just doesn't get passed for ??? reasons {:event [:http/delete-contact!--success "7v13J9n" nil], :db nil}
<- cofx map
I used a reg-event-db
and didn't set a db so it was getting lost earlier in the chain
@deadghost these kinds of problems get caught nice and early if you create a spec for what's in app-db
and check it after every event handler has run:
https://github.com/Day8/re-frame/blob/master/examples/todomvc/src/todomvc/events.cljs#L25-L29
and https://github.com/Day8/re-frame/blob/master/examples/todomvc/src/todomvc/events.cljs#L58
and https://github.com/Day8/re-frame/blob/master/examples/todomvc/src/todomvc/events.cljs#L109
BTW, there is a #re-frame channel to reduce noise here
Hello, I have a single page web application with reagent and client side routes, but on first load website opening a noticeable slow. I have many cljs namespaces compiled in one file, so, is there any way to not download all namespaces at once and bound them with client side routes?
Also make sure you have done the basic steps to avoid loading too much - advanced minification and gzip
@eremec I have not yet used it, but this appears to be what you're looking for: https://clojurescript.org/news/2017-07-10-code-splitting
@ramblurr My first attempt would be to slurp the file and using inner-html in some manner, I think.
what are some cons to building a large website using cljs (and using e.g. macchiato?)
the tooling and development workflow around cljs is more fragile and less mature than jvm clojure, and a node http server running cljs code will require more hardware resources for equivalent performance to a java process running clojure code
or maybe a clearer way to put it: less developer convenience and more hardware costs
gotcha. that makes sense @noisesmith and matches my experiences
there’s a push on my team to use AWS Lambda and so I’m trying to figure out how that affects the value prop of JVM vs Node.js
@lilactown there was a great, detailed comparison of using jvm clojure vs. node clojure in aws lambda in the last clojure/west
complete with a four way graph (latency vs. cpu usage / jvm vs. node) where he showed with measurements that if you need low latency and also your task is low load, node wins, but for all other combinations (including low latency plus high CPU usage) jvm clojure wins
@lilactown link to the vid (directly to the slide I mention) - the whole thing is worth watching though https://youtu.be/GINI0T8FPD4?t=44m16s
(chart isn’t exactly as I remember it, but the important information is all there)
all that said, if you need to do a specific thing that’s easy in node but hard to do on the jvm, that might be a deciding factor
I hear rum has much better integration of server rendering fwiw (I have not used rum so this is hearsay)
I tried Rum, but some pretty serious bugs and the ability to use re-frame drove me to choose Reagent instead
@lilactown What bugs?
rum is very cool but i'm by default quite skeptical of api's that are heavy macros, which can be very fragile
@ajs but the alternative is reagent, which does a ton of manipulation of the react api and has lots of weird gotchas
with either, you'd have to spend quite some time getting familiar to their quirks; reagent is certainly far more widely used, which offers some stability from widespread usage/reports
I'm curious, how is it possible for there to be a string literal in my code, but that literal does not appear in the advanced optimized build. Many of the literals do show up in the compiled output, but some do not, even though those literals appear on the web page itself.
Do advanced optimizations sometimes transform a string literal in a way that makes it unreadable in the source but still actually present?
it got optimized away?
perhaps it is dead code
How could it be dead or optimized away if the string literal appears on the screen of the running app?
has anyone ever seen this error?
clojure.lang.PersistentList cannot be cast to clojure.lang.Named
---- Exception Stack Trace ----
java.lang.ClassCastException: clojure.lang.PersistentList cannot be cast to clojure.lang.Named
at clojure.core$name.invokeStatic (core.clj:1587)
clojure.core$name.invoke (core.clj:1581)
figwheel_sidecar.build_middleware.notifications$make_sendable_file.invokeStatic (notifications.clj:81)
figwheel_sidecar.build_middleware.notifications$make_sendable_file.invoke (notifications.clj:78)
@dpsutton there’s a few ways to get that, here’s a simple one
=> (name ''foo)
ClassCastException clojure.lang.PersistentList cannot be cast to clojure.lang.Named clojure.core/name (core.clj:1546)
yes, the stack trace says so 😄
bronsa super close but you get this one. in my haste i forgot the ns
in the declaration. so it was just (my-name-space ...
How could it be dead or optimized away if the string literal appears on the screen of the running app?