clojurescript

ClojureScript, a dialect of Clojure that compiles to JavaScript http://clojurescript.org | Currently at 1.10.879
2021-04-22T10:47:06.363500Z

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!

thheller 2021-04-22T11:57:09.364200Z

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

1👍
2021-04-22T13:34:34.365500Z

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

thheller 2021-04-22T13:37:19.366100Z

both

1👍
magra 2021-04-22T15:45:27.378900Z

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?

Aron 2021-04-22T16:45:01.379400Z

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

1
2021-04-22T21:53:47.383200Z

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?

2021-04-22T23:44:20.384300Z

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