This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-10-30
Channels
- # aleph (4)
- # announcements (5)
- # architecture (1)
- # aws (5)
- # babashka (12)
- # beginners (143)
- # chlorine-clover (4)
- # cider (16)
- # clj-kondo (44)
- # cljfx (26)
- # cljsrn (2)
- # clojure (34)
- # clojure-europe (28)
- # clojure-gamedev (1)
- # clojure-nl (3)
- # clojure-provo (2)
- # clojure-spec (6)
- # clojure-uk (17)
- # clojurescript (99)
- # code-reviews (6)
- # core-async (15)
- # cryogen (9)
- # cursive (14)
- # data-science (1)
- # datomic (16)
- # duct (1)
- # events (4)
- # exercism (1)
- # figwheel-main (3)
- # fulcro (3)
- # hugsql (7)
- # leiningen (4)
- # malli (15)
- # off-topic (13)
- # pathom (8)
- # re-frame (7)
- # reitit (35)
- # remote-jobs (1)
- # sci (10)
- # shadow-cljs (32)
- # sql (5)
- # tools-deps (102)
- # tree-sitter (3)
- # uncomplicate (7)
- # vim (40)
- # xtdb (8)
@U09LZR36F I was wondering about this but from the configuration it looks right to me... I'm using lein
, here's my project.clj
(defproject guestbook "0.1.0-SNAPSHOT"
:description "FIXME: write description"
:url ""
:dependencies [[ch.qos.logback/logback-classic "1.2.3"]
[cljs-ajax "0.8.0"]
[reagent "0.10.0"]
[cheshire "5.9.0"]
[clojure.java-time "0.3.2"]
[com.h2database/h2 "1.4.200"]
[conman "0.8.4"]
[cprop "0.1.15"]
[expound "0.8.3"]
[funcool/struct "1.4.0"]
[luminus-http-kit "0.1.6"]
[luminus-migrations "0.6.6"]
[luminus-transit "0.1.2"]
[luminus/ring-ttl-session "0.3.3"]
[markdown-clj "1.10.1"]
[metosin/muuntaja "0.6.6"]
[metosin/reitit "0.3.10"]
[metosin/ring-http-response "0.9.1"]
[mount "0.1.16"]
[nrepl "0.6.0"]
[org.clojure/tools.cli "0.4.2"]
[org.clojure/tools.logging "0.5.0"]
[org.clojure/clojure "1.10.1"]
[org.clojure/clojurescript "1.10.520" :scope "provided"]
[org.webjars.npm/bulma "0.8.0"]
[org.webjars.npm/material-icons "0.3.1"]
[org.webjars/webjars-locator "0.38"]
[ring-webjars "0.2.0"]
[ring/ring-core "1.8.0"]
[ring/ring-defaults "0.3.2"]
[selmer "1.12.18"]
[cider/piggieback "0.5.1"]]
:min-lein-version "2.0.0"
:source-paths ["src/clj" "src/cljc"]
:test-paths ["test/clj"]
:resource-paths ["resources", "target/cljsbuild"]
:target-path "target/%s/"
:main ^:skip-aot guestbook.core
:plugins [[lein-cljfmt "0.7.0"] [lein-cljsbuild "1.1.7"]]
:repl-options {:nrepl-middleware [cider.piggieback/wrap-cljs-repl]}
:cljsbuild
{:builds
{:app {:source-paths ["src/cljs" "src/cljc"]
:compiler {:output-to "target/cljsbuild/public/js/app.js"
:output-dir "target/cljsbuild/public/js/out"
:main "guestbook.core"
:asset-path "/js/out"
:optimizations :none
:source-map true
:pretty-print true}}}}
:clean-targets
^{:protect false}
[:target-path
[:cljsbuild :builds :app :compiler :output-dir]
[:cljsbuild :builds :app :compiler :output-to]]
:profiles
{:uberjar {:omit-source true
:aot :all
:uberjar-name "guestbook.jar"
:source-paths ["env/prod/clj"]
:resource-paths ["env/prod/resources"]}
:dev [:project/dev :profiles/dev]
:test [:project/dev :project/test :profiles/test]
:project/dev {:jvm-opts ["-Dconf=dev-config.edn"]
:dependencies [[pjstadig/humane-test-output "0.10.0"]
[prone "2019-07-08"]
[ring/ring-devel "1.8.0"]
[ring/ring-mock "0.4.0"]
[weasel "0.7.1"]]
:plugins [[com.jakemccrary/lein-test-refresh "0.24.1"]
[jonase/eastwood "0.3.5"]]
:source-paths ["env/dev/clj"]
:resource-paths ["env/dev/resources"]
:repl-options {:init-ns user}
:injections [(require 'pjstadig.humane-test-output)
(pjstadig.humane-test-output/activate!)]}
:project/test {:jvm-opts ["-Dconf=test-config.edn"]
:resource-paths ["env/test/resources"]}
:profiles/dev {}
:profiles/test {}})
@U09LZR36F some progress! Now after running :Piggieback (cider.piggieback/cljs-repl (cljs.repl.node/repl-env))
executing a form gives me the following message/error
Execution error (NullPointerException) at cljs.repl.node/node-eval (node.clj:66).
null
Press ENTER or type command to continue
Tried running :Piggieback (cljs.repl.node/repl-env)
but still same error on form executiion 😞
Execution error (NullPointerException) at cljs.repl.node/node-eval (node.clj:66).
null
Press ENTER or type command to continue
FWIW my project isn't figwheel atmYour project doesn't seem to be node, so I don't think that's the right thing to use?
Makes sense, and if I add :target :nodejs
to cljsbuild
my js won't load on navigating to index page after lein cljsbuild auto
because using nodejs
to compile will introduce require
statements which the browser doesnt understand
it seems like if no target is specified default target is the browser, so not node as you mention
Sounds like the thing I may want is to get piggieback to connect to the browser repl (although I don't know how)
Heh for sure, I'll dig deeper and report back on progress -- really appreciate the help 🙂
hey folks , how do you usually sort deps in a namespace. Looking for something like clojure sort ns in emacs clojure mode.
the naiive method works pretty well. go into visual mode, highlight all of the require lines, and run :sort
Not vim-specific but we've had success using https://github.com/immoh/lein-nsorg for this purpose. (There's also a separate lib behind it that could be used: https://github.com/immoh/nsorg/)
I use :sort
but also, since I use CoC, there is a clojure-lsp
binding to sort namespaces too
nnoremap <silent> crcn :call CocRequest('clojure-lsp', 'workspace/executeCommand', {'command': 'clean-ns', 'arguments': [Expand('%:p'), line('.') - 1, col('.') - 1]})<CR>
That's much better than mine 😅 https://github.com/walterl/dotfiles/blob/master/_config/nvim/ftplugin/clojure/clj-clean-ns.vim
Alternatively, avoid arranging deps as one big sorted collection, instead group them by what they are used for. This I find much easier in the long run.
^i agree, assuming you're talking about deps in a deps.edn / project.clj / build.boot
I really like Python's import grouping (from PEP8): > Imports should be grouped in the following order: > > 1. Standard library imports. > 2. Related third party imports. > 3. Local application/library specific imports. > > You should put a blank line between each group of imports.
TIL I follow the python convention.
@clojurians-slack100 due to namespace conventions, alphabetical ordering automatically achieves 1,3
Which conventions are you referring to? I've seen that clean-ns
puts clojure.*
first, but that's it.
I mean that all "standard library" will start with clojure.
and be together alphabetically
and anything from your own project / library should similarly all start with the same prefix
Ah. I understand. The usefulness in the above quote that I perhaps didn't highlight sufficiently, is the grouping of the contexts, at a glance: you know all your project-local ns's are in the last "block", so your eye can really quickly and easily jump to the last block and look for the line you need.