lein-figwheel

richiardiandrea 2016-12-28T22:24:40.000335Z

@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)

bhauman 2016-12-28T22:27:37.000336Z

Looks like an undefined atom

bhauman 2016-12-28T22:34:33.000337Z

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

bhauman 2016-12-28T22:34:46.000338Z

Are you live reloading figwheel itself?

richiardiandrea 2016-12-28T22:35:29.000339Z

@bhauman well yeah 😄

richiardiandrea 2016-12-28T22:35:52.000342Z

on-load-callbacks

bhauman 2016-12-28T22:35:57.000343Z

no I think the atom is defined

richiardiandrea 2016-12-28T22:36:00.000344Z

ah

richiardiandrea 2016-12-28T22:36:14.000345Z

yep I can deref it in the console

bhauman 2016-12-28T22:36:14.000346Z

its a problem where the prtocols are blown away

bhauman 2016-12-28T22:36:36.000347Z

the swap protocol got blown away off of the Atom

richiardiandrea 2016-12-28T22:37:09.000349Z

woah that's weird

bhauman 2016-12-28T22:37:15.000350Z

you can't reload cljs.core

richiardiandrea 2016-12-28T22:37:22.000351Z

oh

richiardiandrea 2016-12-28T22:37:29.000352Z

ok that might be the problem then

richiardiandrea 2016-12-28T22:38:01.000354Z

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

bhauman 2016-12-28T22:38:08.000355Z

figwheel prevents you from reloading cljs.core

richiardiandrea 2016-12-28T22:38:12.000356Z

cljs.core included

richiardiandrea 2016-12-28T22:38:22.000357Z

good, I am happy I have asked!

richiardiandrea 2016-12-28T22:39:40.000361Z

no scratch that

richiardiandrea 2016-12-28T22:40:33.000362Z

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

bhauman 2016-12-28T22:40:50.000363Z

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

richiardiandrea 2016-12-28T22:42:24.000364Z

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

bhauman 2016-12-28T22:43:49.000366Z

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

bhauman 2016-12-28T22:43:56.000367Z

and that can't be true

bhauman 2016-12-28T22:44:08.000368Z

because cljs.core doesn't change

richiardiandrea 2016-12-28T22:44:11.000369Z

yeah, no I am going to filter that for sure

bhauman 2016-12-28T22:44:25.000370Z

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

richiardiandrea 2016-12-28T22:44:36.000371Z

sorry, I mean filtering the change set

bhauman 2016-12-28T22:45:16.000372Z

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

bhauman 2016-12-28T22:45:37.000373Z

it should never be cljs.core etc

bhauman 2016-12-28T22:45:57.000374Z

and the first compile needs to be ignored

richiardiandrea 2016-12-28T22:46:44.000375Z

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

richiardiandrea 2016-12-28T22:47:01.000376Z

so the next time I compile it rewrites all of them

richiardiandrea 2016-12-28T22:47:09.000377Z

which means everything changed

bhauman 2016-12-28T22:47:18.000378Z

well thats a PITA

richiardiandrea 2016-12-28T22:47:26.000379Z

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

richiardiandrea 2016-12-28T22:47:58.000380Z

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

bhauman 2016-12-28T22:48:08.000382Z

so what you can to is md5 the files

richiardiandrea 2016-12-28T22:48:10.000383Z

and see what happens

richiardiandrea 2016-12-28T22:48:20.000384Z

boot does it by default

bhauman 2016-12-28T22:48:29.000385Z

but keep track

richiardiandrea 2016-12-28T22:48:35.000386Z

but if the previous fileset is empty

bhauman 2016-12-28T22:48:38.000387Z

and only send the changed ones

bhauman 2016-12-28T22:48:43.000388Z

save the state

bhauman 2016-12-28T22:48:46.000389Z

in an atom

richiardiandrea 2016-12-28T22:49:39.000390Z

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

bhauman 2016-12-28T22:49:58.000392Z

hmmmm weird

richiardiandrea 2016-12-28T22:50:26.000393Z

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

richiardiandrea 2016-12-28T23:31:16.000394Z

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?