This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-10-18
Channels
- # 100-days-of-code (6)
- # announcements (4)
- # beginners (126)
- # cider (49)
- # cljdoc (28)
- # cljsrn (3)
- # clojure (89)
- # clojure-dev (19)
- # clojure-greece (2)
- # clojure-italy (13)
- # clojure-mexico (1)
- # clojure-nl (13)
- # clojure-spec (108)
- # clojure-sweden (1)
- # clojure-uk (48)
- # clojurescript (31)
- # cloverage (3)
- # core-async (16)
- # cursive (28)
- # data-science (3)
- # datascript (1)
- # datomic (60)
- # defnpodcast (1)
- # docker (17)
- # editors (18)
- # emacs (16)
- # events (1)
- # figwheel (22)
- # figwheel-main (4)
- # graphql (26)
- # jobs (2)
- # off-topic (9)
- # om-next (2)
- # overtone (4)
- # perun (1)
- # re-frame (2)
- # reagent (18)
- # reitit (1)
- # ring-swagger (2)
- # shadow-cljs (2)
- # tools-deps (49)
- # uncomplicate (1)
- # unrepl (1)
- # vim (2)
Published simple guide on how to do cljs in AWS Lambda https://medium.com/@mihailstumkins/clojurescript-quick-start-for-serverless-and-aws-lambda-e646ff136baf?source=linkShare-4b1d49e34d5c-1539865321
đź‘‹ Hi everyone, does anyone else have experience creating tests for functions that use core.async? I've asked this on core.async channel and was recommended to ask here.
Your let block does not return anything meaningful and you are passing done as a 3rd param to the assert
you want to call done after your asserts have all run. each assert side-effects global state in the test ns which is summed up when the test finishes.
use go blocks to get values asynchronously but aim to write them as-if they were synchronous (thats what go blocks are for) ie (is (= "this" (<! that-chan)) "some msg")
maybe ask in #re-frame @slack1038
Hi folks, I've been trying to get data.xml
to work with NodeJS, with some success but it's not fully working..
For example, with the following setup
(require 'cljs.repl.node) (cider.piggieback/cljs-repl (cljs.repl.node/repl-env) :npm-deps {"xmldom" "0.1.27"} :install-deps true)
(require '[cljs.nodejs])
(set! js/DOMParser
(.-DOMParser (cljs.nodejs/require "xmldom")))
(set! js/XMLSerializer
(.-XMLSerializer (cljs.nodejs/require "xmldom")))
(require '[clojure.data.xml])
The following examples appear to parse correctly (note: element with no content, or no content and attributes)
cljs.user=> (clojure.data.xml/parse-str "<foo></foo>")
#xml/element{:tag :foo}
cljs.user=> (clojure.data.xml/parse-str "<foo attr=\"bar\"></foo>")
#xml/element{:tag :foo, :attrs {:attr "bar"}}
However the following example gives an error (note: element with content)
cljs.user=> (clojure.data.xml/parse-str "<foo>bar</foo>")
repl:13
throw e__6464__auto___7763;
^
Error: No protocol method IPrintWithWriter.-pr-writer defined for type string: bar
at Object.cljs$core$missing_protocol [as missing_protocol] (D:\Projects\xxx\.cljs_node_repl\cljs\core.js:311:9)
at cljs$core$_pr_writer (D:\Projects\xxx\.cljs_node_repl\cljs\core.js:2668:17)
at cljs$core$pr_sequential_writer (D:\Projects\xxx\.cljs_node_repl\cljs\core.js:32716:142)
at clojure.data.xml.node.Element.cljs$core$IPrintWithWriter$_pr_writer$arity$3 (D:\Projects\xxx\.cljs_node_repl\clojure\data\xml\node.js:94:32)
at Object.cljs$core$pr_writer_impl [as pr_writer_impl] (D:\Projects\xxx\.cljs_node_repl\cljs\core.js:32897:12)
at Object.cljs$core$pr_writer [as pr_writer] (D:\Projects\xxx\.cljs_node_repl\cljs\core.js:33018:18)
at Object.cljs$core$pr_seq_writer [as pr_seq_writer] (D:\Projects\xxx\.cljs_node_repl\cljs\core.js:33022:11)
at Object.cljs$core$pr_sb_with_opts [as pr_sb_with_opts] (D:\Projects\xxx\.cljs_node_repl\cljs\core.js:33087:11)
at Object.cljs$core$pr_str_with_opts [as pr_str_with_opts] (D:\Projects\xxx\.cljs_node_repl\cljs\core.js:33101:63)
at Function.cljs.core.pr_str.cljs$core$IFn$_invoke$arity$variadic (D:\Projects\xxx\.cljs_node_repl\cljs\core.js:33184:18)
I've been looking at the source code of data.xml
, but I thought anyone with more insight might be able to understand the issue quicker than me Any opinions on CSS module styling solutions? For example, https://github.com/matthieu-beteille/cljs-css-modules vs https://github.com/mhallin/forest
I was looking into that recently as well...
The advantage to cljs-css-modules is that it is garden syntax, so if you already have CSS made by garden you have to basically change nothing
The disadvantage is that it doesn't automatically defines variables for you.
Forest has a slightly adjusted (but maybe more intuitive) syntax than garden/cljs-css-modules and it defines variables for every class/id
So you do [.class-test {:style ...}]
in Forest and [".class-test" {:style ...}]
in cljs-css-modules and [:div {:class classTest}]
in Forest and [:div {:class (:classTest style-obj)}]
in cljs-css-modules
there is also https://github.com/roman01la/cljss
both Forest and cljss create their stuff at compile-time (as they're macros) and cljs-css-modules keeps it as data, so you could theoretically compose data structures with cljs-css but not with the other two I haven't worked with either though, so I don't know if you'd even want that
Thank you so much @UCULU82G3! This is a great summary and really helps distill things for our classical JS team.
the impl is calling the protocol directly rather than going through a higher level helper
at clojure.data.xml.node.Element.cljs$core$IPrintWithWriter$_pr_writer$arity$3 (D:\Projects\dj-data-converter\.cljs_node_repl\clojure\data\xml\node.js:94:32)
@dnolen I made the xmldom
NPM module available to Node by using the :npm-deps
and :install-deps
compiler options when I started a piggieback repl from a Clojure repl, i.e.
(require 'cljs.repl.node) (cider.piggieback/cljs-repl (cljs.repl.node/repl-env) :npm-deps {"xmldom" "0.1.27"} :install-deps true)
But I guess I could have also just made a package.json, put xmldom in there and run npm install instead (:install-deps seemed to make one for me)
Hi @dnolen just to follow this up, I've created an issue in Jira for this bug, with a proposed patch included that fixes the problem: https://dev.clojure.org/jira/browse/DXML-61
Hi @dnolen just to follow this up, I've created an issue in Jira for this bug, with a proposed patch included that fixes the problem: https://dev.clojure.org/jira/browse/DXML-61