Why does the download button behavior on local development depend on the build using `shadow-cljs watch app` or `shadow-cljs serve`?

Viewed 23

I have been using Clojure, ClojureScript, lein, shadow-cljs, Emacs, and CIDER to work on a Clojure/ClojureScript dynamic web app project.

The UI has a download button. For the purpose of this SO question, let's abstract it as an interface with the database that gets data in the UI and put the data in an Excel Spreadsheet. Not sure if this is relevant, but the database is handled by Firebase.

It is important to highlight that this Download button works in production.

However, this Download button has a weird behavior in localhost depending on the build approach:

1 - If I build the project by executing the command cider-jack-in-cljs in Emacs, choosing shadow-cljs, then shadow for REPL type, and, finally, app for the building option the build is successful. Things work in general in localhost - except for the download button. The application hangs and the download is not executed.

2 - If I build the project with shadow-cljs watch app things work in general in localhost - except for the download button. The application hangs and the download is not executed.

3 - Lastly, but not least, if I build the project with $ shadow-cljs server. Things work in general in localhost, including the download button!

Thus, I would like to ask:

(i) - Why does the behavior of this feature depend on the build process?

(ii) - Why is $shadow-cljs server successful while other approaches are not?

(ii) - Approach 1 uses an interface with Emacs to build and 2 uses a raw terminal. I am not sure if they are exactly the same build process, but I believe they are equivalent. Are they?

0 Answers
Related