Fork me on GitHub
#fulcro
<
2018-01-18
>
tony.kay06:01:21

Lein template for Fulcro updated. It now includes a shadow-cljs option! The shadow-cljs compiler makes using NPM-based js libraries a lot easier.

lein new fulcro my-project shadow-cljs demo
gets you a v2.x Fulcro project with demo content that uses the shadow-cljs compiler. Try it out and let me know if anything is wrong. The templates support a lot of different things, and I think they all work, but it takes quite a bit of time to test them all.

levitanong07:01:16

Will the book get a section for migrating to shadow-cljs? 😄 Getting tired of having to run lein clean every time to prevent the NPM stuff going nuts

tony.kay07:01:37

no, but you could make a template and just look at the differences

tony.kay07:01:49

it is pretty nice, actually

tony.kay07:01:32

very small code differences in dev mode: so some slight restructuring around that.

tony.kay07:01:53

I don't know...maybe I'll write it up somewhere.

levitanong08:01:31

Ok then, will take a look 🙂

grzm23:01:02

@cjmurphy Have you examined the output HTML? Browers generally collapse whitespace. Looks like you've got something else funky going on in your css or elsewhere, given that you're divs are behaving like spans.

cjmurphy23:01:54

No not yet. If I use spans will it clear up the problem? Can't be too much funky as the css is raw (no bootstrap or anything). My Google search says 'nowrap' can be a problem (well maybe it says that). If the browser is doing the collapsing, then how do I tell it not too? Will look at the HTML now...

grzm23:01:50

What I suspect you want is something like

(dom/div nil
                 "All that "
                 (dom/span (clj->js {:className (:gold-coloured global-css)}) "glitters")
                 " is not gold")

grzm23:01:40

I think, given you're doing a function call in your attribute definition, you need clj->js instead of #js (which only works for literals)

cjmurphy23:01:31

That actual html seems good: <div class="default-db-format_ui_domain_CSS__red-coloured"> glitters </div>

grzm23:01:36

Browers will collapse whitespace between block elements, yes.

grzm23:01:47

And divs are block elements.

cjmurphy23:01:44

Cool. Been a while since I've done HTML but the usefulness of spans is coming back to me. Thanks grzm.