This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-09-18
Channels
- # 100-days-of-code (10)
- # announcements (2)
- # aws (3)
- # beginners (120)
- # boot (6)
- # calva (6)
- # cider (22)
- # cljsrn (3)
- # clojure (145)
- # clojure-greece (1)
- # clojure-italy (7)
- # clojure-nl (24)
- # clojure-russia (90)
- # clojure-spec (21)
- # clojure-uk (80)
- # clojurescript (175)
- # core-async (1)
- # datomic (17)
- # emacs (8)
- # ethereum (5)
- # figwheel (1)
- # figwheel-main (140)
- # fulcro (137)
- # jobs (6)
- # jobs-discuss (3)
- # luminus (3)
- # mount (1)
- # nyc (3)
- # off-topic (39)
- # onyx (1)
- # pedestal (1)
- # re-frame (21)
- # reagent (13)
- # shadow-cljs (60)
- # spacemacs (25)
- # test-check (4)
- # tools-deps (14)
- # uncomplicate (3)
- # vim (18)
I’m hoping someone can help me understand a bit of the piggieback docs with respect to setting up through fireplace and accommodating foreign libs:
> When using Piggieback to enable a browser REPL: the ClojureScript compiler defaults to putting compilation output in out, which is probably not where your ring app is serving resources from (resources, target/classes/public, etc). Either configure your ring app to serve resources from out, or pass a cljs-repl :output-dir option so that a reasonable correspondence is established.
so at the repl I’m manually instantiating an nrepl, spitting out .nrepl-port
OK, evaluating fine through fireplace as long as it’s CLJ
I’m using figwheel, and starting that up OK via (figwheel.main.api/start "dev")
(using a dev.cljs.edn
at my project root)
I’m using reagent, but React is coming in through a foreign-lib (using the clojurescript-webpack setup on http://clojurescript.org) and so I’m excluding from the reagent dep, ie. reagent {:mvn/version "0.8.1" :exclusions [cljsjs/react cljsjs/react-dom cljsjs/react-dom-server cljsjs/create-react-class]}
and if my vim buffer is in a namespace that requires reagent, the Fireplace eval blows up with clojure.lang.ExceptionInfo: No such namespace: react, could not locate react.cljs, react.cljc, or JavaScript source providing "react" in file file:/Users/rgm/.m2/repository/reagent/reagent/0.8.1/reagent-0.8.1.jar!/reagent/core.cljs {:tag :cljs/analysis-error}
(and long stacktrace follows)
note that figwheel’s clojurescript compile is picking up the foreign-lib react just fine (evidence: the browser app works, and using a cljs-repl outside vim can eval within namespaces and the browser picks up the results, eg. if I do a re-frame dispatch I see the UI change appropriately)
it just seems like Piggieback doesn’t know about the foreign libs, so I’m wondering if it doesn’t know to look at target/public/cljs-out/dev
for build products
Can I configure piggieback somehow to look at Figwheel’s build dir target/public/cljs-out/dev
, or is it better to change Figwheel to put the build products where piggieback seems to require them to be? (ie. out/
)
(btw huge thanks to whoever wrote this guide to vim in the figwheel-main repo docs: https://github.com/bhauman/figwheel-main/blob/master/docs/docs/vim.md)