Fork me on GitHub

Anyone know of any good blogs or articles that discuss deploying a cljs library to npm?


I suppose it's the same as deploying any other library to npm. You can create package.json, add prepublish task that compiles cljs into js (example with compiling typescript: and specify entry point: guide on publishing package:


thanks, i'll take a look


Everything have so many issues…. finally I am trying shadow-cljs. I heard from people it is good solution to include npm. I will try it soon.


shadow-clj has good documentation, but unfortunately it is academic stile. You have huge book with all knowledge, but you have to glue this knowledge yourself to get success. Doc is not written in the way, step by step with some example when you can feel you understand it and have small successes.


I think npm packages are only one huge disadvantages of cljs. But according to it should change in the future


@thheller thx, I will take a look on it


step by step for npm is literally npm install the-thing (:require ["the-thing" :as x])


Maybe I am not enough clever 🙂 Just my personal feeling when trying to understand how to use shadow-cljs. I did something, but I wasn’t sure it is ok, up to date, etc.


All is about small details, for example here React is in package.json, but in shadow-cljs.end there is reagent without :exclude cljs/react


That is why I am saying i feel there is huge book with all answers, but I have to glue knowledge myself to be sure how to use it


why would it exclude? it is not required. you can do it but it is optional


yep. I know. doesn't matter.


Hmm so shadow-cljs is clever enough to know about it and exclude it?


well technically not exclude it. it will still be downloaded, it just won't be used.


I have no idea how this magic work, but I am impressed


But will be include into js files after compilation?


well you still need to npm install react react-dom manually currently but those will be included. not cljsjs/react


that is fine


thank you for explanation


shadow-cljs in general tries to automate all this stuff as much as possible. so most of the manual things you need to do with other tools do not apply. If you read a guide about :npm-deps in CLJS pretty much none of it applies to shadow-cljs.


I was trying all this things and I have issues in all of cases. Still it could be my fault. Today I will finally try shadow-cljs to achieve what I want 🙂


@kwladyka Thanks for the links, i'll look them over


Certain aspects of the :npm-deps stuff is still pretty new, so a lot of stuff doesn't work. I agree @kwladyka


shadow-cljs has it's own ways of handling that stuff, and it looks like it has much better support, since it seems like @thheller is interested in keeping strong ties with the npm ecosystem 🙂


geez no. I wish I could use something else but npm is where most of the JS stuff ends up and I wanted easier access to that 😉


woo shadow-cljs gives me so good experience so far. @thheller you are the boss 🙂 Thank you for creating this 🍺

😎 4

error messages ❤️


Is there a slack channel for reframe?


@grahamcarlyle I personally put a lot of work into figwheel to make it as user friendly as possible, I do highly recommend it as a first experience of clojurescript, cljs.main is still very very new and not friendly at all

👍 4

I'm running into a head-scratcher with re-frame. I'm getting 'Error <! used not in go block' but I've got go blocks everywhere and I've tested the functions in question outside of re-frame. Has anyone seen this before?


One addition: seems to be related to the go block being long running. If I remove a long running call and put fake data in, it seems to work.


OK... somehow fixed it by factoring out the go block into its own function instead of inlining in the handler. No idea why that should have changed anything, maybe some kind of macro interaction within re-frame.


@jrbrodie77 keep in mind that go blocks don’t traverse function boundaries. so if you had the <! inside an inlined function it won’t work. i suspect that’s what happened to you.


@jrbrodie77 keep in mind that go blocks don’t traverse function boundaries. so if you had the <! inside an inlined function it won’t work. i suspect that’s what happened to you.