Fork me on GitHub
#clojurescript
<
2023-01-06
>
lepistane13:01:34

Having to deal with JS churn and breaking updates in react ecosystem is quite painful so i thought about different approach. I want to use javscript components i find in the wild (not npm packages) and i want to create local files and use those files/components in cljs project. There must be a way for me to do this but i can't seem to crack it. Specifically i am trying to use react native component from https://github.com/software-mansion/react-native-gesture-handler/blob/main/example/src/new_api/reanimated/index.tsx and include it my app.cljs. (i am using shadow-cljs, more info https://clojurians.slack.com/archives/C0E1SN0NM/p1673006091388299?thread_ts=1673003507.206739&amp;cid=C0E1SN0NM How does one do this?

thheller13:01:00

if this is react native you need metro to process these files. as such you can just require them via js/require. the location is relative to whereever you are writing your CLJS output

thheller13:01:30

oh nvm. answering in other thread

👍 2
kwladyka21:01:20

I have a few years break from last time when I was comparing figwheel vs shadow cljs. How does it look today? Other solutions?

p-himik21:01:42

Shadow-cljs remains to be awesome, 0 complaints.

👍 2
kwladyka21:01:28

As I remember a few years ago in figwheel this https://github.com/kwladyka/form-validator-cljs/blob/doc/src/js/index.js was the best solution to include part of the material-ui library instead of whole library. How does it look today in shadow-cljs / figweheel?

kwladyka21:01:24

Do you have analogical example?

p-himik21:01:59

You just require what you need:

(:require
  ["@material-ui/core/Button" :default Button]
  ["@material-ui/core/Card" :default Card]
  ["@material-ui/core/CardActions" :default CardActions])

p-himik21:01:41

Note that :default is non-standard but I noticed that "...$default" doesn't work in some cases - not sure whether it's been fixed or not and where such a fix is needed at all.

p-himik21:01:42

But again, no clue whether it's something in shadow-cljs or CLJS itself.

skylize21:01:13

The thorough documentation at https://shadow-cljs.github.io/docs/UsersGuide.html and the insane 🤯 amount of support provided by @U05224H0W in #C6N245JGG is reason enough to choose Shadow.

4
p-himik21:01:30

Oh, great, thanks!

kwladyka21:01:50

What about EQL and other solutions? I think a few years ago the com.wsscode/pathom was a way to go. How does it look today? Which solutions are worth to consider for BE <-> FE ? Something more automated by default, than coding custom REST.

Alex Miller (Clojure team)22:01:52

https://clojurians.slack.com/archives/C0C4WV96U/p1673042571865769 - see for info on tickets, call for presentations, and sponsorship!