Disable reloading for web

Hi guys, quick question that has already been asked, but with no satisfactory answer.

I’m developing mostly using web mode. I already have a non-expo-related reloading mechanism in place. Whenever I do changes to the code, I see the update in the browser immediately.

But then, 1-2 seconds afterwards, another reloading mechanism kicks in, that takes an annoyingly long amount of time (3-4 seconds) and refreshes the entire web page.

I assume that it is expo-related (not sure though) and that it’s either hot- or live reloading. Is there any way to disable it?

Thanks in advance.

As a matter of interest, what is this other reloading mechanism?

Are you perhaps using shadow-cljs?

Is this one of the unsatisfactory answers you’ve seen before?

Holy cow, I am indeed using shadow-cljs. That looks like a very satisfactory answer, thank you very much.

The request is not getting blocked for some reason, but this feels like the right direction

1 Like

I have not tried this myself, but have been meaning to see if I can get a project working with shadow-cljs.

Good luck, and let us know if you find the answer.

I wonder if @bacon has the answer.

Yea, finally found the answer. The reloading mechanism is coming from webpack-dev-server (running in version 3.11.0 on my machine). In order to get rid of it, I

  • ran expo with customize:web and selected to create a webpack.config.js
  • added config.devServer.watchOptions.ignored = [/.*/]; to webpack.config.js

The settings:

config.devServer.hot = false;
config.devServer.inline = false;
config.devServer.liveReload = false;

didn’t seem to do anything.

Thanks for you help.

@wodin: I’m finally quite comfortable with my cljs/shadow/expo - setup. Right now I get about 50% feedback from the REPL, 40% from the browser and the last 10% I spend fixing stuff that works in the browser, but not on my mobile. Let me know if you need any help setting it up.

2 Likes

Thanks :slight_smile:

I am rather short on time at the moment, but I might take you up on your offer.

But maybe some updates to this would help people trying to use ClojureScript with Expo, if you have the time:

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.