This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-06-11
Channels
- # aleph (1)
- # aws (4)
- # aws-lambda (5)
- # beginners (85)
- # cider (39)
- # cljs-dev (3)
- # cljsrn (1)
- # clojars (1)
- # clojure (129)
- # clojure-italy (14)
- # clojure-nl (5)
- # clojure-nlp (1)
- # clojure-uk (61)
- # clojurescript (52)
- # cursive (3)
- # datomic (42)
- # duct (3)
- # emacs (9)
- # fulcro (60)
- # graphql (2)
- # juxt (2)
- # keechma (1)
- # leiningen (4)
- # midje (2)
- # off-topic (8)
- # onyx (3)
- # overtone (1)
- # re-frame (22)
- # reagent (51)
- # reitit (3)
- # remote-jobs (3)
- # ring (4)
- # ring-swagger (1)
- # rum (4)
- # shadow-cljs (14)
- # specter (28)
- # tools-deps (85)
- # vim (9)
Hello all, I´m trying to use reagent-template, but when I start it from cider, the error shows up Call to clojure.core/fn did not conform to spec
. What´s wrong?
check your clojure and clojurescript versions
if you want a quick fix, you could try https://github.com/bhauman/figwheel-template instead (which is used more)
also can you print the entire error?
Does anyone have an example of using npm-deps to load a Clojurescript react library with Reagent 16.4.0? I cannot get it to work for the life of me. I have tried adding npm deps for react-dom,react,create-react-class and adding cljsjs externs for those librariesthe cljsjs packages for those libraries
are you sure you want to use npm-deps? that feature is pretty experimental and it will run you javascript through the advanced closure compiler. if the code isn’t ready for that, it will break
@bfast > or use foreign-libs with webpack for this variant, good resources are * https://github.com/pesterhazy/presumably/blob/master/posts/double-bundle.md * http://blob.tomerweller.com/reagent-import-react-components-from-npm * https://gist.github.com/jmlsf/f41b46c43a31224f46a41b361356f04d
So basically the most popular foreign JS library breaks with npm-deps and the most popular CLJS front-end library (reagent) ?
right. and the documentation for the feature doesn’t really explicitly tell you what it does. and nobody is really supporting it. and the most visible article on the feature strongly suggests that it’s a good idea to use it.
I think you can make reagent work, but agree with @lee.justin.m that you'll have an easier time with one of the option he mentioned
I have yet to see any evidence of Reagent 0.8.1 + a npm React library working through npm-deps... sorry just frusterated
I understand the frustration
for what it is worth, shadow-cljs makes this work super smoothly and does what you probably expected npm-deps to do
npm-deps is not mentioned in the readme
if you have some time to build a repro, you could try filing an issue in the reagent github
And upgrade guide mentions Cljsjs foreign libs is the recommended setup
The problem is that I want to use someone else's react library which is only published through npm
if you want to use cljsjs, you can use one of the cljsjs deps as a template and modify that
in my experience that gets tedious after a while
for me frictionless access to any and all npm react libs is important
the "double bundle" approach gives you just that (and from what I hear shadow-cljs does too)
@U06F82LES I like the double bundle approach so far (recently started using it more).
A few things that I need to solve still though:
* Integrating it into a build appropriately - would be ideal to have lein
have a pre-process step that did the yarn build
or whatever that builds the bundle via webpack
* If I have a “library module” of cljs that I want to use in another project, then that lib won’t have it’s bundle included, so this means I’d have to “inherit” it’s double bundle config somehow (if that makes sense)
Just curious if you have ran into these issues
re: building, this is as simple as running yarn build
or npm run build
before lein dev
. Yes it's a separate step but (a) it only has to be rerun when package.json changes and (b) it's pretty fast
you can also add a wrapper script scripts/dev
that does yarn build && lein dev
not sure I understand what you mean by "library module"
can you explain more?
re: building - that is reasonable. I think I wouldn’t want to checkin the node_modules or the actual bundle (pretty big things and may have a dev vs prod build), so I would need to have some build script that could be run like on a CI server or someone else’s machine to install without too much trouble.
> not sure I understand what you mean by “library module”
So to try to explain:
if I have a cljs project A
that has, eg common Reagent components in it
Say A
uses a few :foreign-libs
via a double bundle approach, like it uses react-datepicker
perhaps.
Now I have a cljs project B
that is using A
.
It will have to redeclare all of A
s webpack config to get the same dependencies loaded as A
did, since they won’t just “be on the classpath” or automatically put into :foreign-libs
I believe.
Right yeah you’d have to duplicate the deps
I mean you can configure it differently but you have to config it in a way that includes all the transitive deps that this lib depends on.
cljsjs and npm-deps, unfortunately, don't
(that being said, if you don't need unpackaged npm libs, cljsjs is the best user experience for beginners)