This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-10-12
Channels
- # beginners (58)
- # boot (4)
- # calva (1)
- # cider (13)
- # cljdoc (1)
- # cljs-dev (7)
- # cljsrn (14)
- # clojure (93)
- # clojure-canada (1)
- # clojure-conj (1)
- # clojure-germany (1)
- # clojure-italy (6)
- # clojure-losangeles (3)
- # clojure-nl (8)
- # clojure-spec (6)
- # clojure-uk (77)
- # clojurescript (3)
- # cursive (5)
- # data-science (6)
- # datomic (52)
- # emacs (1)
- # figwheel-main (2)
- # fulcro (6)
- # graphql (7)
- # jobs (9)
- # leiningen (1)
- # luminus (15)
- # mount (14)
- # off-topic (94)
- # pedestal (1)
- # re-frame (7)
- # reagent (10)
- # shadow-cljs (75)
- # spacemacs (4)
- # test-check (15)
- # tools-deps (23)
- # unrepl (1)
Hi, I'm having a problem when using advanced compilation using the posh library (with rum) that does reactive queries from datascript. Code works fine when using :simple optimisation but reactions do not happen with :advanced. Does anyone know a way of setting a clojurescript library to not be included in the advanced optimisation (like using externs for js?)
@tobias291 I don’t think thats possible, ideally you find the problem and make a pr, could be something like https://github.com/oliyh/re-graph/issues/15 (oliyth mentions some differences in settings there which might fix your problem)
look for field accessors might help, https://github.com/oliyh/re-graph/commit/adf6847dd71850f20ef5b241e2ed2c2ee76a315c
@gklijs thankyou - I can't find anything obvious, I think I'll create a simple test case to track down further - do you know if it's possible to get optimisation information from the compiler?
I don’t really know, especially not for shadow-js, maybe you can have a source map with the advanced compilation and find out which function gives unexpected results?
@tobias291 it is not possible to exclude certain CLJS code from :advanced
. which posh
version do you use? the default one uses an invalid :require
and doesn't compile at all
@thheller I'm using a branch I made with fixes here - https://github.com/tobiasquinn/posh/tree/master-rum - and a merge from pull request here - https://github.com/mpdairy/posh/pull/30 - I'm getting closer to the problem, something isn't being pushed through to the update analysis so I'm using console outputs to compare compiled and release builds and trace back
it may just be missing the datascript externs? they are broken. I opened a PR quite some time ago https://github.com/tonsky/datascript/pull/216
can I just say what an awesome tool shadow-cljs is. I used it on 3 different cljs projects and it’s just pure awesomeness and I think there is no excuse for js devs not to switch to cljs forever
Want to use Shadow with Expo (instead of Figwheel+Expo). Not looking to replace Metro bundler, would like to run that separately. Any examples or experiences of people doing this? (I know about thheller's clojureverse post, but that replaces Metro, which is more than I want to do)
@thheller thankyou so much! That fixed it, I used the method in the PR comments of including the datascript externs.js in my compiler options
@aaron51 you can use :npm-module
with expo
. it works ok-ish. https://shadow-cljs.github.io/docs/UsersGuide.html#target-npm-module
but I have virtually no experience with react-native and didn't get very far last time
hello, I'm trying to connect to a node-js repl with Shadow, I can run npx shadow-cljs node-repl
and it starts fine, but that REPL runs on the terminal only, I want to connect and send commands from my editor, but when I connect to the nREPL I only get the Clojure one, how can I transition that to run from my editor targeting the node repl?
same as always. over nrepl just call (shadow.cljs.devtools.api/repl :node-repl)
so switch the nrepl session over
ok, I think I just figured, running (shadow/node-repl)
did the trick
that is simpler I think, I just start the server, connect nREPL and run that 🙂
thanks
I think that's fine, but taking the opportunity we are talking about REPL, in the Clojure REPL's when we send a form from the editor that form runs in the same NS as the file from where you ran it, but in CLJS it always use the current ns on the REPL, do you know why is the difference? and if we could have cljs to do the same as clj?
gotcha, thanks for clarifying
"(in-ns 'shadow.cljs.devtools.api)\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n(def ^:dynamic *nrepl-cljs* nil)"
interesting, I had no idea about that
{:file "(in-ns 'shadow.cljs.devtools.api)\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n(def ^:dynamic *nrepl-cljs* nil)", :file-name "api.clj", :file-path "C:/Users/thheller/code/shadow-cljs/src/main/shadow/cljs/devtools/api.clj", :id "a2b09333-3223-4d43-9cb6-54236e79dbb8", :op "load-file"}
its already kinda cheating since it uses load-file
without an actual file (thats the full nrepl message that gets sent)
for cljs its just {:code "(prn :foo)", :id "549215c5-9e36-4eb9-9e8e-f17288de92bf", :ns "demo.browser", :op "eval"}
nice, so we gonna get it to run in file ns? 🙂
got completely distracted by the fact that a different nrepl message is sent for CLJ
glad you just revisited it 😛
it prints the port the repl is on (configurable if you wanted). I'd just look up how to connect to a remote repl in fireplace
yea sorry I'm looking at the fireplace docs and not seeing anything about connecting to an nrepl, maybe my assumption about it was incorrect
It says to connect to cljs repl, I need to use piggieback. But then shadow doesn’t use piggieback, so I don’t know what to do now.
I haven't used vim-fireplace before, but however you would connect to a piggieback connection should work?
I wish I understood how to use vim and it's package management so I could explore more hehe
TPope's Pathogen and related writings is a good resource Will.