Hey team! Curious q — has anyone played with using esbuild instead of closure compiler for cljs? Their speed seems so enticing. From a light look they have tree shaking, but don’t compare yet in terms of advanced optimization. I wonder if this can be mitigated though—may spend some time poking around. If others have and got thoughts, please share!
@stopachka esbuild doesn't understand the closure js format used by the closure-library and cljs, so using it is not an option.
Gotcha, thanks @thheller. By doesn’t understand, is it that it won’t compile, or won’t do tree shaking correctly?
both
Hi!
I have a big state atom (fulcro) that I save to browser local storage. I add a watch on the atom. I wrote a diffing algorithm that only saves or deletes changes. I want the saving to occur after 2 seconds of idle time. In clojure I do similar things with a future that I put into an atom. Calls check the atom to see whether there is already a future pending and cancel the running future and create a new one. I found some examples here https://github.com/alandipert/storage-atom/blob/master/src/alandipert/storage_atom.cljs that use goog.Timer to do something similar. I took this, as well as plato, as inspiration but I need to retain the before-state of the watch so the actual diffing keeps the original before-state when the timer gets canceled. So instead of putting the goog.Timer directly into the atom I put a map of {fn: timer-fn :old old-state}
into the atom. It seems to work fine, but in the last weeks my app developed a memory leak and I do not know whether it could be related to this part of my code.
So my questions are:
• what would be an idiomatic way to do delayed saving in cljs?
• Are there good blog-posts on memory leaks in clojurescript?
• How does one hunt memory leaks?
• Are there any examples or discussions of how to go about this?
sorry if this is redundant, just to be sure, have you seen this? https://swannodette.github.io/2013/07/12/communicating-sequential-processes/
Hello. Cloned 2 simple VSCode plugins, written in cljs and built with shadow-cljs. Trying to shadow-cljs release :extension
on both of them and got extension.js
a half smaller than if I installed that extensions via VSCode, and my files doesn't work. Where I'm wrong? And how to build them correctly?
Works with :compiler-options {:optimizations :simple}
, seems that node 14 is too fresh