This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-02-22
Channels
- # architecture (9)
- # beginners (90)
- # cider (98)
- # cljs-dev (23)
- # cljsrn (4)
- # clojure (101)
- # clojure-brasil (3)
- # clojure-dev (48)
- # clojure-italy (15)
- # clojure-losangeles (3)
- # clojure-russia (12)
- # clojure-uk (17)
- # clojured (1)
- # clojurescript (141)
- # community-development (15)
- # core-async (1)
- # datascript (12)
- # datomic (18)
- # docker (3)
- # emacs (1)
- # events (1)
- # figwheel (1)
- # fulcro (57)
- # graphql (4)
- # javascript (9)
- # jobs (1)
- # lein-figwheel (1)
- # leiningen (1)
- # lumo (1)
- # off-topic (68)
- # om (9)
- # om-next (3)
- # onyx (4)
- # parinfer (6)
- # pedestal (14)
- # portkey (2)
- # proton (1)
- # protorepl (19)
- # re-frame (57)
- # reagent (46)
- # ring-swagger (12)
- # shadow-cljs (167)
- # slack-help (5)
- # specter (18)
- # sql (1)
- # uncomplicate (3)
- # unrepl (1)
@richiardiandrea what do you have in mind?
@thheller I wanted to ask if shadow could output the classpath so that I can use lumo
🙂
uhm interesting
coool so I can use :cache-root/classpath.edn
I guess
oh no yeah
https://github.com/thheller/shadow-cljs/blob/master/src/main/shadow/cljs/npm/cli.cljs#L144-L168
it is in edn format, I need to convert it
and it does not include only the build deps but also shadow deps
well you could just use tools.deps
which I would recommend at this point to be honest
yep I could, but I have already project.clj
in place and I can just use lein
...or use tools.deps
yeah exactly
yep that's what I am using
well, I was just wondering 😄
since I expect deps.edn
to become standard pretty soon I'd suggest sticking with that
it's just that it requires to use an additional tool on ci...while shadow can be provisioned through npm install
but yeah...you are probably right...
yep I am ok with that, but then the classpath has to be generated with other tooling
no worries Thomas, just grumbling at the some many tools to provision on CI 😄
I could definitely do that
I like that you can export functions for :node-library
, you could even add JSDoc 😄 😄 😄
will see if I can PR something sooner or later but shadow-cljs
has improved a lot since the last time I checked!
@thheller you are awesome thanks for the fix!
last question, is there a way to use ClojureScript libraries deployed through the npm mechanism at the moment?
and is there a way to add things to the shadow-cljs
tool classpath by any chance? my deps are not deployed on Maven as we prefer npm in my company at the moment...
oh I see I can get creative with deps.edn
, I will try that
I am in a monorepo so I can have a deps.edn
file that contains {:paths ["src" "../spec-cljs/src"]}
and it will end up in shadow's classpath
that is what I mean by "being creative" 😄
lol other question
when I build, I see in my dist
a folder called cljs-runtime
do I need to deploy both? how do I get a unique artifact?
you can set :release {:output-to "some-other/path.js"}
to only change the path for release
if you only set :output-to
you will only get that file. :output-dir
during development uses an absolute path in the target/shadow-cljs
directory so the cljs-runtime
folder doesn't show up in the dist dir 😛
Hi @thheller , I found (println "hello")
will print hello
in the screen I executed shadow-cljs node-repl
, Is it possible to print the message in cider? (https://github.com/thheller/shadow-cljs/issues/207#issuecomment-367699962)
and then there are two ways the output could get there. either pipe all stdout of the managed node process to the REPL
Sorry, I've misunderstood you before. I thought you meant to let me open a new issue to discuss this issue 😂
ok, I will open a new issue later 😛
I’m getting IllegalStateException: Can't change/establish root binding of: *cljs-warnings* with set
when using the [binaryage/oops] library (https://github.com/binaryage/cljs-oops) within a shadow-clj repl. Any ideas?
Yeah - I pulled the library in when goog.object/set
did not seem to be working to set properties of a javascript object. I believe something else is going on. My javascript interop chops are weak.
that error in particular is a bug in shadow-cljs though. or rather was. fixed in [email protected]
@thheller do you have any idea how hard would be to enable REPL in React Native apps? how is it currently implemented for web, websockets? having live-reload/REPL on RN would be awesome
ideally there would be a :target :react-native
but I haven't done any serious RN development
I'm making a toy application, and to my surprise & delight I've got a user to support. My goal is for her to be able to run my server.js in node. I changed my project to use shadow-cljs, and it seems to be achieving my goal. However, I'm not sure what's going on with my tests.
I successfully compiled a test file, and ran it in node. But, my specs were not found.
I doubt I have things set up 'correctly'.... I was developing by having a lein auto tach lumo
process running, and I have a (cljs.test/run-tests)
line at the end of each of my test files
This might be easiest, altho it is a push from before I was trying shadow: https://github.com/mathpunk/sherman
The only thing that's changed since has been shadow-cljs.edn, and I've just commented out the cljs.test/run-tests
ok, second question: is there a method for having tests run when I change code? I used to use CIDER as my test runner for Clojure, which I don't think is going to work easily in CLJS. On this project I had been running a lein auto tach lumo
task in a separate window, but I'm not sure if there's a way of doing something similar in shadow yet
i guess third question is, should I remove my project.clj entirely? everything's being done by shadow now?
npm install -g chokidar-cli
https://github.com/kimmobrunfeldt/chokidar-cli
thanks, I'll try that out, it is possible now to disable their auto-reload
so we can do that and rely on the shadow one if that works 🙂
@thheller doens't work =/ the only thing I see is this message on the android console: I/ReactNativeJS: '%cDEVTOOLS: disconnected!', 'color: blue;
code doesn't reload, and the REPL doesn't respond as well
To quit, type: :cljs/quit
=> [:selected :app]
3
There is no connected JS runtime.
if figwheel works then it is possible for shadow-cljs as well. just might take some tweaks.
sure, I can try to look at it, thanks for the tips
hey @thheller if i wanted to hack around a bit with the nrepl connection, what’s the best way to experiment with shadow-cljs when building from source?
I want to debug the protorepl connection to see if I can make it do all the cool shit it is capable of, but I don’t want to bug you every single day 🙂
@thheller I see that the browser versions tries to use <script>
tags to load things, that wont work on RN, I'm wondering if its easier to start from the node version, I tried that directly but seems like RN doesn't have teh crypto
package, but in terms of load seems the node version is closer
last time I checked proto-repl didn't use any nrepl-middleware but rather just evals CLJ code straight up.
In theory, I should be able to get function arguments to pop up as I type, get autocompletion to work, be able to jump to source, be able to get docstrings inline.
@wilkerlucio if you use :npm-module
it won't use <script>
@lee.justin.m like I said. they do this by evaling clojure code. I think.
humm, good to know, I'll keep reading 🙂
My suspicious is that it just doesn’t even try to do the stuff that it does with the clj repl, but I really want it to. 🙂
well okay i’ll futz around with the coffeescript side. partly i wanted to get some insight as to what the hell is going on with all these different repl techniques
it confuses the hell out of me that you can start a clj repl and then switch into a cljs-repl (like with figwheel). but then you can also connect to the same thing via a network
usually with nrepl most of the heavy listing is done by middleware. ie. cider-nrepl
.
so when you say “they do this by evaling clojure code” I don’t really know what you mean because, you know, isn’t that the “e” part of the repl?
eg. https://github.com/clojure-emacs/cider-nrepl/blob/master/src/cider/nrepl/middleware/complete.clj
https://github.com/jasongilman/proto-repl/blob/master/lib/proto-repl.coffee#L648-L656
so, somehow in my many iterations before i landed on shadow, I was able to start protorepl and get a full feature set.
I think I did that by lein watch
or whatever the command was and then (do (use 'figwheel-sidecar.repl-api) (start-figwheel!) (cljs-repl))
I really want to be able to make protorepl fully featured with cljs but I don’t even understand the problem. maybe after i’ve got a little more experience
is the issue that the nrepl channel is different from whatever its doing when you just fire up a normal repl?
there seems to be a gigantic discussion about this https://github.com/jasongilman/proto-repl/issues/54
https://github.com/jasongilman/proto-repl/blob/master/lib/completion-provider.coffee#L35-L45