Hacker News new | ask | show | jobs
by ethan_smith 346 days ago
Shadow-cljs offers partial solutions to this with its runtime code reloading capabilities and source-maps in production, though true REPL attachment to production builds remains challenging due to the optimization/debug information tradeoff.
1 comments

I'm not sure what "REPL attachment to production build" would look like in terms of a client-side program like this?

Usually what I do in my ClojureScript programs is saving all the actions the user do into localStorage, offer a "Report Issue" button that shows a form with a description input, and submitting that form also submits the data from localStorage. Sometimes I also include the full app-state in there too, but often isn't even needed if the application is simple enough.

If you're using libraries like re-frame or similar, you basically get that for free, just need to persist the events somehow and associate them with a session/user.

So replicating issues that happened in the production build is a matter of replaying those same actions locally. Don't remember having any issues with this approach, and if you end up in the scenario where the same actions only trigger an error in the production build, then run that build locally but with sourcemaps and you'll be able to track down the issue quickly enough.