Fork me on GitHub
#fulcro
<
2019-03-30
>
lauritzsh11:03:03

Is it possible to use hiccup with Fulcro? So I can write [:div.ui.segments ...] instead of (div :.ui.segments ...)?

claudiu15:03:14

Should work with sablono if you really want https://github.com/r0man/sablono

currentoor16:03:00

@U8LP4DAJZ it’s certainly possible, as @U3LP7DWPR suggested, you could make your own wrapper macro around around defsc that wraps the render body with the sablono html macro

currentoor16:03:23

i used to do that, but i don’t recommend it anymore

currentoor16:03:41

the syntax with sablono isn’t anymore expressive now that our dom macros have CSS class/id keyword support

currentoor16:03:57

and the fulcro dom macros are much faster

currentoor16:03:03

they convert the attributes map and CSS keyword to javascript objects at compile time, so there’s no runtime overhead

currentoor16:03:48

some will argue that they prefer to work with datastructures rather than code/macros, but i can count the number of times i’ve treated react dom nodes as data on one hand, and even then it wasn’t necessary

lauritzsh15:03:10

Cheers, I'll try and stick to the dom macros

alex-eberts19:03:18

Hi all, I’m going through the fulcro template Readme and I’m getting a “File Not Found” exception for “clojure/tools/namespace” - is this a known issue?

currentoor19:03:52

Not that I know of

currentoor19:03:58

what version of clojure and java are you running?

alex-eberts19:03:03

from: deps.edn org.clojure/clojure {:mvn/version “1.10.0”}

alex-eberts19:03:17

openjdk version “1.8.0-adoptopenjdk”

alex-eberts19:03:35

to give a little context, I get the error when trying to start the API server.

alex-eberts19:03:00

the section of the readme says: “Start a LOCAL clj nREPL in IntelliJ (using IntelliJ’s classpath with the dev alias selected in the Clojure Deps tab)”

alex-eberts19:03:37

starting the local repl in Intellij produces the error.

alex-eberts19:03:46

the alternative option from the readme (i.e. starting from the command line) works.

adamfeldman20:03:46

I too am working with the template right now. Run npx shadow-cljs server (or use yarn instead of npx), then once it all finishes visit http://localhost:9630 and start the main and workspaces builds. Use the REPL in the browser to connect to the clj REPL and run (start). Then you can visit http://localhost:3000 without error

adamfeldman20:03:44

Oops, I somewhat misread your question. I am using Calva in VS Code and haven't yet figured out how to connect to or start the right nrepl for the server. That's why I used the browser REPL in my previous message.

adamfeldman20:03:08

Ah, I figured it out. I connected to the main REPL using nrepl, then ran (ns user) before running (start)

adamfeldman20:03:03

(when I opened that REPL for the first time it was in the namespace shadow.user)

alex-eberts21:03:04

@UCHV4JZ7A thanks for the update!

👍 4