Fork me on GitHub
#shadow-cljs
<
2019-05-20
>
dangercoder03:05:29

@thheller sorry, bad example. Toolbar is a part of ["@material-ui/core/Toolbar" :default tool-bar]. I installed material-ui with npm and got it working. The other material ui components that I require looks like this #Object[WithStyles] but Toolbar is just empty #js {}.

caleb.macdonaldblack05:05:02

I have a script in CircleCI to deploy my webapp. But sometime app.js fails to generate and it doesn't get uploaded. Any ideas of what could cause that?

caleb.macdonaldblack05:05:58

I'm generating and deploying two seperate shadow-cljs projects with different shadow-cljs.edn files with shadow-cljs release app. They are run one after the other too

thheller06:05:31

@jarvinenemil see the documentation about :default, you should probably try :as tool-bar instead. :default is currently in a weird situation. https://shadow-cljs.github.io/docs/UsersGuide.html#_about_default_exports

dangercoder07:05:49

thanks, ill try it out. will report back. I am planning on putting together a repository showcasing how to use material ui with shadow-cljs, (app-bar, etc..) 🙂

dangercoder07:05:15

a bit wierd that i tried both before though, but ill have a look once i get home

dangercoder17:05:17

It works now, I think it was some NPM issues.

dangercoder17:05:25

I have to improve my bug search skills though

thheller06:05:52

@caleb.macdonaldblack CircleCI is notorious for killing build processes for consuming too much memory. so the OOM killer just hard terminates the process and pretends that everything is fine.

❤️ 4
thheller06:05:23

put something like :jvm-opts ["-Xmx3G"] into your shadow-cljs.edn

caleb.macdonaldblack06:05:00

@thheller So it will kill a process for a command in my bash script and continue with the remaining commands like normal?

thheller06:05:28

yeah the exit code is lost for some reason I haven't figured out yet

thheller06:05:40

but many people have had this problem before

caleb.macdonaldblack06:05:09

Wow, thanks. If that works I never would've figured that out on my own.

dangercoder18:05:36

I just got material ui working, then I restarted my repl and it stopped working. Anyone has any ideas? Or have also had problems with material ui with shadow?

✅ 4
dangercoder18:05:22

(:require
   ["@material-ui/core" :as mui]))

(defn header []
  [:> mui/AppBar {:position "static"
                  :color "primary"
                  :style {:background-color "#43a047"}}
   [:> mui/Toolbar 
    [:> mui/Typography {:variant "h6"
                        :color "inherit"}
     "BH"]
    [:> mui/Button {:color "inherit"} "Login"]]])

(defn app []
  [:div
   [header]])

lilactown18:05:12

What does “stopped working” mean?

stefan18:05:47

I haven’t had any issues so far, my imports are structured like

["@material-ui/core/Button" :default button]
            ["@material-ui/core/Switch" :default switch]
            ["@material-ui/core/Textfield" :default textfield]
            ["@material-ui/core/FormControl" :default form-control]
            ["@material-ui/core/FormControlLabel" :default form-control-label]
            ["@material-ui/core/InputLabel" :default input-label]
            ["@material-ui/core/Typography" :default typography]
            ["@material-ui/core/Select" :default select]
            ["@material-ui/core/MenuItem" :default menu-item]
            ["@material-ui/core/Dialog" :default dialog]
            ["@material-ui/core/DialogTitle" :default dialog-title]
            ["@material-ui/core/Paper" :default paper]
            ["@material-ui/core/styles" :rename {withStyles with-styles}]
            ["@material-ui/icons/Add" :default add]

dangercoder18:05:55

this is the error i keep on getting

dangercoder18:05:49

Looks like some hot reloading issue?

dangercoder18:05:00

@U9MJTSS9K which version of material-ui are you on?

dangercoder18:05:31

hmm.. same here, wierd.

stefan18:05:42

looks like one of the hiccup forms is returning nil

stefan18:05:00

from the error message

dangercoder18:05:07

in the chrome tools it warns: it fails to load the material ui components e.g module$node_modules$$material_ui$core$Paper$Paper

stefan18:05:31

I think it may be how you are requiring the components

stefan18:05:33

does it work if you switch to

(:require ["@material-ui/core/AppBar" :default AppBar])

dangercoder18:05:50

(:require
   ["@material-ui/core/AppBar" :default app-bar]
   ["@material-ui/core/Toolbar" :default tool-bar]
   ["@material-ui/core/Button" :default button]
   ["@material-ui/core/Typography" :default typography]
   ["@material-ui/core/Menu" :default menu]
   [reagent.core :as r]))

(defn header []
  [:> app-bar {:position "static"
               :color "primary"}
   [:> tool-bar
    [:> typography {:variant "h6"
                    :color "inherit"}
     "App-Title"]]])

(defn app []
  [:div
   [header]])
updated to this

dangercoder18:05:02

does not help 🙂 same error

dangercoder18:05:34

it fails to load the node modules somehow

dangercoder18:05:38

Now it works again.

dangercoder18:05:49

ran: npm dedupe npm ls and added (to shadow-cljs.edn):

[com.google.javascript/closure-compiler-unshaded "v20190325"]
   [org.clojure/google-closure-library "0.0-20190213-2033d5d9"]
😄 ...

chepprey23:05:42

I have a very small shadow-cljs app running, connected to REPL w/ Emacs. I have a core.async go-loop that starts up and parks waiting for input from a channel. What happens to the go-loop when I 1) hit Save in the editor, does that original go-loop keep running? Does an additional go-loop get created each time I hit Save? Do I need to add some kind of lazy-init/singleton/safeguard logic to ensure the go-loop is only created once? Is there a recommended pattern to follow? And then 2) same questions, except for hitting Reload in the browser (rather than Saving sourcecode)

polymeris03:05:28

1) the original channel should stay open 2) you'll lose all state (including channels)

chepprey23:05:45

(and lmk if this is a better question for the core.async channel, which I just now learned exists)