This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-02-02
Channels
- # announcements (1)
- # babashka (6)
- # beginners (53)
- # cider (2)
- # circleci (2)
- # clj-kondo (1)
- # cljdoc (1)
- # clojars (2)
- # clojure-berlin (1)
- # clojure-europe (23)
- # clojure-serbia (1)
- # clojure-spec (2)
- # clojure-uk (9)
- # clojurescript (12)
- # datomic (34)
- # emacs (1)
- # fulcro (46)
- # leiningen (15)
- # planck (3)
- # re-frame (46)
- # reitit (17)
- # remote-jobs (4)
- # shadow-cljs (17)
- # sql (3)
- # tools-deps (2)
Hi! Does anyone have any recommendations on using indexedDB in cljs? I am trying to figure out what's the best way to store structured data for an offline cljs app, don't have any prior experience with thath.
If you can't find anything better, Transit will probably work. Maybe you can even prevent if from writing JSON strings and get JS objects directly.
How does one call the process of the Closure advanced compilation cutting away unused code? tree-shaking? it seems they don't use this word themselves: https://developers.google.com/closure/compiler/docs/api-tutorial3
Tree shaking in the JS world is usually done at the module level (find that a module is unused, remove the import entirely). AFAIK, DCE is much more aggressive and efficient, it can go down at the function level and also inline small functions and so on.
The downside is that Google Closure needs to know about the entire program, which probably means it can’t apply anything to npm stuff.
(Since they are usually taken out of the compilation process and treated as a binary blob)
The NPM code is still passed through GCC (at least, with shadow-cljs). But the optimizations level is set to simple, so no DCE.
This is probably a dumb question, but how do I await a promise in cljs? I can't seem to find anything about that, except for using a promesa library. I am using a js library (Dexie) that returns promises.
You can use promises directly via intereop syntax (.then p f)
Yes, that I am using now, wanted to know whether I can do await, seems like the answer is no. Will use callbacks, thank you!