Fork me on GitHub
#clojurescript
<
2021-04-22
>
stopa10:04:06

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!

thheller11:04:09

@stopachka esbuild doesn't understand the closure js format used by the closure-library and cljs, so using it is not an option.

👍 2
stopa13:04:34

Gotcha, thanks @thheller. By doesn’t understand, is it that it won’t compile, or won’t do tree shaking correctly?

magra15:04:27

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?

Aron16:04:01

sorry if this is redundant, just to be sure, have you seen this? https://swannodette.github.io/2013/07/12/communicating-sequential-processes/

thanks2 2
ivana21:04:47

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?

ivana23:04:20

Works with :compiler-options {:optimizations :simple} , seems that node 14 is too fresh