Fork me on GitHub
#shadow-cljs
<
2019-01-20
>
hmaurer01:01:30

Playing with shadow tonight and just found out about the dashboard (to turn builds on/off, etc). It’s awesome; great work @thheller! 🙂

thheller10:01:20

so much left to do for the UI though 🙂

hmaurer14:01:30

Are there any features you would like to add, over the top of your head?

wombawomba13:01:05

It seems like shadow-cljs (2.7.16) will only occasionally reload my css code when I modify it. Any idea what could be the cause? How can I debug this?

wombawomba13:01:24

If I keep saving my file, it eventually reloads, but it typically takes 3-5 saves.

wombawomba13:01:07

FWIW I’m running shadow-cljs watch app on OSX

thheller13:01:31

@wombawomba not sure. nothing in that area of the code was touched for a very long time

thheller13:01:08

you can set

:verbose true

 :log {:level :debug}

wombawomba13:01:10

yeah, I had the same issue in 2.3.0 before upgrading

thheller13:01:13

in the top level shadow-cljs.edn config

wombawomba13:01:59

@thheller I set those options and I seem to get more verbose logging, but nothing is printed on CSS reloads

wombawomba13:01:29

maybe I just have a rogue shadow-cljs process somewhere and this is some kind of race condition?

thheller13:01:52

possible although both should be reloading the css then

wombawomba13:01:59

nope, that’s not it

thheller13:01:33

hmm yeah the css reload doesn't log anything

thheller13:01:47

you can check the browser console websocket if you get the css reload message

thheller13:01:50

it does reload fine for me

wombawomba13:01:19

I do get the message in the browser, but only when the reload actually works

wombawomba13:01:45

can I run a checked out version of shadow-cljs somehow, and add my own logging?

wombawomba13:01:55

also, where in the code does the CSS reloading happen?

thheller13:01:04

you can just clone the repo and run lein install

wombawomba13:01:46

hmm… how do I run the lein installed code?

thheller13:01:11

just start your shadow-cljs normally after install

wombawomba13:01:18

oh okay, neat

thheller13:01:19

this is pretty much the only thing related to css update on the server

thheller13:01:40

fs-watch is used for everything file watching related

thheller13:01:03

you can add a log here

thheller13:01:21

thats the code that takes the fs-watch events and forwards them to the websockets

thheller13:01:18

thats the client update side

thheller13:01:50

are you running in a container or otherwise mounted filesystem maybe? maybe the fs-watch just misses the event

wombawomba13:01:44

nope, just straight up OS X

wombawomba13:01:43

but I think I’ve solved the problem 🙂

thheller16:01:47

@wombawomba which editor do you use? the order of events seems to depend on how the editor saves actual files

wombawomba16:01:30

I used Neovim

wombawomba16:01:48

what’s weird is that fsnotify always correctly detects the writes as a single file change (see “Additional Details” at the bottom of the issue)

thheller16:01:49

I suspect that neovim creates a temp file and then moves/renames that file to replace the old one

thheller16:01:05

I think emacs does that too

thheller16:01:30

editors are weird that way 😛

wombawomba17:01:35

So I just upgraded from shadow-cljs 2.3.0 to 2.7.16, and this seems to have broken the way I use auth0-lock (https://github.com/auth0/lock). My dependency is "auth0-lock": "^11.13.0" and I require it via (:require [auth0-lock :refer [Auth0Lock]]). In shadow-cljs 2.3.0 Auth0Lock is an object, but in 2.7.16 it’s nil. Any idea why?

wombawomba18:01:48

played around with different shadow-cljs versions, and it seems like it fails starting with shadow-cljs 2.4.8 (https://github.com/thheller/shadow-cljs/releases/tag/2.4.8)

wombawomba19:01:44

for the versions where it fails, I get the following error in the browser console:

wombawomba19:01:51

shadow.js.js:82 Uncaught TypeError: Cannot read property 'lib' of undefined
    at auth0.min.js:9
    at auth0.min.js:9
    at createCommonjsModule (auth0.min.js:9)
    at auth0.min.js:9
    at auth0.min.js:9
    at Object.shadow$provide.module$node_modules$auth0_js$dist$auth0_min (auth0.min.js:9)
    at shadow.js.jsRequire (shadow.js.js:79)
    at Object.shadow$provide.module$node_modules$auth0_lock$lib$utils$cdn_utils (cdn_utils.js:8)
    at shadow.js.jsRequire (shadow.js.js:79)
    at Object.shadow$provide.module$node_modules$auth0_lock$lib$i18n (i18n.js:37)

thheller19:01:22

@wombawomba that is odd. try settings :js-options {:variable-renaming :local} in your build config

thheller19:01:30

that was the previous default

thheller19:01:43

unfortunately it seems that some npm libs only work with one setting while the others only work with the other