This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2015-10-16
Channels
- # announcements (1)
- # aws (11)
- # beginners (3)
- # boot (63)
- # cbus (1)
- # cljs-dev (4)
- # clojure (96)
- # clojure-dev (5)
- # clojure-germany (2)
- # clojure-japan (43)
- # clojure-poland (2)
- # clojure-russia (38)
- # clojure-sg (2)
- # clojurescript (138)
- # clojurex (1)
- # cursive (3)
- # datomic (16)
- # docs (6)
- # emacs (3)
- # events (2)
- # ldnclj (42)
- # off-topic (6)
- # om (384)
- # onyx (122)
- # spacemacs (6)
I’m using cljs-ajax’s response format handling, to extract some piece of data from the response before giving it back to the application
@viesti: I would recommend you to read cljs-ajax to see what they use to handle HTTP requests. They probably use
, then go to that code and read the comments on IE support. There are usually lines that read // In IE 8 we need to cover for the lack of ...
yep, tried to do as much, thing is that the underlying xhr thing doesn’t have any response data, it seems, so IE seems not to like the response
I remember something about IE not handling JSON back when I was doing Rails/JQuery. I don't remember exactly what that was, but I think it had something to do with the content type. What content type is your response?
Here’s a snipplet scraped from tcpdump session: http://pastebin.com/raw.php?i=izYzZ6n7
I'd try sending the reply with content type text/plain
and explicitly telling cljs-ajax it's JSON with :response-type :json
. That's a bit of a long shot, but worth trying I think.
@dnolen it might just be me not fully understanding om.next yet, but how do I get this to work https://github.com/thheller/shadow-om-next-tests/blob/fc07acec6798b4d38d540fd9676ec6f134d7f8f1/src/cljs/om/tutorial.cljs#L89-L102
basically I have polymorphic list of things, based on their type they render components
but if I hit +/- I get Uncaught #error {:message "No queries exist for component path (om.tutorial/RootView om.tutorial/TypeB)", :data {:type :om.next/no-queries}}
is probably the issue as I don't know how to properly set up the subquery (like the tutorial does)
@dnolen: what is your stance/opinion on microservices?
@grounded_sage: I don’t have a stance or an opinion
I have a function defined like this:
(defn add-alert [db type message]
(s/validate (s/enum :success :info :warning :danger) type)
Is there a better way of providing that contract?
Cool. Was just wondering whether it is something I should look into as I learn. But doesn't seem like something that needs to be there from the start
Hi @pupeno you coud use
(s/defn add-alert ^:always-validate my-function [db type :- (s/enum :success :info :warning :danger) message] … )
hmadelaine: thanks. I forgot about always-validate.
I'm adding some bits of context to the Compiler Options https://github.com/clojure/clojurescript/wiki/Compiler-Options and I notice that both resources/assets
and resources/public
are used in the example. I think they should be consistent (if possible). Which one is preferred?
hmm I'll think about. I guess the reason to do it is that it makes :optimizations :none
work out of the box
docs should be consistent about resources
, peoples trouble with the classpath notwithstanding.
the problem with compiler opts is that while it is correct, it generally lacks context and people misunderstand it. I guess it should stay as a reference while people should be expected to read other tutorial-like-material like the QuickStart where the context is
would like to switch my sass compilation from node.js to figwheel. To be honest - i would like skip the huge overhead that comes with Stuart Sierra's component library to get my first environment up. has anyone a working figwheel.clj i can steal?
There's a sample one in the om.next quick start. https://github.com/omcljs/om/wiki/Quick-Start-%28om.next%29#setting-up
@spinningtopsofdoom: yes, i use this config at the moment, but would like to have the additional config for a sass->css compilation. it will look something like this: https://github.com/bhauman/lein-figwheel#scripting-with-component
@thomasdeutsch: I would just use component for this, what are you saving by not using component?
thomasdeutsch: that script basically just runs ra/start-figwheel! and ra/cljs-repl, you can add a custom start-sass-compilation! function in the same way, with or without using component
yes, i would like to use component for this but has anyone done this before? i do dont know anything about jetty and would love to just get started with a sample config
@thomasdeutsch: jetty is a web server that you may or may not want to use in your own script
if you leave out jetty, the scripts doesn't do much more than the example script before that on the same page
can i use... for example ... my existing node.js server?
@thomasdeutsch: yeah, just add a function call that starts the node process
and a handler - i guess... ok... i will kill some thime with this
(.start (Thread. #(clojure.java.shell/sh "node" "server.js")))
could be a first attempt, you'll want logging and maybe restarting as well
@thomasdeutsch: if you want to start a node server from the command line, I've been recently doing that to wrap Karma (the test runner). relevant code here: https://github.com/bensu/doo/blob/master/library/src/doo/shell.clj
lets say i would start my node.js server manually .. or it is always running in my batcave - i think i only need to add a system dev and a handler... thanks @bensu i will look into it
is it advisable to separate a cljs SPA with a clojure backend into two different projects?
@shaunlebron: want to way in on what a default cljs-build config file should be named?
bhauman: i'm trying to use figwheel-sidecar 0.4.1 with chrome 46 for the latest om-next tutorial and it seems lke figwheel is not recompiling nor reloading the browser. i've also tried it on FF
@lobo you may want to isolate this from the Om tutorial and make sure you can get Figwheel working on it’s own
@lobo a bunch of people have gone through the tutorial today and haven’t reported problems
@lobo doubtful, if you’re not familiar with all the pieces it’s easy to make a mistake
@dnolen: thanx for the help. moving the core.cljs file to the right directory got things working again.
@bhauman: I noticed when I’m pretty printing with a Figwheel REPL I get the expected behavior but I also get noise, a second printing of stuff in a seq
figwheel 0.5.0 (in process) has been a huge effort ... a big refactor into separate concerns and composing it of stuart's components
. It's the "wow people are really going to be using this software for a while" refactor.
@bhauman: yeah someone made it a while back, it’s been a bit quiet but I’ve been more active as of late since Om Next has now left the nest
(om.next/from-history om-tutorial.core/reconciler #uuid "c4cee9c6-0e68-4724-a552-29c9dd26299e")
hello guys, I am working with cljs and testing harness as such:
clojure :figwheel {:on-jsload "launcher.test/run" ...
and
clojure
(defn ^:export run
[]
(run-all-tests #"^cljs.*-test")
success)
but I can't see the failure in the dev console, only the report (e.g.: Ran 11 tests containing 17 assertions.)
am I missing something? shouldn't it print everything to console?
@bhauman: naming is hard! cljs-build.edn is fine with me
@richiardiandrea: are you defining your own reporting functions? Are you sure the tests are failing?
(def success 0)
sorry 😄
I am investigating, maybe it is just that I cannot see it because of the huge amount of log in the dev console 😄
jakemcc/lein-test-refresh does not work with cljs right?
I don't think so. Are you looking for a way of running cljs tests and see the results in the console?
if you want to get the output of the tests, you can always use (def cljs.test/report [:cljs.test/default :end-run-tests] [m] (cljs.test/successful? m))
that will register a reporting function that gets called at the end of run-tests
, where you can find out if the tests where succesful with cljs.test/succesful?
right, I think your approach is better, even for async tests..
I read that part of th wiki, and I am going to do it
btw the failures are there, I just need to log less stuff and pay more attention 😄
haha, I would dare to say it is the only way. I had to put it in the compiler to get doo
working
will check
doo
source thendamn backticks, I am so used to Markdown I cannot stop putting three 😄