Fork me on GitHub
#polylith
<
2021-04-03
>
J16:04:27

Hi! I take a look to polylith and I like it! I’m wondering if it’s possible to manage the UI too (with cljs of course) in the same `workspace` ?The Clojure(Script) ecosystem is awesome and typicaly we can share schema (spec, malli) between front and back. Is this possible?

▾ workspace
  ▾ components
    ▾ mycomponent
      ▾ src
          interface.clj
          core.clj
          ui.cljs
      ▸ test
      ▸ resources
And add a new entry in the projects folder.

clj 3
cljs 3
polylith 3
David Vujic17:04:41

Hi @UHZPYLPU1! I am currently working on a solution like that and am writing a blog post with an example code repo - but took a break for the easter holiday today 😄

David Vujic17:04:47

I think I will have something to share tomorrow or maybe monday.

👍 6
J18:04:04

Priority to the easter chase 😉

😄 3
David Vujic20:04:50

Here’s my example repo, including Clojure, ClojureScript and cljc code as the glue in between (I’ll also post a link to my blog post about it in the #news-and-articles channel) https://github.com/DavidVujic/polylith-experiments

🙌 6
J13:04:42

ooooh well done @U018VMC8T0W !

J13:04:31

Juste a little note. When a component has Clojure (clj) code and ClojureScript (cljs) it’s maybe good to separate into a ui namespace (or another name) like this:

▾ workspace
  ▾ components
    ▾ mycomponent
      ▾ src
          interface.clj
          core.clj
          ▾ ui
            interface.cljs
      ▸ test
      ▸ resources
I don’t no if it’s a good or bad pattern but this allow to separate interface.clj and interface.cljs

David Vujic07:04:15

I guess it depends, maybe they could be two separate components?

tengstrand14:04:57

You are mixing languages within the same component here + that it contains two separate interfaces also. My gut feeling says that the two “components” should be separated and live in two separate src directories . The UI code could either live in its own src directory, or together with other ui code, optionally in a separate base which another team here did (we haven’t). But with that said, feel free to experiment @UHZPYLPU1!