Fork me on GitHub
#cljsrn
<
2022-03-22
>
hadils11:03:21

I am trying to use Babel transfroms as specified in the ClojureScript docs to refer to JS libraries with JSX syntax. The problem is the imports of the JS libraries — they are not being resolved by the compiler. I am using Krell for cljs. Does anyone have a suggestion on how I can do this?

hadils16:03:16

This is really a webpack/Metro question, not a Babel one. What I would like to do is integrate Storybook UI with a Krell REPL.

Jonovono15:03:01

Can anyone sum up the differences / pros+cons of using Krell vs Shadow? I see Status IM uses Shadow.

mruzekw16:03:53

As far as I'm aware Krell is fairly new to the scene compared to shadow-cljs. Krell aims to just be a tool for react-native dev while shadow-cljs aims to build for multiple JS targets: node, electron, browser, react-native. If you just intend on the building a react-native project, I would look into Krell first. It probably reduces the cognitive overhead of just building a react-native app. Though I don't know it's npm package interop story. Otherwise, shadow-cljs is a solid choice, including npm package interop. Additionally there are probably more resources to learn.

mruzekw16:03:27

Status probably uses shadow-cljs just because it was the only viable tool around for their needs at the time.

hadils16:03:06

I’ve used both. Shadow-cljs is very well designed, but diverges from the ClojureScript build process. Krell is more lightweight and does reduce cognitive overhead. You can use it for React and React Native projects. The documentation for Krell is more sparse, but you can rely on the official ClojureScript docs and the Github page. I was able to get it up and running in short order.

👍 1
mruzekw16:03:02

@UGNMGFJG3 Were you able to get npm package interop without shadow-cljs? Do you have a guide handy?

hadils16:03:22

@U1RCQD0UE Best thing to do is to follow the Reagent tutorial in the Krell wiki. npm modules are imported just like cljs modules using Krell.

mruzekw16:03:09

Gotcha. Thanks

Jonovono17:03:09

Thanks both @UGNMGFJG3 @U1RCQD0UE @U1RCQD0UE that's kind of what sparked this. I was trying to set up a cljs folder and then have my web and rn apps. and share code. I was struggling with krell but shadow was pretty easy. It's good to know it's possible, maybe i'll spend a bit more time on it with krell since I like the thinking around that project more