This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-11-26
Channels
- # bangalore-clj (3)
- # beginners (47)
- # boot (20)
- # cljs-dev (7)
- # cljsjs (16)
- # cljsrn (3)
- # clojure (46)
- # clojure-art (4)
- # clojure-berlin (1)
- # clojure-brasil (2)
- # clojure-greece (1)
- # clojure-india (5)
- # clojure-russia (1)
- # clojure-spec (34)
- # clojure-taiwan (2)
- # clojure-uk (8)
- # clojurescript (69)
- # cursive (9)
- # datascript (26)
- # datomic (1)
- # emacs (2)
- # events (1)
- # hoplon (8)
- # leiningen (3)
- # off-topic (4)
- # proto-repl (4)
- # re-frame (3)
- # reagent (1)
- # rethinkdb (8)
- # rum (3)
- # vim (83)
@dominicm I honnestly don’t know:
I lein repl
, (use ‘figwheel-sidecar.repl-api)
, (start-figwheel!)
, (cljs-repl)
my project.cljs, :profiles :dev
contains:
{:dependencies [[figwheel-sidecar "0.5.2"]
[com.cemerick/piggieback "0.2.1"]]
:source-paths ["src/cljs"]
:plugins [[lein-figwheel "0.5.9-SNAPSHOT"]
[lein-doo “0.1.7”]]}
from what I’ve read in the doc, figwheel tries to start piggieback by default, what’s the command you’re talking about?
:Piggieback (figwheel-sidecar.repl-api/repl-env)
And I think you should not run (cljs-repl)
if you connect Fireplace to Figwheel, but I'm not sure if it will cause problems
This doesn't seem to be documented at all on Figwheel yet
@juhoteperi so :Connect
will connects me to the nREPL server and :Piggieback
will create a new session within that server using the env passed as argument?
Though you probably don't need to use :Connect
because Fireplace will automatically connect to nrepl based on .nrepl-port
file
Hmm, I don't think figwheel should start another nrepl
It will do that IF you run lein figwheel
but it does't make sense if you use start-figwheel
Yeah I think you don't need that if you use start-figwheel
That is "The old way": https://github.com/bhauman/lein-figwheel/wiki/Using-the-Figwheel-REPL-within-NRepl#the-old-way-of-connecting-to-nrepl
without nrepl-port, it seem’s it won’t connect to the nrepl, not by default, not with :Connect
Does repl connection work for clj files?
If I eval a println the output shows up in vim, not sure I’m connected to the lein repl
Unless it took like 30sec to eval, it is working
piggieback gives me no such variable exception, here’s what I got when I autocomplete in the repl:
figwheel-sidecar.repl-api/*repl-api-system*
figwheel-sidecar.repl-api/api-help
figwheel-sidecar.repl-api/app-trans
figwheel-sidecar.repl-api/build-once
figwheel-sidecar.repl-api/clean-builds
figwheel-sidecar.repl-api/cljs-repl
figwheel-sidecar.repl-api/fig-status
figwheel-sidecar.repl-api/figwheel-running?
figwheel-sidecar.repl-api/print-config
figwheel-sidecar.repl-api/reload-config
figwheel-sidecar.repl-api/reset-autobuild
figwheel-sidecar.repl-api/start-autobuild
figwheel-sidecar.repl-api/start-figwheel!
figwheel-sidecar.repl-api/start-figwheel-from-lein
figwheel-sidecar.repl-api/stop-autobuild
figwheel-sidecar.repl-api/stop-figwheel!
figwheel-sidecar.repl-api/switch-to-build
figwheel-sidecar.repl-api/system-asserts
user=> figwheel-sidecar.repl-api/
You have old version of figwheel
repl-env
was added in the latest update
check both lein-figwheel and figwheel-sidecar deps
Just got this working myself
I have previously used separate nrepl for figwheel
But migrated to start-figwheel!
now
when using sidecar + start-figwheel!
, I don't think lein plugin is used at all
Do you have the app open in browser?
I get this after piggiebacking and eval’ing a println in cljs:
{'status': ['eval-error', 'done'], 'ex': 'class clojure.lang.ExceptionInfo', 'root-ex': '
class clojure.lang.ExceptionInfo', 'id': 'fireplace-HALIX-1480154541-14', 'session': ['71
2f4939-70fe-4832-b057-1a45c87932c1'], 'err': '#object[TypeError TypeError: Cannot read pr
operty ''getStackTrace'' of undefined]^@'}
I feel like we're close, just the evaluations are causing an exception for some reason.
Fireplace could be way smarter about exceptions in the context of cljs I think. But there we go.
I’d bet the exception is “couldn’t find myfile.clj(s)”, but I’d like to try evaling by hand first
I think Figwheel always uses the same system. So if you run the command you used to do at the repl
Nothing is coming to mind. You'd probably have to check the repl-y docs as an existence check.
Maybe reboot the REPL and start again fresh? (I'm that lost, totally hoping we've run an odd command)
Well we’ve tried, I’ve put the info you shared with me in https://github.com/bhauman/lein-figwheel/wiki/Using-the-Figwheel-REPL-with-Vim so it’s not a complete waste
I have wifi for now, so I'll grab the latest chestnut, and write down exactly what I do to get clojurescript.
@lsenta This worked for me:
lein new chestnut testfigwheel
cd testfigwheel
lein repl
=> Ctrl-D # exit (wrong figwheel version)
nvim project.clj # (update figwheel version in 3 places - 2 in deps, 1 in plugins)
lein repl
=> (run)
=> (browser-repl)
# New terminal
nvim src/cljs/testfigwheel/core.cljs
nvim=> :Piggieback (figwheel-sidecar.repl-api/repl-env)
nvim=> :Eval (js/alert "hello, world")
If it doesn't work for you, I'd suspect an outdated fireplace plugin or something like that. If it does, then it means your figwheel setup might be slightly off.
I’ll just reboot my project using this template, it has everything I need apparently and it just works
I had a few days of hell getting it up, due to it's parsing of project.clj, which doesn't always work well
I’ll keep this solution in mind next time, just take a template that works and trash the previous project.clj
JUXT (company I work for) has edge https://github.com/juxt/edge and deraen has saapas https://github.com/Deraen/saapas Both use boot which has supported vim for a very long time