Fork me on GitHub
#admin-announcements
<
2015-08-20
>
atroche01:08:37

so I want to make a cljsjs package for https://github.com/callemall/material-ui, but there's no single file to build externs from, unlike react-bootstrap, which has the https://github.com/react-bootstrap/react-bootstrap-bower project. when I try to build material-ui using webpack, it bakes react into the compiled JS, which is not what I want at all. any ideas?

atroche01:08:03

whoops, will take this to #C03S1L9DN

chipf0rk14:08:21

@magnars: For Episode 01, I'm having a bit of a problem with reloaded.repl... I'm fairly sure I did everything like you did, but I'm not getting reloading on save; i.e. when I change the app handler and save the file, then reload the page, the old handler will still be executed. Is there some key combo that triggers reloading manually here?

Chris Bidler14:08:44

@chipf0rk: are you calling (reset) in the repl? I think that the figwheel autobuild watches the filesystem for changes while the server side requires a manual invocation to refresh the system

chipf0rk14:08:00

no, and i'm not even at figwheel yet :)

chipf0rk14:08:14

it wasn't (visibly) called in the video at that point, that's what got me confused

chipf0rk14:08:17

do I have to?

Chris Bidler14:08:44

I think so, I’m working through potd myself in my copious spare time, gimme a minute to set up a clean project and I’ll let you know simple_smile

chipf0rk14:08:08

cool, thanks!

Chris Bidler14:08:09

also @magnars++ for creating a thing that has finally managed to make grok a reloaded + figwheel workflow

magnars15:08:28

@chipf0rk @chris_johnson: (reset) will certainly take care of things. But since your application is running in the same REPL as your CIDER session, you can push changes with C-c C-k which evaluates the buffer. C-c C-x will refresh all changed files. I did notice however, that I often don't even have to do that, and the changes will be immediately apparent with no intervention from me. I have no explanation for that phenomenon however.

magnars15:08:01

Come to think of it - maybe clj-refactor evaluates my code when it parses the AST? That might be an explanation actually.

chipf0rk15:08:54

cool, thank you :)

chipf0rk15:08:40

Guess I'm really used to Figwheel, it's so straightforward... Clojure reloadable tooling seems to lack in comparison

magnars15:08:44

automatic reloading of backend code might lead to unwanted side-effects if you're not careful (launch-the-missiles), so I guess that's one reason .

magnars15:08:18

so maybe I should try to figure out why my code is being reloaded automatically at times before something bad happens 😄

chipf0rk15:08:49

but so could frontend code, by calling (create-new-missile) that talks to the API :D

chipf0rk15:08:19

I mean it's mostly dev tooling anyways, I'd like it if it worked similarly for Clojure

chipf0rk15:08:36

But I guess I can think of some challenges to implement it like that

magnars15:08:28

it's fairly straight-forward to implement in Emacs

chipf0rk15:08:39

Not having "clients" connected through WebSockets that you can push to etc. Maybe there's stuff that works like Figwheel but I just haven't found it yet. I'm also much more of a JS than a Java guy, so I probably don't fully get it 😉

chipf0rk15:08:38

I think I've had something before but people warned of its usage in the comments. I got scared I guess

chipf0rk15:08:50

With Emacs, I mean :)

magnars15:08:34

(add-hook 'before-save-hook 'cider-load-buffer t t) would enable it for a single buffer, and that could be added to cider-mode-hook. Should probably add a check that you're in a .clj file.

chipf0rk15:08:31

I might try that next time, thank you!