clojurescript

ClojureScript, a dialect of Clojure that compiles to JavaScript http://clojurescript.org | Currently at 1.10.879
macrobartfast 2021-04-17T01:35:52.216500Z

in organizing a reagent project, I typically have state.cljs, util.cljs, components/<components>… where should I put things that change state?

macrobartfast 2021-04-17T01:36:14.217Z

I know this is a matter of taste, but just about any of your suggestions will be better than my guess.

macrobartfast 2021-04-17T01:37:31.217200Z

mutations.cljs?

macrobartfast 2021-04-17T01:38:21.217900Z

I’ve seen fn.cljs and mutations.cljs in a single project, but am not clear on what the difference might be.

👍 1
Franco Gasperino 2021-04-17T02:57:40.219400Z

i'm a complete neophyte, but i used dispatch.cljs

Franco Gasperino 2021-04-17T02:58:27.220100Z

as functions defined in that ns are the link between the larger app and re-frame

macrobartfast 2021-04-17T03:09:24.220400Z

gotcha… not using re-frame yet, but will soon.

macrobartfast 2021-04-17T03:09:28.220600Z

that’s helpful.

Grigory Shepelev 2021-04-17T09:08:58.226800Z

I need a little help with a task. The project that my boss wants to make is a small SPA for his service. He wants it to be on clojurescript with http://minimal.cc/ theme he paid for. I took that theme and separated all the React components from it and published them as a separate npm package into my private GH repo. But for some reason when I'm trying to use it with shadow-cljs and reagent I am having errors of them not being a React components although the surely do (if being printed to browsers's console) look like react components. I guess that's the "exact" part of my question. The more broad part is: I'm quite sure that adapting existing React components written with js into your cljs project is a common task. How is it better to be done?

Grigory Shepelev 2021-04-17T09:10:03.227600Z

All the resources that I've found online while digging into that problem didn't gave me quite and answer.

Grigory Shepelev 2021-04-17T09:11:06.227800Z

https://material-ui.com/store/items/minimal-dashboard/

Grigory Shepelev 2021-04-19T12:17:55.232800Z

Sorry for such a late reply. 1. I've decided to separate views and logic as much as possuble IMO it's a bad practice to mix languages and technologies directly in the project's file system. I wanted to add more "cool stuff" like Storybook to that theme and make it possible to use same react components by other company's projects. 2. Not for now.

p-himik 2021-04-17T09:41:26.228Z

Two questions: - Why did you create a separate NPM package from it? IMO it would be much simpler to just ship the JS sources along with the CLJS sources - Do you have a minimal reproducible example with that error?