Fork me on GitHub
#shadow-cljs
<
2020-10-28
>
misha15:10:52

greetings! is there a way to access js var foo from js module(?) which does not export it? specifically https://github.com/paulrosen/abcjs/blob/master/src/write/abc_glyphs.js#L21

(:require ["abcjs/src/write/abc_glyphs"]); :refer [glyphs]]
exposes only 1 top-level var:
module.exports = Glyphs;
https://github.com/paulrosen/abcjs/blob/master/src/write/abc_glyphs.js#L234

misha15:10:38

I tried every combination from table in https://shadow-cljs.github.io/docs/UsersGuide.html#_using_npm_packages with no success

thheller15:10:53

which var do you want to access? in general you cannot access var unless it is part of some exported object

misha15:10:31

1st link:

var glyphs =

thheller16:10:21

nope can't get that

😞 3
misha16:10:42

thank you

thomas16:10:49

For some reason when I change my code the the code in the browser doesn't update.... :thinking_face:

thomas16:10:30

I can see the reload image, but the DOM doesn't change. I only have a inti function.

thheller17:10:21

like missing a ^:dev/after-load tagged function to do the actual re-render

thomas18:10:53

that did the trick, thank you @thheller. I didn't see that in any of the examples though I looked at. I must have missed something.

thheller18:10:34

maybe they have the old style :after-load in the build config https://shadow-cljs.github.io/docs/UsersGuide.html#_hot_code_reload

Michael W19:10:47

@thheller What version did hot-reload change? I have a problem with watching telling me the code is stale even if it compiles from scratch. I have a :devtools :after-load function, and nothing is tagged with ^:dev/after-load in my code. I recently upgraded to the newest shadow-cljs.

thheller19:10:37

it didn't change. both versions work.

Michael W19:10:27

@thheller I had tried to downgrade and still have the same problem with stale output. Thanks anyways. Any pointers on troubleshooting shadow-cljs processes to find my issue? Still new to clojure and not sure how to find my issue. It seemed to start happening when I upgraded several libs but I have gone back to my last working commit and still shadow tells me I have stale output, even when I completely clear all caches, and see it compile everything from scratch. I also rebooted my laptop just in case there was a process running headless or detached.

thheller20:10:18

@michael819 there isn't much to it. I assure you that you not loading the correct output if you get stale output warnings.

thheller20:10:36

make sure all your paths are exactly like you expect them

thheller20:10:00

I mean just delete the output files you think you are working with and reload the page

thheller20:10:19

if that doesn't give you 404s then you need to track down the files you are actually loading

flyboarder23:10:29

@thheller is there a way to update closure library to a newer version?

thheller23:10:48

I guess you can kinda make your own release?

thheller23:10:50

shadow-cljs is just using the CLJS-released version which has no new release

flyboarder23:10:03

yeah looks to be a year out of date so far

thheller23:10:11

yeah its not updated very frequently