Fork me on GitHub
#lein-figwheel
<
2016-12-28
>
richiardiandrea22:12:40

@bhauman have you ever encountered this error while reloading files by any chance?

ioc_helpers.cljs:42 Uncaught Error: No protocol method ISwap.-swap! defined for type cljs.core/Atom: [object Object]
    at Object.cljs$core$missing_protocol [as missing_protocol] (core.cljs:272)
    at Function.cljs.core._swap_BANG_.cljs$core$IFn$_invoke$arity$3 (core.cljs:756)
    at Function.cljs.core.swap_BANG_.cljs$core$IFn$_invoke$arity$3 (core.cljs:4303)
    at cljs$core$swap_BANG_ (core.cljs:4291)
    at file_reloading.cljs:303
    at file_reloading.cljs:289
    at file_reloading.cljs:289
    at figwheel$client$file_reloading$state_machine__12780__auto____1 (file_reloading.cljs:289)
    at figwheel$client$file_reloading$state_machine__12780__auto__ (file_reloading.cljs:289)
    at cljs$core$async$impl$ioc_helpers$run_state_machine (ioc_helpers.cljs:35)

bhauman22:12:37

Looks like an undefined atom

bhauman22:12:33

@richiardiandrea yeah some how your state of your runtime got way out of wack. That error should never happen.

bhauman22:12:46

Are you live reloading figwheel itself?

richiardiandrea22:12:29

@bhauman well yeah 😄

richiardiandrea22:12:52

on-load-callbacks

bhauman22:12:57

no I think the atom is defined

richiardiandrea22:12:14

yep I can deref it in the console

bhauman22:12:14

its a problem where the prtocols are blown away

bhauman22:12:36

the swap protocol got blown away off of the Atom

richiardiandrea22:12:09

woah that's weird

bhauman22:12:15

you can't reload cljs.core

richiardiandrea22:12:29

ok that might be the problem then

richiardiandrea22:12:01

because I am reloading stuff after an exception and it looks like I am reloading everything

bhauman22:12:08

figwheel prevents you from reloading cljs.core

richiardiandrea22:12:12

cljs.core included

richiardiandrea22:12:22

good, I am happy I have asked!

richiardiandrea22:12:33

anyways thanks a lot! I think I am very close to a first stable alpha

bhauman22:12:50

well so one of the things figwheel does is it ensures that you only reload files that are in the source directories and that actually change

richiardiandrea22:12:24

yeah I was wondering that, because I am running lein-figwheel in parallel on the same project to see what happens

bhauman22:12:49

you must be sending a signal to figwheel that cljs.core changed

bhauman22:12:56

and that can't be true

bhauman22:12:08

because cljs.core doesn't change

richiardiandrea22:12:11

yeah, no I am going to filter that for sure

bhauman22:12:25

but filtering isn't going to help I don't think

richiardiandrea22:12:36

sorry, I mean filtering the change set

bhauman22:12:16

yes I understand but the change set should only be the file that changed from edit and its dependents

bhauman22:12:37

it should never be cljs.core etc

bhauman22:12:57

and the first compile needs to be ignored

richiardiandrea22:12:44

unfortunately for what I can see, in boot when an exception happens, no file is written

richiardiandrea22:12:01

so the next time I compile it rewrites all of them

richiardiandrea22:12:09

which means everything changed

bhauman22:12:18

well thats a PITA

richiardiandrea22:12:26

maybe I am missing something (will ask in #boot)

richiardiandrea22:12:58

for now I can just filter the messages I send to the client

bhauman22:12:08

so what you can to is md5 the files

richiardiandrea22:12:10

and see what happens

richiardiandrea22:12:20

boot does it by default

bhauman22:12:29

but keep track

richiardiandrea22:12:35

but if the previous fileset is empty

bhauman22:12:38

and only send the changed ones

bhauman22:12:43

save the state

bhauman22:12:46

in an atom

richiardiandrea22:12:39

yep that is also already done in boot-reload, probably the case of an ex was handled differently

bhauman22:12:58

hmmmm weird

richiardiandrea22:12:26

there is no (reset! prev fileset) when an exception happens at the moment

richiardiandrea23:12:16

I have another random question, it reloads fine now, but the on-reload function does not get updated properly (aka, if I have a print in it, and I updated it, I never see the new string printed)...can this be due to pragma stuff and figwheel-load?