This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-11-09
Channels
- # aleph (3)
- # beginners (327)
- # calva (3)
- # cider (20)
- # cljdoc (59)
- # cljs-dev (40)
- # clojure (104)
- # clojure-dev (30)
- # clojure-italy (8)
- # clojure-nl (36)
- # clojure-russia (3)
- # clojure-spec (3)
- # clojure-uk (79)
- # clojurescript (54)
- # community-development (5)
- # cursive (28)
- # data-science (21)
- # datomic (35)
- # emacs (14)
- # expound (1)
- # figwheel (2)
- # figwheel-main (82)
- # fulcro (18)
- # graphql (13)
- # jobs (12)
- # jobs-discuss (38)
- # kaocha (8)
- # lambdaisland (1)
- # lumo (12)
- # off-topic (20)
- # onyx (4)
- # re-frame (51)
- # reagent (12)
- # reitit (8)
- # ring-swagger (1)
- # shadow-cljs (22)
- # slack-help (2)
- # spacemacs (6)
- # specter (16)
- # testing (3)
I'm trying to debug a react library react-sortable-hoc
https://github.com/clauderic/react-sortable-hoc. I installed it locally using npm install extern/react-sortable-hoc
. The package.json
file contains the following:
"dependencies": {
"create-react-class": "^15.6.2",
"left-pad": "file:extern/left-pad",
"react": "^16.0.0",
"react-dom": "^16.0.0",
"react-sortable-hoc": "file:extern/react-sortable-hoc"
}
I have also checked that node_modules/react-sortable-hoc
is pointing to the extern/react-sortable-hoc
. But when I refer to this library from cljs, the following error appears
[:frontend] Build failure:
The required JS dependency "react-sortable-hoc" is not available, it was required by "sortable/frontend/sortable.cljs".
Searched in:sortable/node_modules
As a test, I git-cloned the left-pad
library and installed it locally, but it works.
(:require [reagent.core :as r :refer [atom]]
[reagent.ratom :refer-macros [reaction]]
["react-sortable-hoc" :as rsh]
["left-pad" :as lp]
@richiardiandrea shadow-cljs just calls npm install <packages-from-deps-cljs>
or yarn add <packages>
(if yarn.lock
) exists
@priornix are you sure that there are all the actual files in node_modules/react-sortable-hoc
? npm sometimes leaves empty directories (non-linked)
@priornix did you build the react-sortable-hoc
? the git repo does not contain the dist files so that may be the problem?
@thheller Thanks, I only ran npm install
. Running npm run-scripts build
works.
This is probably obvious, but I can’t immediately work out how I see or configure or update the clojurescript version that an existing shadow-cljs project depends on? There’s no mention in the package.json, shadow-cljs.edn (or project.clj - I’m using cursive).
@grumplet shadow-cljs has a default version is depends on. I do not recommend changing that.
Ah thanks. Just found that the version is listed in https://clojars.org/thheller/shadow-cljs. This wasn’t an immediate need, but I have had reason to change the clojurescript version I depended on in other non-shadow projects, so got to thinking…
shadow-cljs typically depends on the latest release. downgrading may not always be possible. 2.7.0
for example requires 1.10.439+
since there were some breaking changes in the cljs.analyzer (given that breaking changes are quite rare)
I'm getting this in my compiled/released javascript. Does the compiler remove tests that are included as {:test #(assert...)}
metadata of a function? If not, I can pull them out. I just liked that I could have my tests right next to my functions...
Just curious, are people still compiling their SASS for their CLJS app in a separate process? Or is there something built-in to shadow-cljs?
Is this the relevant ticket? https://github.com/thheller/shadow-cljs/issues/381
@loganpowell asserts are typically elided but that particular way to add tests might not be depending on whether you accessed the var somewhere
Thanks man. I'm moving the tests out of the metadata currently, so I'll let you know
I am still debugging a problem where the yarn add
that Shadow launches is not see my .yarnrc
...
can it be that environment vars like HOME
are not set when the shell with yarn add
is launched?