Fork me on GitHub
#shadow-cljs
<
2018-09-27
>
gklijs05:09:56

I went to a meetup last night about https://github.com/zeit/next.js/ is it possibly combinable with shadow-cljs? One of the problems of a big spa, especially with clojurescript is that you need all the js for all the pages.

thheller07:09:11

@gklijs it is probably easy to use in the same way I tried with gatsby https://clojureverse.org/t/creating-websites-with-gatsby-shadow-cljs/2912

thheller07:09:48

but it probably will have the same issues and don't fit that into the system

gklijs07:09:58

Thanks, I might give it a try, but so far only done very small cljs things, so don't really need it.

gklijs07:09:38

It's very similar Gatsby, but is more configurable

thheller07:09:58

yeah going over the docs the integration would look pretty similar

thheller07:09:22

might even work better since they don't seem to do these AST transforms that gatsby does

thheller07:09:11

I have been considering writing one of those site generators for shadow-cljs

thheller08:09:09

@gklijs got curious and implemented the same example I did for gatsby. https://github.com/thheller/next-cljs

thheller08:09:04

works fine but has some issues around SSR since it serializes the data to JSON and that doesn't work too well for CLJS data

thheller08:09:24

could be worked around though

Hannu Hartikainen11:09:47

I tried running tests using node.js with an npm script

"scripts": {
    "test": "shadow-cljs compile test"
  }
and the shadow-cljs build config
:test {:target    :node-test
                       :output-to "target/node-tests.js"
                       :ns-regexp "-test$"
                       :autorun   true}}}
But when I run the tests (whether by npm test or npm run test) the exit status is zero even if there were failures. Is it just a bad idea to run the tests with :autorun?

Hannu Hartikainen11:09:10

The docs say > The node process exit code will be set to 0 when successful and 1 on any failures. and > :autorun (boolean, optional) Run the tests via node when a build completes so I expected this should work. Maybe the docs just need a clarification.

thheller11:09:29

@hannu.hartikainen don't use :autorun if you need the exit code. it mostly meant for running tests automatically with watch. use shadow-cljs compile test && node target/node-tests.js instead

👍 4