This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-11-12
Channels
- # beginners (34)
- # boot (14)
- # cider (2)
- # cljs-dev (21)
- # cljsrn (1)
- # clojure (31)
- # clojure-android (10)
- # clojure-spec (12)
- # clojure-uk (3)
- # clojurescript (64)
- # cursive (31)
- # data-science (9)
- # datomic (27)
- # fulcro (11)
- # graphql (14)
- # jobs (1)
- # leiningen (1)
- # lumo (27)
- # off-topic (65)
- # om (2)
- # onyx (77)
- # pedestal (1)
- # re-frame (4)
- # shadow-cljs (6)
- # vim (1)
- # yada (3)
@plexus renaming happens in Closure so that usually means something has gone wrong so that Closure doesn’t know about the module for some reason
Hey, got pointed here from #clojurescript:
Does anyone know how to require an rpm namespace with an @-symbol in its name? I've the following entry in my :npm-deps
compiler entry:
"@aeaton/react-prosemirror" "^0.9.7"
(It's a string rather than a keyword as keywords can't contain @-symbols)
That does add the right dependency to package.json
, but then the following require fails:
["@aeaton/react-prosemirror" :refer [Editor MenuBar]]
with the compiler error:
No such namespace: @aeaton/react-prosemirror, could not locate _CIRCA_aeaton_SLASH_react_prosemirror.cljs, _CIRCA_aeaton_SLASH_react_prosemirror.cljc, or JavaScript source providing "@aeaton/react-prosemirror"
From reading the :verbose
output of cljsbuild, the "@aeaton/react-prosemirror" is never downloaded as part of the node.js dependencies installation phase (the others are all listed)
So working around the @
symbol by including it as a string in the :npm-deps map only works because it gets skipped? (though the spec for that map does say keywords, strings or symbols are valid)
Just as a side note, I PR-ed npm deps reading with scope in lumo
- it might be not supported in ClojureScript currently as well
@oliver.mooney I think that packages that are never required may not be downloaded.
When I require "@aeaton/react-prosemirror/dist"
, the package resides in node_modules
and is compiled, but later there's another error regarding this string not being a symbol.
Ah, thanks @richiardiandrea looks like the cljs compiler had it fixed here?
Oh yep it looks like it is there after all
@p-himik yeah, I do have a require statement in a namespace, as ["@aeaton/react-prosemirror" :refer [Editor MenuBar]]
(one entry in a larger list)
Just for curiosity, does a js/require
work?
@richiardiandrea actually js/require is unrecognised at the repl, hmm
@p-himik oh I see what you're saying - if the require entry is wrong it'll also result in the package not being copied across in the compiler's :verbose
output
so it's not an npm-deps issue (since the package is in the node_modules
dir, it's the require statement at fault
@oliver.mooney if I had to guess I’d say you’re hitting this issue: https://github.com/google/closure-compiler/issues/2586
@anmonteiro is that just for UMD wrappers? react-prosemirror is es6
it’s not
@oliver.mooney https://github.com/hubgit/react-prosemirror/blob/master/packages/react-prosemirror/package.json#L42
ah, you're right @anmonteiro thanks
I'm attempting to use :npm-deps
to use a browser JS library nivo
and it looks like the following type of call is not getting processed: export * from './components/charts/bar'
Is this a case of also needing babel preprocessing? If the JS library uses JSX and es6 do I need to also do a custom :foreign-libs
entry with a reference to the cljsjs-babel-standalone? How does this work with :npm-deps
? Any example of this I can look at?