Fork me on GitHub
#shadow-cljs
<
2020-07-30
>
dehli01:07:53

With it being a nodejs app I don’t really need to have advanced optimization since bundle size isn’t a big deal (unless there’s some other benefit I’m unaware of).

orestis07:07:13

I have a potentially weird request: can I just run an analysis over my .cljs code that will do macroexpansion but nothing else? We’re yet again trying to do translation extraction based on macros. We don’t care to generate JS code at all, just go over all of our source code (with no cache), macroexpand, then look at at some dynamic var that contains all our translation strings.

thheller08:07:03

@dehli there is no watch for release builds. you can run shadow-cljs server and then shadow-cljs release app whenever you want to rebuild. it'll be quick, just need to trigger it manually. or just use an external watcher to trigger that command. I recommend doing it manually since release optimizations can take a long time you usually end up compiling "prematurely" and then having another compile queue up.

thheller08:07:32

don't quite see a reason why you want watch with :simple though? whats wrong with just watch?

dehli11:07:23

thanks! the artifact produced with watch seems to require some dependencies (such as websocket). My idea of using watch with a simple build is that I could have that running and as I make changes I could very quickly deploy the updated code to AWS.

Teemu Kaukoranta08:07:19

Hi all! I'm trying to add https://github.com/gregnb/mui-datatables#install to our project. I'm already successfully using material-ui components, but this one I can't get to work. I'm requiring the component with ["mui-datatables" :default MUIDataTable] (the readme has import MUIDataTable from "mui-datatables";), and my component looks like:

The issue is resolved, removed the code to not fill the whole channel

Teemu Kaukoranta08:07:07

I'm seeing a bunch of errors in my console, not sure which one is the most relevant one

Teemu Kaukoranta08:07:56

"Invalid Hiccup form: [nil]"

Teemu Kaukoranta08:07:09

> Warning: React.createElement: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: undefined. You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.

Teemu Kaukoranta08:07:31

☝️ This one looks important, but I don't really know what to do with this 😄

Karol Wójcik08:07:59

Check if MuiDataTable contains a value

Teemu Kaukoranta08:07:19

you mean just (println MUIDataTable)?

Teemu Kaukoranta08:07:18

I think I may have figured it out. I think mui-datatables requires material ui v4, and we only have v3

Teemu Kaukoranta08:07:28

that tip helped though, thanks a lot 🙂

Teemu Kaukoranta11:07:19

It works after updating material ui to v4. Thanks again for the nudge into the right direction Karol!

dehli12:07:37

Hi, I think I’ve found a performance bug with shadow and was wondering if anyone has seen something like it before. Calling (map js/JSON.parse (string/split-lines x)) takes approximately 10 seconds to run with an 7mb file on my local machine however running the equivalent with Javascript (using js/eval) is less than a second. The reason I think this is a shadow bug and not Cljs is that we’ve recently started to have our functions that do this timeout and it’s lining up with when we switched to shadow. I think it’s specifically the split-lines command that is taking much longer. I am using the latest version of shadow. My next step is going to make a minimal reproducible examples showcasing the differences between shadow, clj, and raw nodejs. Edit: Looks like it’s not unique to Shadow. I’m seeing the same performance differences w/ a regular Clojure repl. I guess it’s a coincidence that the bugs started showing up around the same time. Sorry about that!

ddellacosta16:07:30

Hi folks, apologies if this is common knowledge but I’m trying to start a cider repl via cider-jack-in-cljs (per https://shadow-cljs.github.io/docs/UsersGuide.html#cider). I’m never given the option to choose a build, instead apparently it tries to create one, and this fails since I’ve already got a shadow-cljs server running. I’ll note that I’ve also got a .dir-locals.el set up per the cider instructions but this seems to be getting ignored. On the other hand it seems like I can connect to the shadow-cljs server just fine by using cider-connect-cljs instead. It’s obviously not a problem since I’ve got it working, but it’s very much not what is in the reference either for shadow-cljs or cider. I will also note that I’m using lein for dependencies instead of the default--could this be causing this? Anyways, just curious, not a big deal since it seems like I’m up in running now.

thheller16:07:38

maybe better to ask in #cider. I don't use emacs so I don't know anything about this.

👍 3