Fork me on GitHub
#fulcro
<
2017-10-03
>
tony.kay02:10:44

So, semantic UI react doesn’t yet work with the new npm libs support, but the cljsjs version is fine, and all of the components in it offer a completely controlled version, meaning they are excellent for use with Fulcro. I’ve been playing with them, and like them quite a bit.

cjmurphy03:10:08

I wasn't sure of the status of there being a Calendar component with SemanticUI.

roklenarcic07:10:43

problem with semantic ui is that it dumps styles into style element

roklenarcic07:10:10

which blows for css

roklenarcic07:10:32

so you need to go through their theme system to change things

roklenarcic07:10:22

which is not good enough when you want to, say, vary color of text depending on the data, then you have to spam CSS with important

roklenarcic07:10:39

I still need to figure out how to make my JS files smaller, any trivial site is 1MB js file at least

wilkerlucio16:10:27

@tony.kay trying ot use the easy http server, but can't start it... when I try I get:

CompilerException clojure.lang.ExceptionInfo: Error in component :config in system com.stuartsierra.component.SystemMap calling #'com.stuartsierra.component/start {:reason :com.stuartsierra.component/component-function-threw-exception, :function #'com.stuartsierra.component/start, :system-key :config, :component #fulcro.server.Config{:value nil, :config-path "/usr/local/etc/fulcro.edn"}, :system #<SystemMap>}, compiling:

wilkerlucio16:10:47

I have wrote at the "/usr/local/etc/fulcro.edn" with a basic {:port 8890}

wilkerlucio16:10:52

am I missing something?

tony.kay17:10:40

@wilkerlucio I admit the error message leaves something to be desired…

tony.kay17:10:45

permissions on file?

tony.kay17:10:01

is it legal EDN? (no weird characters)

wilkerlucio17:10:03

I created with current user, and I can read with that

wilkerlucio17:10:15

cat /usr/local/etc/fulcro.edn
{:port 8890}

tony.kay17:10:27

od -c /usr/local/etc/fulcro.edn

wilkerlucio17:10:49

od -c /usr/local/etc/fulcro.edn
0000000    {   :   p   o   r   t       8   8   9   0   }  \n
0000015

tony.kay17:10:57

hard to argue with that 🙂

wilkerlucio17:10:34

maybe it's broken, this is all the code i'm using:

wilkerlucio17:10:35

(def my-server (atom (easy/make-fulcro-server
                       ; components available in query/mutation env:
                       :parser-injections #{:component-key :config})))

tony.kay17:10:57

what is :component-key?

wilkerlucio17:10:09

and I wonder if we could send the config inline, my use-case for this is just for a dev server (there is a different pipeline for prod that is used here, but it's bad for dev)

wilkerlucio17:10:38

I just left it there from the cheatsheet example

tony.kay17:10:42

So, config file is configurable via a param, or via a JVM option, just for that reason

tony.kay17:10:31

For dev I often put the EDN on the classpath, and use a relative path (which reads resources)

wilkerlucio17:10:44

why don;t allow an option to the make-fulcro-server?

tony.kay17:10:12

what do you mean?

wilkerlucio17:10:13

(def my-server (atom (easy/make-fulcro-server
                       :config {:port 8890}
                       :parser-injections #{:config})))

tony.kay17:10:42

oh, I see….because that screws up the ability to switch out configs

tony.kay17:10:01

:config-path can be absolute or relative

wilkerlucio17:10:01

could be complementary, in my use case I have no need to change it

tony.kay17:10:20

and -Dconfig can be used from the command line on JVM to swtich it (takes precedence)

tony.kay17:10:39

the point is the solution is already trivially fully general

wilkerlucio17:10:18

I just think the simplest uses shoud be available, and the current case has no inline (the simplest) case, only indirect ones (via file path or external launch config)

tony.kay17:10:11

still doesn’t tell us what is wrong. I’d rather just have a better error message

wilkerlucio17:10:27

yeah, and it still failing here =/

wilkerlucio17:10:41

can you try to run on your side? maybe it got broken at some point accidentally

tony.kay17:10:50

nothing has changed in that code in a year I don’t think

wilkerlucio17:10:52

I'm using fulcro 1.0.0

tony.kay17:10:06

give me a sec

tony.kay17:10:38

works for me

tony.kay17:10:56

Try specifying config-path

tony.kay17:10:13

(which I had to do becuae of my current code structure)

tony.kay17:10:48

I suspect dependencies

wilkerlucio17:10:51

but it's fine, let's not take a lot of time on it, I have an alternative here anyway, I was just trying to simplify it

tony.kay17:10:05

lein deps :tree

tony.kay17:10:22

you might have weirdness on versions around ss components

wilkerlucio17:10:34

yeah, probably

tony.kay17:10:57

I’m using the latest lein template, which has been upgraded to fulcro 1.0

tony.kay20:10:18

I just pushed a very light wrapper project for semantic ui: https://github.com/fulcrologic/semantic-ui-wrapper

tony.kay20:10:33

v 1.0.0-SNAPSHOT is on clojars. Makes using Semantic UI components in Fulcro quite easy

tony.kay20:10:42

(not that it was that hard to begin with)

tony.kay20:10:32

it just contains factories for the UI elements, and symbols for all of the icon names. I hope to integrate the docstrings from the react project, so that we can see the props via cljs docstrings

tony.kay20:10:47

should be pretty doable, since they use react-doc and that outputs JSON

tony.kay20:10:57

This is by no means tied to using Fulcro…it should work with all React libraries. I’ll announce it more widely once it has a few more things

tony.kay20:10:01

(docs, mainly)