This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-05-28
Channels
- # announcements (1)
- # beginners (183)
- # boot (2)
- # clara (4)
- # cljs-dev (20)
- # clojure (59)
- # clojure-dev (7)
- # clojure-nl (1)
- # clojure-serbia (1)
- # clojure-sg (1)
- # clojure-spec (4)
- # clojure-uk (15)
- # clojurescript (77)
- # clr (1)
- # data-science (9)
- # datomic (23)
- # docs (3)
- # duct (15)
- # emacs (8)
- # events (1)
- # fulcro (6)
- # instaparse (3)
- # juxt (1)
- # lumo (9)
- # off-topic (18)
- # perun (2)
- # portkey (13)
- # reagent (2)
- # reitit (11)
- # ring (10)
- # shadow-cljs (158)
- # tools-deps (34)
Hello. Does anybody else have issues with Vim and the latest shadow-cljs (2.3.28). I upgraded from 2.3.23 to make use of the build hooks, and my vim-fireplace setup stopped working. When I do "Piggieback :build-id" from Vim, with 2.3.23 everything works, but with 2.3.28 I get the following error:
in vim:
Error detected while processing function <SNR>28_piggieback[1]..fireplace#platform:
line 32:
E605: Exception not caught: Fireplace: :Connect to a REPL or install classpath.vim
in shadow-cljs console:
[2018-05-28 13:02:24 - SEVERE] Unhandled REPL handler exception processing message {:id fireplace-lap1-1527501741-5, :op clone}
java.net.SocketException: Socket closed
at java.base/java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:118)
at java.base/java.net.SocketOutputStream.write(SocketOutputStream.java:155)
at java.base/java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:81)
at java.base/java.io.BufferedOutputStream.flush(BufferedOutputStream.java:142)
at clojure.tools.nrepl.transport$bencode$fn__20978.invoke(transport.clj:103)
at clojure.tools.nrepl.transport.FnTransport.send(transport.clj:28)
at clojure.tools.nrepl.middleware.session$register_session.invokeStatic(session.clj:144)
at clojure.tools.nrepl.middleware.session$register_session.invoke(session.clj:137)
at clojure.tools.nrepl.middleware.session$session$fn__22346.invoke(session.clj:188)
at clojure.tools.nrepl.middleware$wrap_conj_descriptor$fn__21967.invoke(middleware.clj:22)
at shadow.cljs.devtools.server.nrepl$start$fn__22599.invoke(nrepl.clj:344)
at clojure.tools.nrepl.server$handle_STAR_.invokeStatic(server.clj:19)
at clojure.tools.nrepl.server$handle_STAR_.invoke(server.clj:16)
at clojure.tools.nrepl.server$handle$fn__22419.invoke(server.clj:28)
at clojure.core$binding_conveyor_fn$fn__5476.invoke(core.clj:2022)
at clojure.lang.AFn.call(AFn.java:18)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1135)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
at java.base/java.lang.Thread.run(Thread.java:844)
did you restart the server properly? I don't use vim-fireplace so I can't say what happens on that side
nrepl is driving me crazy. I suspect its caused by a change I did to try an fix https://github.com/thheller/shadow-cljs/issues/273
how can I run a dev build of shadow-cljs itself? maybe it would be easier if I try to isolate the changes you mentioned above than try to setup vim on windows
you can clone the repo and run lein with-profiles +cljs repl
and then (require 'repl) (repl/go)
that setup has a bunch of debug stuff enabled. among other things it prints all nrepl messages to the console
thanks. cloning now. i'll try with 16 first, then bump to 17, etc. until I isolate it.
@thheller is that if use tools.deps
or leiningen
for dependency management, shadow-cljs will ignore -d
command line argument?
if you use lein
the command is printed on startup, you can literally just use that instead
for editor users (like emacs cider), it will inject dependencies by using -d
, this will not work if I use leiningen
or tools.deps
.
I guess it should be possible to modify https://github.com/thheller/shadow-cljs/blob/master/src/main/shadow/cljs/npm/cli.cljs#L272-L293 to inject dependencies for lein as well (or tools.deps)
the opts
has :dependencies
key which are those added by -d
https://github.com/thheller/shadow-cljs/blob/master/src/main/shadow/cljs/npm/cli.cljs#L286
@samuel.wagen hmm I guess that makes sense
Successful session:
user=> [13:38:34,327] nrepl-receive {:id "fireplace-lap1.local-1527503914-1", :op "clone"}
[13:38:34,332] nrepl-receive {:id "fireplace-lap1.local-1527503914-2", :op "describe", :verbose? 1}
[13:38:34,367] nrepl-receive {:code "[(System/getProperty \"path.separator\") (System/getProperty \"fake.class.path\")]", :id "fireplace-lap1.local-1527503914-3", :op "eval"}
[13:38:34,373] nrepl-receive {:id "fireplace-lap1.local-1527503914-4", :op "classpath"}
[13:38:36,086] nrepl-receive {:id "fireplace-lap1.local-1527503914-5", :op "clone"}
[13:38:36,089] nrepl-receive {:id "fireplace-lap1.local-1527503914-6", :op "describe", :verbose? 1}
[13:38:36,119] nrepl-receive {:code "[(System/getProperty \"path.separator\") (System/getProperty \"fake.class.path\")]", :id "fireplace-lap1.local-1527503914-7", :op "eval"}
[13:38:36,125] nrepl-receive {:id "fireplace-lap1.local-1527503914-8", :op "classpath"}
[13:38:36,132] nrepl-receive {:id "fireplace-lap1.local-1527503914-9", :op "clone"}
[13:38:36,135] nrepl-receive {:code "((or (resolve 'cider.piggieback/cljs-repl)(resolve 'cemerick.piggieback/cljs-repl)) :browser)", :id "fireplace-lap1.local-1527503914-10", :op "eval"}
[13:38:37,311] nrepl-receive {:id "fireplace-lap1.local-1527503914-11", :op "close"}
[13:38:37,314] nrepl-receive {:id "fireplace-lap1.local-1527503914-12", :op "close"}
[13:38:37,316] nrepl-receive {:id "fireplace-lap1.local-1527503914-13", :op "close"}
Bye for now!
Failed session:
user=> [13:39:21,353] nrepl-receive {:id "fireplace-lap1.local-1527503961-1", :op "clone"}
[13:39:21,357] Unhandled REPL handler exception processing message {:id fireplace-lap1.local-1527503961-1, :op clone}
java.net.SocketException: Socket closed
at java.base/java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:118)
at java.base/java.net.SocketOutputStream.write(SocketOutputStream.java:155)
at java.base/java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:81)
at java.base/java.io.BufferedOutputStream.flush(BufferedOutputStream.java:142)
at clojure.tools.nrepl.transport$bencode$fn__724.invoke(transport.clj:103)
at clojure.tools.nrepl.transport.FnTransport.send(transport.clj:28)
at clojure.tools.nrepl.middleware.session$register_session.invokeStatic(session.clj:144)
at clojure.tools.nrepl.middleware.session$register_session.invoke(session.clj:137)
at clojure.tools.nrepl.middleware.session$session$fn__1254.invoke(session.clj:188)
at clojure.tools.nrepl.middleware$wrap_conj_descriptor$fn__903.invoke(middleware.clj:22)
at shadow.cljs.devtools.server.nrepl$start$fn__20723.invoke(nrepl.clj:344)
at clojure.tools.nrepl.server$handle_STAR_.invokeStatic(server.clj:19)
at clojure.tools.nrepl.server$handle_STAR_.invoke(server.clj:16)
at clojure.tools.nrepl.server$handle$fn__1327.invoke(server.clj:28)
at clojure.core$binding_conveyor_fn$fn__5476.invoke(core.clj:2022)
at clojure.lang.AFn.call(AFn.java:18)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1135)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
at java.base/java.lang.Thread.run(Thread.java:844)
@doglooksgood please do
@samuel.wagen ok. I'll remove that, doesn't serve any real purpose anyways
i don't have it global, i only have it as a devDependency in packages.json and use npx shadow-cljs
I use it to expose the git commit hash (and dirty status) as a Closure define, which exposes it to the CLJS code in the browser. Enables me to have that hash in my telemetry so that when I report client exceptions from the browser, I also have a way to pinpoint the exact code revision.
https://github.com/thheller/shadow-cljs/issues/286 I just post a issue for this, If you don't have time, I think I can help:sunglasses:
is there a reason why #shadow-connection-error
is position: absolute
and not position: fixed
?
and within that page I have my div#application
and then the <script>
where my cljs app lives
ok then you probably need to configure :devtools {:devtools-url "
in your build config
since the setup assumes everything is running on the same machine which it isn't when running in vagrant
if so you don't need anything else. :devtools-url
just configures where the websocket tries to connect to
assuming of course that you are compiling the files somewhere the vagrant php server can see them?
and to use some third party react components, can I not do [:> some-react-class]
anymore?
i’m getting Uncaught Error: Assert failed: Expected React component in: [:> #js {:DayPicker #object[b], :DateUtils #js...
looks like you are passing the wrong thing? maybe [:> foo ..]
instead of [:> foo/DayPicker ...]
?
that’s it! I thought it was importing the actual component under foo
but now I understand how it works
is there anyway to kick off an arbitrary shell action when running a watch? I just need to run a node-sass
watch target to compile my sass. it seems like a lot of complexity to add lein in just to do that
well the idea for things with state is plugins. not yet documented or final. but the idea is this: https://github.com/thheller/shadow-cljs/blob/master/src/dev/demo/dummy_plugin.clj
when server starts the :start
function is called. whatever that returns will be called be passed to :stop
on server shutdown
:depends-on
can be used if you want access to some of the other shadow-cljs components
managed to set this up btw. You can find it here: https://github.com/heyarne/airsonic-ui
@lee.justin.m you can also check out https://github.com/heyarne/airsonic-ui. I've set up parallel builds w/ sass --watch and shadow-cljs watch using npm scripts
@arne-clojurians this is a much easier way of doing it and I learned about the run-p
command. thanks!
I have file /src/cm/theme.js
const theme = createMuiTheme({
palette: {
primary: purple,
secondary: green,
},
status: {
danger: 'orange',
},
});
How to use theme
in cljs?import { createMuiTheme } from '@material-ui/core/styles';
import purple from '@material-ui/core/colors/purple';
import green from '@material-ui/core/colors/green';
const theme = createMuiTheme({
palette: {
primary: purple,
secondary: green,
},
status: {
danger: 'orange',
},
});
This is whole content of js fileThere is one thing which make more in doubt if I want keep theme in js. I wrote text-decoration
instead of testDecoration
and error is visible only in console. Not in web browser. Because of that I will probably stay with cljs.
how do I make React exposed as a global through the config? I'm using cljss and the macros expand to js/React calls.
seems it's related to https://github.com/roman01la/cljss/issues/45
@arne-clojurians this is a much easier way of doing it and I learned about the run-p
command. thanks!