Fork me on GitHub
#clojurescript
<
2018-01-02
>
vemv03:01:57

cljs.test is not running assertions coded in the following form:

(defn impl [...]
  (testing ""
      (async
       done
       (go
         ...))))

(deftest all-cases
  (doseq [...]
    (impl ...)))
It runs the deftest, but it reports 0 assertions. What's a better way to run tests in a loop? Note that: - I'm using the async macro - I'm exercising combinatorial cases, "code it by hand" not an ideal option

sova-soars-the-sora03:01:02

is it possible to get clients to interact independent of server through js / cljs ?

sova-soars-the-sora03:01:32

@theasp cljs versus clj ... web app. So you mean a CLJ server in both cases but a CLJS clientside versus the static html served and plain old js object being loaded?

benzap06:01:36

I've been doing some research on clojurescript's bootstrapping, and i'm still missing some things. In order to bootstrap clojurescript and self-host it on a website to compile clojurescript code, do you need to build cljs-bootstrap? Is the library not included in a clojar?

benzap06:01:23

Just some food for thought, I was also wondering why we don't see something similar to how coffeescript works. If you include a certain file directly in your webpage, it will look for <script> tags including a certain type ie. type="coffeescript" and compile it into javascript without having to build it first. Is something like this possible for clojurescript, or is it limited by the google closure compiler? I feel like it would be pretty useful for development, or for people to just try out the language without having to resort to using a build system. Although, i'd say clojurescript self-hosting has come an incredible way so far.

deg11:01:56

For debugging, I'm looking for a quick way to convert a DOM node into an HTML string.

thheller12:01:23

@deg (.-outerHTML node)

mfikes13:01:48

@benzap You don't need any external dependency in order to use self-hosted ClojureScript—just make use of the cljs.js namespace.

kennytilton13:01:29

Is anyone able to get to a CORS-enabled site such as “https://api.github.com/” from a CLJS client running on a browser? I am using cljs-http with code like:

kennytilton13:01:42

`(client/get uri
  {:async? true}
  (fn [response]
    (println :xhr-response (:status response) (keys response) uri))
  (fn [exception]
    (println :xhr-error exception)))
`

kennytilton13:01:55

That gives an error in the console like

`The value of the 'Access-Control-Allow-Origin' header in the response must not be the wildcard '*' when the request's credentials mode is 'include'. Origin 'null' is therefore not allowed access. The credentials mode of requests initiated by the XMLHttpRequest is controlled by the withCredentials attribute.
`

kennytilton13:01:14

If I add “:with-credentials? false” I get no error in the console but neither callback fires.

kennytilton13:01:17

Will try raw google closure xmlhttprequest next to see what that turns up, but any tips are welcome.

lauritzsh14:01:32

What do people do with CSS for front-end development (Reagent, Rum etc)? Something that supports Autoprefixer, PostCSS etc would be nice. I know in React that CSS-in-JS is popular but I have only used CSS Modules with React. Should I use Garden?

lauritzsh14:01:30

@rauh I saw your announcement for Hicada that seesm to support "inline CSS", is that using Garden? Are you planning on doing a write-up on that soon? Sounds interesting

rauh14:01:53

@mail228 Not anytime soon, no. Check out the last few commits of @roman01la’s prum. He uses hicada + his cljss ( ) to do some inline css.

roman01la14:01:37

@mail228 @rauh is right, I’m maintaining one CSS-in-CLJS library, similar to Emotion.js, for ClojureScript. AFAIK a couple of people use it in production, but it is still somewhat limited (support for Media Queries just landed yesterday and still a WIP) Take a look at it, maybe it will fit your needs https://github.com/roman01la/cljss

lauritzsh14:01:09

Thanks, I had my eyes on that as well. New to this environment so trying to get an overview of what people are using and what's available. Does it support stuff like PostCSS/Autoprefixer?

roman01la14:01:39

@mail228 no, I don’t have plans on adding vendor prefixing, the library is using CSS Variables to update dynamic styles which means that the output CSS support is already limited to newer browsers (IE 11 and older are not supported)

lauritzsh14:01:41

That's fair, luckily I'm not trying to support older browsers, just the newest so that works. On production build does it then extract it to a .css file for caching like the webpack plugin?

roman01la14:01:50

@mail228 No. I was doing that in the early versions, but then got rid of this functionality, bc it doesn’t allow to eliminate unused CSS at compile time. Also the implementation is a bit hacky with macros.

lauritzsh14:01:29

I will definitely check it out, think it fits my needs

roman01la14:01:14

@mail228 don’t hesitate to open an issue if you find any problems, I’m sure there are quite a few bugs 🙂

kennytilton14:01:59

Just found a hyper-relevant issue on cljs-http. Checking….

kennytilton15:01:58

Never mind, I am an idiot:tried treating cljs-http as if it were clj-http. 😊

vemv15:01:13

using js/ReactDates.DateRangePicker (not Controller) here, works well

tomaas15:01:03

yes we also use it, and it works. The problem is that it has the input field (which once clicked 'dropdowns' the calendar). We want the calendar also opened with no input field, which is what DayPickerRangeController is supposed to do

roman01la17:01:28

@tomaas are you sure attribute names should be kebab-cased and not cameCased, since its interop with JS components?

richiardiandrea21:01:21

Has anybody ever used wallaby.js with clojurescript?