This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-05-18
Channels
- # announcements (9)
- # atom-editor (29)
- # aws (17)
- # babashka (72)
- # beginners (83)
- # braveandtrue (3)
- # calva (7)
- # cider (16)
- # clj-kondo (15)
- # cljs-dev (146)
- # cljsjs (1)
- # cljsrn (8)
- # clojars (1)
- # clojure (96)
- # clojure-dev (19)
- # clojure-europe (53)
- # clojure-losangeles (1)
- # clojure-nl (3)
- # clojure-spec (7)
- # clojure-uk (235)
- # clojuredesign-podcast (5)
- # clojurescript (81)
- # conjure (73)
- # cursive (7)
- # data-science (1)
- # datomic (5)
- # defnpodcast (8)
- # emacs (3)
- # figwheel-main (34)
- # fulcro (83)
- # graalvm (10)
- # graphql (6)
- # helix (49)
- # jackdaw (3)
- # jobs (1)
- # joker (1)
- # kaocha (1)
- # mid-cities-meetup (10)
- # off-topic (17)
- # pathom (16)
- # re-frame (11)
- # reagent (18)
- # reitit (18)
- # remote-jobs (4)
- # shadow-cljs (63)
- # spacemacs (18)
- # specter (20)
- # sql (17)
- # uncomplicate (1)
- # vim (28)
- # xtdb (32)
I would like to write a library using shadow-cljs
(with npm dependencies) and use it from another shadow-cljs
app, I can work out how does the app consume the npm dependencies of the library?
There was stuff in the docs about deps.cljs
but I could not get that to work and I am not sure if that is what I need?
@sofra A library can provide transitive npm deps to a dependent project by putting a deps.cljs
on the classpath containing {:npm-deps {"name" "version"}}
. Reagent has an example: https://github.com/reagent-project/reagent/blob/master/src/deps.cljs
thanks! So does the dependant project then need to also include its own package.json to provide the dependancy?
No. shadow-cljs will inject these into the dependent project's package.json via npm install --save --save-exact ...
hi , where should I look if I want to add support for
:build-complete
:build-failure
:build-start
in
:devtools
Maybe this comment could help https://github.com/thheller/shadow-cljs/pull/707#issuecomment-627004576
Hey folks - 100% sure this has been answered somewhere, but I canât find it. Is there an issue with spec generation in shadow specifically even after Iâve manually included org.clojure/test.check
?
(which seems to be the working solution for regular cljs)
found a slack log from a couple of years ago of @thheller discussing the weirdness of it not working
Iâm getting:
Var clojure.test.check.generators/simple-type-printable does not exist, clojure.test.check.generators never required
I had the same error last week, the way I solved was requiring clojure.test.check.generators
ha. thatâs embarrassing đ
think I switched from one error message to a different one after including test.check
and didnât pay attention - thanks!
sure, no problem!
Is there a way of excluding a file when doing the release of the app? I have a cljs file that itâs used only during developtment with some objects and data that I want to exclude when making the final js
what target? I canât see anything included in my output for a node-library
thatâs not referenced by an extern
i.e. any namespace thatâs required by code thatâs ultimately externâd will end up in the output, but if itâs not referenced, it shouldnât appear
is for the browser, I have a file with an initial json, used to initialize the state of my re-frame app, this is only for development, because in production the json is provided by the page that loads the clojurescript app
but when I release my app the data structure I use in develop is in the final js file, so I want to exclude it
or maybe I should use this? https://shadow-cljs.github.io/docs/UsersGuide.html#build-hooks
@wvelezva would help to see some code. I don't quite understand your setup but build-hooks are likely not the solution.
@thheller this is an very close example of what i have https://github.com/wvelezva/exclude-example-data
I think it doesnât work, there are some files that I didnât include
the data in dev is a subset of what a user get in production
sorry, I donât understand đ
you mean pass in the data where? in the html?
in release I do nothing, the js is used in an html that provide a js structure with all the data
so there is an âexternalâ app that provides the input to initialize the js
you are already passing in a bunch of stuff via https://github.com/wvelezva/exclude-example-data/blob/master/resources/public/index.html
why does that have to be part of the CLJS code when the release version doesn't do that?
I had it that way, I wanted to arrive hereâŚ.
now, I want to use the same structure in the tests, and I didnât know how to feed my tests without replicating the data
I want to use the same src of data
really there are many options ... if you try with the delay
you maybe can just leave things as they are
I read that there is experimental support for loading js file with shadow, so I also thought about create a js which I can include in the index.html and in the test.cljs
Iâm talking about using this in my tests to load the same data that I can use in the index,html of my dev setup
thats no different than what you have now, except that it loads JS files instead of CLJS
How should I declare an object in the included js file in order to used in the cljs file?
var testScores = [
{ id: 1, score: 86, gradeLetter: "B" },
{ id: 2, score: 93, gradeLetter: "A" },
{ id: 3, score: 78, gradeLetter: "C" }
];
I have this js arraythanks