This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-11-09
Channels
- # bangalore-clj (1)
- # beginners (158)
- # boot (8)
- # cider (9)
- # cljsjs (9)
- # clojure (169)
- # clojure-austin (1)
- # clojure-denmark (1)
- # clojure-dusseldorf (5)
- # clojure-italy (9)
- # clojure-losangeles (2)
- # clojure-russia (31)
- # clojure-spec (53)
- # clojure-turkiye (1)
- # clojure-uk (56)
- # clojurescript (145)
- # cursive (72)
- # datascript (4)
- # datomic (3)
- # duct (121)
- # events (9)
- # figwheel (1)
- # fulcro (46)
- # graphql (4)
- # hoplon (16)
- # jobs (1)
- # jobs-discuss (4)
- # leiningen (16)
- # lumo (5)
- # off-topic (38)
- # om (1)
- # om-next (5)
- # onyx (104)
- # parinfer (5)
- # re-frame (106)
- # reagent (1)
- # ring-swagger (3)
- # rum (1)
- # shadow-cljs (235)
- # slack-help (4)
- # unrepl (25)
- # yada (9)
Yeah they actually fixed that ^^
In combination with shadow-cljs not so much
What editor do you use btw? Just out of curiosity
Our team is spacemacs and vim 😛
Ok when I connect the cider middleware get's properly loaded because I don't get warnings anymore
And connecting by using:
(shadow.cljs.devtools.api/nrepl-select :app)
worksAnd I can try stuff out in that repl
Yes I can do (.log js/console "hello")
that works
but when I do it gives me the following error:
error in process filter: nrepl--dispatch-response: [nREPL] No response handler with id 0 found
error in process filter: [nREPL] No response handler with id 0 found
But it does work
I use cider-connect
and then localhost and then the correct port
and i use cider-eval-last-sexp
to run stuff or cider-eval-buffer
but for the last one I get TBD
log message
If you want to try it out you could use spacemacs, then cider works out of the box
And I got this error when trying to eval a ns:
Nov 09, 2017 9:58:51 AM clojure.tools.logging$eval454$fn__457 invoke
SEVERE: Unhandled REPL handler exception processing message {:ns user, :op eval, :code (ns cljs.user
(:require
[fulcro.client.core :as uc]
[om.next :as om]
[atlas-crm.ui.entry-points.spa :as core]
[atlas-crm.ui.root :as root]
[cljs.pprint :refer [pprint]]
[fulcro.client.logging :as log]
[clojure.spec.test.alpha :as stest]
[clojure.spec.alpha :as s]
[expound.alpha :as expound]))
, :file /home/mitchel/Development/atlas-crm-next/dev/client/cljs/user.cljs, :line 1, :column 1, :session 56407dcf-efa5-4ab4-8991-457ba97aa97c, :id 28}
java.lang.IllegalArgumentException: No matching clause: :repl/error
at shadow.cljs.devtools.server.nrepl$do_cljs_eval.invokeStatic(nrepl.clj:54)
at shadow.cljs.devtools.server.nrepl$do_cljs_eval.invoke(nrepl.clj:23)
at shadow.cljs.devtools.server.nrepl$cljs_eval$fn__25937.invoke(nrepl.clj:139)
at clojure.tools.nrepl.middleware$wrap_conj_descriptor$fn__25437.invoke(middleware.clj:22)
at clojure.tools.nrepl.middleware.session$add_stdin$fn__25769.invoke(session.clj:229)
at clojure.tools.nrepl.middleware$wrap_conj_descriptor$fn__25437.invoke(middleware.clj:22)
at clojure.tools.nrepl.middleware.load_file$wrap_load_file$fn__25818.invoke(load_file.clj:79)
at clojure.tools.nrepl.middleware$wrap_conj_descriptor$fn__25437.invoke(middleware.clj:22)
at cider.nrepl$wrap_stacktrace$fn__1100.invoke(nrepl.clj:365)
at clojure.tools.nrepl.middleware$wrap_conj_descriptor$fn__25437.invoke(middleware.clj:22)
at cider.nrepl$wrap_format$fn__1026.invoke(nrepl.clj:188)
.....
do you have vanilla emacs?
You have to open the buffer of the repl
ctrl+x b
I think haven't used emacs shortcuts in a long time
spacemacs has vim shortcuts
spacebar and then b b opens your buffers
if you have a clojurescript file open you can use ,
e
e
to eval the last sexp
and you can use , e b
to eval a buffer
I was thinking do I need to configure piggieback or the fake on of shadow-cljs somehow? or is that automatic?
[10:26:55,107] nrepl-receive {:ns cljs.user, :op eval, :code (js/alert "foo")
, :file *cider-repl localhost*<2>, :line 62, :column 12, :id 42}
[10:26:56,696] nrepl-send {:id 0, :session 9aa5ab6c-1f55-4a43-bc7d-1b9ad01a3d4f, :type :repl/result, :value nil, :ns cljs.user}
[10:26:56,696] nrepl-send {:id 42, :session 9aa5ab6c-1f55-4a43-bc7d-1b9ad01a3d4f, :status #{:done}}
Btw autocomplete you get after typing foo/f
but you need to eval the ns
so that it works
That should not be quoted 😛
That is weird
That makes sense
[10:44:25,122] nrepl-receive {:ns "cljs.user", :op "eval", :code "(js/console.log \"foo\")\n", :file "*cider-repl localhost*", :line 52, :column 12, :id "16"}
[10:44:25,134] nrepl-send 16 {:type :repl/result, :value "nil", :id "16", :ns "cljs.user", :session "6fe7ed2f-85a6-4076-a7dd-5dfbe4aa0928"}
[10:44:25,134] nrepl-send 16 {:status #{:done}, :id "16", :session "6fe7ed2f-85a6-4076-a7dd-5dfbe4aa0928"}
user-error: 'cider-load-buffer' needs a ClojureScript REPL.
If you don't know what that means, you probably need to jack-in (', "').
Then it doesnt detect that you have a clojurescript buffer
It does that with some weird var
I fixed it by running a command in the cljs repl and then after that it did know
user> (shadow.cljs.devtools.api/nrepl-select :browser)
To quit, type: :repl/quit
[:selected :browser]
cljs.user> (js/console.log "foo")
"nil"
cljs.user> (js/console.log "bar")
"nil"
can you check cider-connection-browser
?
For me that shows:
REPL Host Port Project Type
* *cider-repl localhost* localhost 3002 atlas-crm-next ClojureScript
*cider-repl atlas-crm-next* localhost 46125 atlas-crm-next Clojure
ah that's the problem
I did the following:
You can mute this warning by changing cljr-suppress-middleware-warnings.
user> (shadow.cljs.devtools.api/nrepl-select :app)
To quit, type: :repl/quit
[:selected :app]
JS runtime connected.
cljs.user> (.log js/console "hoi")
nil
weird that that doesn't work for you
is the file in the right project?
Do you have incluced the middleware and cider 16 middleware? Maybe that helps
WARNING: CIDER's version (0.15.0-snapshot) does not match cider-nrepl's version (0.15.1). Things will break!
yes try:
npx shadow-cljs -d cider/cider-nrepl:0.16.0-SNAPSHOT watch :app
Oh wait your's wants 0.15.1
how do you add cider?
That is weird because mine wants:
;; Connected to nREPL server -
;; CIDER 0.16.0snapshot (package: 20171001.112), nREPL 0.2.13
you use spacemacs? try configuration-layer/update-packages
that updates all the spacemacs packages
or all the emacs packages
you could also check for updates, maybe you have an old version of spacemacs
space space
and then type it in
Oh you have an old spacemacs
you could remove emacs.d en dan reinstall spacemacs
does alt+x work?
then search for spacemacs/check-for-new-version
? what the hell 😛
Haha I get that
I would just remove your emacs.d en close emacs
and then do a fresh clone and start emacs
Maybe I should learn how to fix those issue with shadow-cljs so you don't have to go through this pain 😅
then just use alt+x
that also works
I think it is probably alt+enter
for you
WARNING: CIDER's version (0.16.0-snapshot) does not match cider-nrepl's version (0.15.1). Things will break!
can I make it use non-snapshot? snapshots are scary.
Then you have to do some stuff with melpa, but probably all of your cider users will be using 0.16.0-snapshot
But you should be able to pin the version somewhere, but not sure how that works tbh
added the snapshot but now I get [WARNING] No nREPL middleware descriptor in metadata of null, see clojure.tools.middleware/set-descriptor!
man this is what I really hate about emacs .. press one wrong key and things go totally nuts
What a horror this is
user-error: 'cider-load-buffer' needs a ClojureScript REPL.
If you don't know what that means, you probably need to jack-in (', "').
CLJS <no project>@localhost:8202 (Java 1.8.0_144, Clojure 1.9.0-beta4, nREPL 0.2.13) [2 times]
[email protected]
fixes the initial issue [nREPL] No response handler with id 0 found
Haha sorry I was busy
If you cider connect you have to make sure that you are in a project file
if you change that to just (shadow.cljs.devtools.api/nrepl-select :app)
it should work?
damnit now I am stuck in that configuration screen
you then you can connect and then run cider-sibling-cljs-repl
that should work
You can change Cider Cljs Lein repl with customize-group Cider
Sure I'll try it out myself
Could you push your changes? Then I can see where you changed stuff and play around
Haha nice commit messages
https://github.com/thheller/shadow-cljs/commit/721a0e123aee01faada30ab3694de7c138a80a9b
Sorry one more question how do you hack on this and quickly test it out in emacs? not sure how to start
my workflow is: lein with-profiles +cljs repl
in the project itself. connect to that remotely via Cursive.
Ok awesome thnx
just doing that since every (repl/go)
restarts the embedded server which also restarts the nrepl server. so I’m connected to that while calling (repl/go)
I lose the connection.
I'll manage
Thank you
Hmm should I install all npm-packages manually? No package.json
Ah ok can you share it here?
Ah ok 😛
{
"private": true,
"devDependencies": {
"babel-cli": "^6.26.0",
"babel-preset-env": "^1.6.0",
"shadow-cljs": "file:packages/shadow-cljs",
"source-map-support": "^0.4.15",
"ws": "^3.2.0"
},
"dependencies": {
"@atlaskit/navigation": "^18.0.0",
"@blueprintjs/core": "^1.32.0",
"@expo/vector-icons": "^5.2.0",
"animated": "^0.2.0",
"aws-sdk": "^2.122.0",
"babel-core": "^6.26.0",
"babel-plugin-external-helpers": "^6.22.0",
"bootstrap": "4.0.0-beta.2",
"browser-resolve": "^1.11.2",
"browserify": "^14.4.0",
"browserify-shim": "^3.8.14",
"codemirror": "^5.31.0",
"create-react-class": "^15.6.2",
"d3": "^4.11.0",
"envify": "^4.1.0",
"firebase": "^4.5.1",
"firebaseui": "^2.4.1",
"highlight.js": "^9.12.0",
"iconv-lite": "^0.4.19",
"intl-messageformat": "^2.2.0",
"jquery": "^3.2.1",
"jquery-treetable": "^3.2.0-1",
"js-nacl": "^1.2.2",
"katex": "^0.9.0-alpha1",
"leaflet": "^1.2.0",
"material-components-web": "^0.22.0",
"material-ui": "^0.18.7",
"mkdirp": "^0.5.1",
"module-deps": "^4.1.1",
"moment": "^2.18.1",
"node-libs-browser": "^2.0.0",
"node-resolve": "^1.3.3",
"parinfer": "^3.11.0",
"parinfer-codemirror": "^1.4.1",
"preact": "^8.2.5",
"processing-js": "^1.6.6",
"react": "^16.0.0",
"react-addons-css-transition-group": "^15.6.2",
"react-apollo": "^1.4.16",
"react-dom": "^16.0.0",
"react-leaflet": "^1.7.0",
"react-vis": "^1.7.9",
"readline-sync": "^1.4.7",
"reqwest": "^2.0.5",
"shortid": "^2.2.8",
"source-map": "^0.6.1",
"styled-components": "^2.1.1",
"uglify-js": "^3.1.2",
"uglifyify": "^4.0.3",
"webpack": "^3.5.5"
},
"browserify-shim": {}
}
need to remove some stuff, those are basically the pacakges I tested at one point or another
Ah pretty much have it working now ^^
Yeah very usefull
I am getting somewhere, when I try to eval a namespace form, here i try this one:
(ns demo.browser
(:require-macros [demo.browser :refer (test-macro)])
(:require ["react" :as react :refer (Component createElement)]
["react-dom" :as rdom :refer (render)]
["shortid" :as sid]
["jquery" :as jq]
["material-ui/RaisedButton" :as mui-btn :default btn]
;; ["@material/checkbox" :refer (MDCCheckbox MDCCheckboxFoundation)]
["babel-test" :as babel-test :default Shape]
["@material/menu/simple/foundation" :default menu]
["@material/menu/util" :as util]
["d3" :as d3]
[clojure.pprint :refer (pprint)]
[cljsjs.react]
[clojure.spec.alpha :as s]
[clojure.spec.gen.alpha :as gen]
[shadow.api :refer (ns-ready)]
["circular-test" :as circ]))
I get an error with:
:cause conflict on "clojure.pprint" by "clojure.pprint" used by "cljs.pprint"
I get the same for clojure.spec and cljs.spec
When I remove this a lot starts working ^^
Even the autocompletion
Nice and I fixed the case statement which had a wrong default now I get:
[:FIXME {:type :repl/error, :message "failed to compile resource: [:shadow.build.classpath/resource \"cljs/pprint.cljs\"]", :data {:tag :shadow.build.compiler/compile-cljs, :source-id [:shadow.build.classpath/resource "cljs/pprint.cljs"], :url #object[java.net.URL 0x6ad8fa90 "jar:file:/home/mitchel/.m2/repository/org/clojure/clojurescript/1.9.946/clojurescript-1.9.946.jar!/cljs/pprint.cljs"], :file nil}, :causes ["No namespace: cljs.pprint found"]}]
Yeah hehe
No I think that is caused by: :cause conflict on "clojure.pprint" by "clojure.pprint" used by "cljs.pprint"
So it fails to compile: clojure.lang.ExceptionInfo: failed to compile resource: [:shadow.build.classpath/resource "cljs/pprint.cljs"]
I think the second one happens because of the conflict? (I am just guessing here)
I am trying to get something like this to work, not sure if this is even possible.
(defn cljs-repl []
(shadow-server/start!)
(shadow/watch :app)
(shadow/nrepl-select :app))
Something like this does work with figwheel where you can just say (fig/cljs-repl (:figwheel-system @figwheel))
not sure if you want to support this but it has a really nice workflow we have one script that starts everything and then in our emacs starts 2 repls in one jvmWhat kind of undefined behaviour do you get? I would think on save just reload all affected namespaces? and blow away evalled stuff?
I get: IllegalStateException Can't change/establish root binding of: *nrepl-cljs* with set clojure.lang.Var.set (Var.java:223)
Ahh that would be easy
and then no fiddling with cider middleware
shadow.cljs.devtools.server.nrepl
is the ns and you need https://github.com/thheller/shadow-cljs/blob/master/src/main/shadow/cljs/devtools/server/nrepl.clj#L212-L218
Ah thnx
Will try it out
I will write a guide if I have this working ^^
I fixed the conflict but now watch can’t load the file anymore because its on conflict with the REPL 😛
Oh god all because of the stupid aliasing?
Damn the middleware works!
this is awesome, I still get this error for some reason if I run a clean build from the repl in leiningen:
-> Compile CLJS: cljs/core.cljs
------ ERROR -------------------------------------------------------------------
File: jar:file:/home/mitchel/.m2/repository/org/clojure/clojurescript/1.9.946/clojurescript-1.9.946.jar!/cljs/core.cljs:987:14
--------------------------------------------------------------------------------
983 |
984 | (number? o)
985 | (if (js/isFinite o)
986 | (js-mod (Math/floor o) 2147483647)
987 | (case o
--------------------^-----------------------------------------------------------
No reader function for tag Inf
--------------------------------------------------------------------------------
988 | ##Inf
989 | 2146435072
990 | ##-Inf
991 | -1048576
992 | 2146959360))
--------------------------------------------------------------------------------
:error
But it works without leiningen so probably a dependency issueAh thnx
Yes that worked
awesome now it all works!
now if I could only find a decent way so the REPL doesn’t conflict with watch in undefined ways
@mitchelkuijpers [email protected]
should hopefully resolve most ns
issues
Ah awesome
it may still run into weird situation but the worst that should happen is that watch
blows away some REPL state
That is not really a problem ^^
Very cool
I started https://github.com/thheller/shadow-cljsjs in which I want to collect the cljsjs.*
alias namespaces for common cljsjs
packages