This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-07-26
Channels
- # aleph (1)
- # beginners (96)
- # boot (5)
- # cider (44)
- # cljdoc (11)
- # clojure (73)
- # clojure-conj (4)
- # clojure-dev (1)
- # clojure-finland (2)
- # clojure-italy (7)
- # clojure-new-zealand (1)
- # clojure-nl (3)
- # clojure-spec (4)
- # clojure-uk (66)
- # clojurescript (114)
- # code-reviews (16)
- # cursive (15)
- # datomic (37)
- # emacs (6)
- # events (2)
- # figwheel-main (12)
- # fulcro (36)
- # graphql (19)
- # hoplon (2)
- # hyperfiddle (3)
- # jobs (2)
- # leiningen (4)
- # off-topic (36)
- # om (1)
- # om-next (2)
- # other-languages (1)
- # re-frame (12)
- # reagent (12)
- # reitit (5)
- # remote-jobs (4)
- # ring (2)
- # shadow-cljs (218)
- # spacemacs (8)
- # specter (7)
- # sql (34)
- # tools-deps (9)
- # uncomplicate (6)
Have people had success with :npm-deps
? I made a new re-frame project with lein new re-frame npm-deps-test
then added
:npm-deps {:react "16.4.1"
:react-text-mask "5.4.3"}
:install-deps true
in the :compiler
map. But when I :require [react-input-mask]
in views.cljs
, I get the following error:
No such namespace: react-input-mask, could not locate react_input_mask.cljs, react_input_mask.cljc, or JavaScript source providing "react-input-mask"
Check out #shadow-cljs. I was tearing my hair out over that, and then I switched to Shadow. Worked flawlessly, with no additional configuration.
Thanks henrik, I looked into this a little, but I’m not sure if it’ll be fragile long-term versus the native npm-deps
.
Well, if it is, switching shouldn’t be more work than you’re spending on it right now.
This is roughly what my package.json
looks like:
{
"name": "server+client",
"description": "Basic setup",
"scripts": {
"purge": "./clean.sh",
"sass:dev": "sass --watch src/sass/main.sass:../public/css/main.css",
"sass:release": "sass src/sass/main.sass:../public/css/main.css",
"server:dev": "./shadow-cljs watch server",
"server:release": "./shadow-cljs release server",
"client:dev": "./shadow-cljs watch client",
"client:release": "./shadow-cljs release client",
"release": "yarn purge; yarn server:release && yarn client:release && yarn sass:release"
},
"dependencies": {
"react": "^16.4.0",
"react-dom": "^16.4.0",
"shadow-cljs": "^2.4.5"
},
"private": true
}
Thanks henrik, I’ll take a deeper look at shadow-cljs. If anyone else has advice, I’m all ears.
npm-deps
should be considered still experimental and is thus only for those who are adventurous. Most common alternatives that I know of for consuming packages from npm are:
- shadow cljs (simplest setup and best developer experience)
- “double bundle” (use webpack to manage and build npm deps) https://clojurescript.org/guides/webpack
So sad… but thanks!
Also you may find some libraries ”pre-packaged” in cljsjs. http://cljsjs.github.io They are easy to use but only small subset of npm libraries and versions are there.
Thanks, but not everything is on it, e.g., react-input-mask