This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-03-26
Channels
- # architecture (2)
- # beginners (310)
- # boot (34)
- # cider (50)
- # cljs-dev (82)
- # cljsrn (1)
- # clojure (125)
- # clojure-dusseldorf (1)
- # clojure-hamburg (1)
- # clojure-italy (47)
- # clojure-russia (21)
- # clojure-spec (38)
- # clojure-uk (36)
- # clojurescript (200)
- # community-development (21)
- # cursive (10)
- # datomic (15)
- # duct (58)
- # emacs (20)
- # fulcro (10)
- # funcool (1)
- # graphql (2)
- # hoplon (6)
- # jobs (1)
- # lumo (12)
- # mount (20)
- # off-topic (14)
- # om (5)
- # portkey (43)
- # protorepl (2)
- # re-frame (31)
- # reagent (36)
- # ring (17)
- # ring-swagger (6)
- # shadow-cljs (50)
- # spacemacs (9)
- # sql (5)
- # tools-deps (28)
- # uncomplicate (4)
- # unrepl (5)
- # vim (2)
- # yada (2)
do you remember if the google closure bug we found last month was fixed already, the one you opened the ticket for? @thheller
https://github.com/google/closure-compiler/issues/2822 ok found it, I’ll give the new clojurescript release a try without targeting older closure compiler…
nevermind what I said, the release from 6 days ago v20180319 with the fix for #2822 isn’t on maven https://mvnrepository.com/artifact/com.google.javascript/closure-compiler-unshaded yet
@mhuebert @lwhorton regarding watch
via clj-run
. https://shadow-cljs.github.io/docs/UsersGuide.html#_calling_watch_via_clj_run since 2.2.19
great. re: how the server persists, would it quit when I hit ctrl-c in that terminal window?
I'm attempting to include the "sql.js" NPM module. It works in dev mode, but not in release, unless I set the :optimizations :simple
compiler flag. In release mode, some of its functions work, except for one. I'm wondering what's going on and how best to troubleshoot. I can live with :simple
optimizations, but I'm curious what's causing the problem.
@lee.justin.m Uncaught TypeError: b.wb is not a function
automatic type inferences arn’t working. is your :infer-extern :auto
set? https://shadow-cljs.github.io/docs/UsersGuide.html#infer-externs
the actual call is (.prepare db "SELECT * FROM myTable WHERE MainID=? AND SubID=? AND ProtocolID=?;")
yes when I did that, the call works, but there's no result, whereas with :simple it actually works, which makes me think the library is getting optimized?
the actual javascript goes through normal minification only. the b.wb is not a function
is because something you are calling in clojurescript is getting munged. try this : (.prepare ^js db "SELECT * FROM myTable WHERE MainID=? AND SubID=? AND ProtocolID=?;")
if that doesn’t work, then something in the minification process is actually messing with the javascript source, though that really shouldn’t happen
actually, I don’t think changing compiler optimizations changes anything with regard to javascript, so that can’t be it.
make sure you are positive that there is a different outcome on the prepare statement--maybe the prepare is working but something else is failing? if not, then there is a bug that @thheller will have to take a look at
I assume you’re targeting node. I don’t know that there is any reason to do optimizations on node. Optimizations are about space efficiency, not time efficiency, as far as I know.
@lee.justin.m using the following minimal test, the row result is empty with optimizations and filled with :simple:
(def sql (js/require "sql.js"))
(def fs (js/require "fs"))
(defn testDB []
(let [dbPath "/my/db/path"
fb (.readFileSync ^js fs dbPath)
db (new (.-Database ^js sql) fb)
stmt (.prepare ^js db "SELECT * FROM tblTreatment WHERE MainID=? AND SubID=? AND ProtocolID=?;")
_ (.bind ^js stmt (clj->js [1 1 1]))
_ (.step ^js stmt)
row (js->clj (.getAsObject ^js stmt))
_ (println "ROW: " row)
]))
@thosmos awesome! thanks! hey could you do me a favor and open up a ticket in github? that way thomas will see it.
oh, hmm, maybe this is relevant: I've been doing this in the renderer process. I just tested it in the main process and it works in release mode when it doesn't in the browser. in the main process, the target is :node-script, whereas in the renderer it's :browser
this is for an electron app which has two processes, one is the node app and the other is the browser app. they both have access to npm modules
but what this suggests is that in release mode, the :browser target seems to be doing something different than the :node-script target
seems weird. handling npm modules on the browser is shadow’s raison d’etre. node is a later addition (as I understand it)