This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-11-13
Channels
- # aleph (2)
- # announcements (1)
- # beginners (133)
- # cider (29)
- # cljdoc (9)
- # cljs-dev (2)
- # cljsjs (3)
- # cljsrn (1)
- # clojure (146)
- # clojure-dev (26)
- # clojure-europe (3)
- # clojure-italy (26)
- # clojure-japan (6)
- # clojure-nl (76)
- # clojure-spec (4)
- # clojure-uk (42)
- # clojurescript (17)
- # cursive (43)
- # datascript (1)
- # datomic (28)
- # emacs (4)
- # figwheel-main (13)
- # fulcro (26)
- # hyperfiddle (2)
- # jobs (9)
- # jobs-discuss (6)
- # leiningen (1)
- # mount (5)
- # onyx (8)
- # pathom (5)
- # pedestal (2)
- # re-frame (52)
- # reagent (21)
- # reitit (58)
- # ring-swagger (24)
- # shadow-cljs (95)
- # sql (14)
- # test-check (10)
- # yada (18)
hi everybody. A question concerning shadow-cljs intergration in CIDER. I am working on a mixed CLJ/CLJS project (deps.edn + shadow-cljs). Following shadow-cljs manual, I end up with 3 REPL:
- CLJ REPL: where I run the http server and play with CLJ files
- CLJ REPL: the one connected to shadow-cljs watch [...]
- CLJS REPL: the sibling of the above
Is this the expected situation? cider-find-var
doesn't seem to be working, but I can interact with the browser from the CLJS REPL.
@manuel you don't have to launch separate cljs repls. I just run the watch command, and connect to the NREPL server that's printed out using cider connect. After that, to get the browser repl working, I run (shadow/nrepl-select :build-name)
in that repl buffer window
---- I have a library that uses deps and shadow, I want to use it from another project, but the library has npm dependencies, how do I package those deps so when I use the library I don't get npm install errors?
I have this in my ~/.clojure/deps.edn
cider/cider-nrepl {:mvn/version "0.18.0-SNAPSHOT"}
here's the project: https://github.com/manuel-uberti/boodle
mine now gives: user-error: โcider-find-varโ requires the nREPL op "info" (provided by cider-nrepl)
@gleisonsilva I finally had some time to properly trace the re-frame-10x
warnings you reported a few days ago https://github.com/Day8/re-frame-10x/issues/219
pretty much the same issue as https://github.com/nathanmarz/specter/issues/267
this is great, @thheller! Thank you very much
@haywood thanks again. I added refactor-nrepl
to my shadow-cljs.edn
, and cider-find-var
is working now.
Question, I am trying to get a node repl for a :node-script
but I get:
node bin/migrate-event-store
Error: ENOENT: no such file or directory, open '/home/arichiardi/git/laputa/.shadow-cljs/builds/migrate/dev/out/cljs-runtime/goog.debug.error.js'
at Object.fs.openSync (fs.js:646:18)
at Object.fs.readFileSync (fs.js:551:33)
at global.SHADOW_IMPORT (/home/arichiardi/git/laputa/event-store/bin/migrate-event-store:47:15)
at /home/arichiardi/git/laputa/event-store/bin/migrate-event-store:3006:1
at Object.<anonymous> (/home/arichiardi/git/laputa/event-store/bin/migrate-event-store:3115:3)
at Module._compile (module.js:653:30)
at Object.Module._extensions..js (module.js:664:10)
at Module.load (module.js:566:32)
at tryModuleLoad (module.js:506:12)
at Function.Module._load (module.js:498:3)
what was the reason for that again?(ooops sorry for the ping ๐ธ)
it does not exists no
-rw-rw-r-- 1 arichiardi arichiardi 5671 Nov 13 10:04 goog.debug.console.js
-rw-rw-r-- 1 arichiardi arichiardi 19066 Nov 13 10:04 goog.debug.debug.js
-rw-rw-r-- 1 arichiardi arichiardi 1713 Nov 13 10:04 goog.debug.errorcontext.js
-rw-rw-r-- 1 arichiardi arichiardi 1797 Nov 13 10:04 goog.debug.error.js
-rw-rw-r-- 1 arichiardi arichiardi 13935 Nov 13 10:04 goog.debug.formatter.js
-rw-rw-r-- 1 arichiardi arichiardi 4312 Nov 13 10:04 goog.debug.logbuffer.js
-rw-rw-r-- 1 arichiardi arichiardi 26315 Nov 13 10:04 goog.debug.logger.js
-rw-rw-r-- 1 arichiardi arichiardi 6131 Nov 13 10:04 goog.debug.logrecord.js
-rw-rw-r-- 1 arichiardi arichiardi 2404 Nov 13 10:04 goog.debug.relativetimeprovider.js
oh sorry yeah it is there
at this full path /home/arichiardi/git/laputa/.shadow-cljs/builds/migrate/dev/out/cljs-runtime/goog.debug.error.js
?
uhm...nope
it seems like it expects in the parent of the project folder
the project path is /home/arichiardi/git/laputa/event-store/.shadow-cljs/builds/migrate/dev/out/cljs-runtime/goog.debug.error.js
I must have messed something up
yeah that ends up correctly in :output-to "./bin/migrate-event-store"
it'll have something like var SHADOW_IMPORT_PATH = __dirname + '/../../.shadow-cljs/builds/script/dev/out/cljs-runtime';
at the beginning somewhere
yeah var SHADOW_IMPORT_PATH = __dirname + '/../../.shadow-cljs/builds/migrate/dev/out/cljs-runtime';
I am on 2.6.23
in this project
and if (__dirname == '.') { SHADOW_IMPORT_PATH = "/home/arichiardi/git/laputa/event-store/.shadow-cljs/builds/migrate/dev/out/cljs-runtime"; }
it seems like it does not go in the if
__dirname
is HEY /home/arichiardi/git/laputa/event-store/bin
I put a console.log
lemme try
it works with the above
but...
kk good to know
so the scripts runs now but it does not connect to any REPL, I am never sure we added support for :node-script
REPLs ๐
soooo should the script stop with something like
{:target :node-script
:main laputa.event-store.migrate/-main
:output-to "bin/migrate-event-store"
:release {:compiler-options {:optimizations :advanced
:source-map true}}}
it probably does but it might be a problem in my script...which has option validation with failures
yeah probably that's what happens
so never mind about the second issue
and really thanks about debugging and solving the first
Today is debugging day, so I have this:
$ cat .shadow-cljs/config.edn
{:node-modules {:install-cmd ["--network-concurrency" "1" :packages]}}
but I still see running: yarn add ... packages
is that the right place where to put that conf?
oh I see it is in $HOME
...but I also can put it in shadow-cljs.edn
it seems
seems to work, definitely nice
shadow-cljs - config: /home/arichiardi/git/laputa/scrutinize-fn/shadow-cljs.edn cli version: 2.7.3 node: v8.12.0
shadow-cljs - starting via "clojure"
running: yarn add --network-concurrency 1 ....packages....
agree ๐
When we do (shadow/release :prod)
for the production build, do we need to do compression ourselves?
as gzip -9 js-file.js
I mean when doing the release of the assets
I am pushing this to s3
and within the bucket I obviously see the uncompressed js