This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-08-31
Channels
- # announcements (3)
- # aws-lambda (1)
- # babashka (122)
- # beginners (241)
- # calva (28)
- # cider (7)
- # clara (7)
- # clj-kondo (43)
- # clojars (5)
- # clojure (326)
- # clojure-europe (60)
- # clojure-italy (2)
- # clojure-nl (4)
- # clojure-spec (21)
- # clojure-uk (4)
- # clojurescript (162)
- # cursive (30)
- # datomic (3)
- # editors (5)
- # emacs (4)
- # figwheel-main (1)
- # fulcro (24)
- # gratitude (3)
- # helix (7)
- # honeysql (20)
- # improve-getting-started (1)
- # introduce-yourself (11)
- # jobs (3)
- # joker (2)
- # kaocha (15)
- # lsp (21)
- # lumo (2)
- # meander (3)
- # off-topic (34)
- # re-frame (6)
- # reagent (1)
- # releases (4)
- # rum (2)
- # shadow-cljs (37)
- # spacemacs (16)
- # tools-deps (16)
- # vim (23)
- # xtdb (32)
Hello 👋 , is there a way to get the shadow-cljs repl to indent output? or even add some coloring?
apiyo@apiyo-ThinkPad:~/git-repos/zebra/quagga$ yarn start-repl
yarn run v1.22.10
$ shadow-cljs cljs-repl app
shadow-cljs - config: /home/apiyo/git-repos/zebra/quagga/shadow-cljs.edn
shadow-cljs - connected to server
NPM dependency "highlight.js" has installed version "10.1.1"
"10.7.2" was required by jar:file:/home/apiyo/.m2/repository/superstructor/re-highlight/0.0.2/re-highlight-0.0.2.jar!/deps.cljs
cljs.user=> (js/console.log "test")
nil
cljs.user=> (require 'quagga.components.dataview.table.subs-test)
nil
> (cljs.test/run-tests 'quagga.components.dataview.table.subs-test)
Testing quagga.components.dataview.table.subs-test
FAIL in (flatten-dataset) (quagga/components/dataview/table/subs_test.cljs:25:8)
expected: (= flattened-record-list (subs/flatten-dataset record-list))
actual: (not (= {:kids [nil], :kids/kids_details [[{:kids/kids_age 2, :kids/kids_name "Tom", :kids/immunization_info [{:kids/vaccine "Polio"} {:kids/vaccine "Rickets"}]} {:kids/kids_age 5, :kids/kids_name "Dick", :kids/immunization_info [{:kids/vaccine "Malaria"} {:kids/vaccine "Flu"} {:kids/vaccine "Polio"}]}]], :kids/nested_group [nil], :formhub [nil], :top-level-records ({:_id 60381, :_attachments [], :_media_all_received true, :kids/has_kids "1", :_duration "", :formhub "Repeat with 0 answers", :_xform_id_string "nested_repeats", :_total_media 0, :_status "submitted_via_web", :_submitted_by "frankapiyo", :formhub/uuid "f19b44ccf710492eb4d1ed6f468324f1", :meta/instanceID "uuid:0f100159-280c-49a6-be7d-04460506b37d", :_edited false, :kids/nested_group "Repeat with 0 answers", :kids/kids_details "Repeat with 2 answers", :_tags [], :kids "Repeat with 0 answers", :_bamboo_dataset_id "", :_submission_time "2020-12-03T07:06:50", :_uuid "0f100159-280c-49a6-be7d-04460506b37d", :web_browsers "", :_version nil, :_notes [], :_media_count 0, :_geolocation [nil nil], :_xform_id 2231})} {:kids [nil], :formhub [nil], :top-level-records ({:_id 60381, :_attachments [], :_media_all_received true, :kids/has_kids "1", :_duration "", :formhub "Repeat with 0 answers", :_xform_id_string "nested_repeats", :_total_media 0, :_status "submitted_via_web", :_submitted_by "frankapiyo", :formhub/uuid "f19b44ccf710492eb4d1ed6f468324f1", :meta/instanceID "uuid:0f100159-280c-49a6-be7d-04460506b37d", :_edited false, :kids/kids_details [{:kids/kids_age 2, :kids/kids_name "Tom", :kids/immunization_info [{:kids/vaccine "Polio"} {:kids/vaccine "Rickets"}]} {:kids/kids_age 5, :kids/kids_name "Dick", :kids/immunization_info [{:kids/vaccine "Malaria"} {:kids/vaccine "Flu"} {:kids/vaccine "Polio"}]}], :_tags [], :kids "Repeat with 0 answers", :_bamboo_dataset_id "", :_submission_time "2020-12-03T07:06:50", :_uuid "0f100159-280c-49a6-be7d-04460506b37d", :web_browsers "", :_version nil, :_notes [], :_media_count 0, :_geolocation [nil nil], :_xform_id 2231})}))
Ran 8 tests containing 23 assertions.
1 failures, 0 errors.
nil
cljs.user=>
Done in 654.01s.
or, is there some kind of shell that would automatically indent edn that you know of?
you could run your tests somewhere else, if you use emacs, cider has a good UI for test results https://docs.cider.mx/cider/testing/running_tests.html
Hi! What is the best / recommended way to wrap a library that uses a js library? Could it be used in a library built by figwheel? Some background: we want to create a common component library (built with shadow) but we are still using figwheel in one of our libraries so I was wondering if that would even work.
you might have some trouble with the js library though. out of the box figwheel doesn't provide those
so you either need a cljsjs package alternative of the figwheel users need to use the new-ish :target :bundle
from regular CLJS
How would it work if the app is built with shadow? I mean how will shadow know that a cljs lib A uses a JS lib B?
Does :npm-deps
work only with shadow ?
I am asking in two contexts: 1. Does lib A need to be built with shadow? 2. Does an app that consumes lib A need to be built with shadow?
libs are source only. they don't contain ANY compiled artifacts whatsoever. so no they have no reliance on shadow-cljs whatsoever
:npm-deps
is a regular CLJS option, it is information only. acting on it may require calling a function. eg. cljs.main
with --install-deps
or so
but again ... the context here is a library doing something like (:require ["react" :as react])
something needs to provide react
. shadow-cljs will just do so via npm
. regular CLJS and figwheel will not
(in both those cases :npm-deps
are entirely irrelevant since the cljs compiler will not handle npm at all)
Thank you @U05224H0W for your explanation
Is this the latest guide https://shadow-cljs.github.io/docs/UsersGuide.html? It reads > Version 1.0,Jan 10, 2018 > I suppose there have been changes since that?
Also, did not shadow had a standalone web page? http://shadow-cljs.org/ points just back to the GH repo...
There’s https://shadow-cljs.github.io/
It may be useful to update the url under About
to one of those @U05224H0W
That is the latest guide. I think the date is just wrong @U0522TWDA Source for the docs is here, I think https://github.com/shadow-cljs/shadow-cljs.org
is there a command I can send to my shadow-cljs session to kick all the connected tabs? I split my work between two computers, and while they both get code updates all the Fireplace.vim commands are going to only one of them.
why kick? you can select which tab to talk to when starting the REPL. don't know how in fireplace though
oh there is also :repl {:runtime-select :latest}
(top-level shadow-cljs.edn) to always pick the last connected runtime for the REPL instead of the first
ooh! that sounds perfect. then I can just refresh when I switch machines.
fwiw you can see the currently connected runtimes listed here http://localhost:9630/runtimes (or they log they id in the browser console on startup: shadow-cljs #4 ready! or so)
you can pick which runtime to talk to via (shadow.cljs.devtools.api/repl :the-build-id {:runtime-id 4})
I'd use :CljEval ...the above...
to signal to the Clojure side of the REPL rather than the JS side.