This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-06-27
Channels
- # admin-announcements (3)
- # beginners (26)
- # boot (12)
- # cider (1)
- # cljs-dev (13)
- # cljsjs (101)
- # cljsrn (5)
- # clojure (64)
- # clojure-android (1)
- # clojure-gamedev (1)
- # clojure-greece (23)
- # clojure-nl (9)
- # clojure-poland (2)
- # clojure-russia (3)
- # clojure-spec (11)
- # clojure-uk (159)
- # clojurescript (19)
- # component (1)
- # core-async (2)
- # cursive (2)
- # datascript (1)
- # datomic (2)
- # devcards (1)
- # events (1)
- # funcool (1)
- # hispano (1)
- # hoplon (24)
- # immutant (12)
- # jobs (1)
- # keechma (18)
- # lein-figwheel (2)
- # leiningen (2)
- # off-topic (8)
- # om (23)
- # onyx (4)
- # planck (26)
- # re-frame (149)
- # reagent (6)
- # ring-swagger (9)
- # spacemacs (1)
- # specter (33)
- # spirituality-ethics (11)
- # testing (10)
- # untangled (335)
- # utah-clojurians (3)
- # vim (3)
- # yada (46)
@jiangts, for UMD, packaging, you need a webpack config file. The config file mentioned by @juhoteperi is a great start. Have a look at this one as well: https://github.com/bvaughn/react-virtualized/blob/master/webpack.config.umd.js
You may want to mark React as an external library. else it will get included in the build.
@lwhorton: have a look at https://github.com/bvaughn/react-virtualized/blob/master/webpack.config.umd.js for creating an external webpack dependency for react-addons-css-transition-group
@rohit: I figure you are ducky on gh (gievn your avatar)? Figured it would be better to talk here over my cljsjs/react-toolbox PR.
can you explain (or point me to some link) why in this instance we dont need a deps.cljs file?
@lwhorton: i think the whole boot-cljs creates the deps file. So you don't need to do it explicitly
does the boot-cljs also publish these to clojars under the group cljsjs? I’m assuming that’s the case, but couldn’t find it anywhere in the source...
don't confuse boot-cljs with boot-cljsjs 🙂
@martinklepsch: good point.
cant tell you how many times in the last few days i’ve spent time looking for bugs that were cljsjs->cljs or cljs->cljsjs
@lwhorton: i think the reason material-ui
includes its own copy of deps.cljs
is because it does some very custom stuff
how might I test that? i suppose I can just remove the file and try to rebuild, but is that “good enough”?
Look at this document: https://github.com/cljsjs/packages/wiki/Creating-Packages#7-install-your-package-locally-and-try-it-out
also you could then create a demo repo using your package to test if the files in your package are as you expect them
@lwhorton: i tried installing your new changes and they don't work. I get an exception: clojure.lang.ExceptionInfo: java.lang.IllegalArgumentException: No such task (package)
so i just tried to run this all through in a fresh repo after removing the deps file, and i did it on an entirely different computer. pulling in the cljsjs/react-toolbox during the boot “build my app” task fails because it cannot find react-toolbox.
i dont know if that’s an artifact of the fact that the ci hasn’t run and published to clojars with the deps file… but that’s kind of a pain to deal with anyways eh? packaging and testing locally requires a different fileset than in ‘prod mode’
@lwhorton: theres a deps-cljs
task which most packages use to generate the file which is missing from your PR
@lwhorton: exactly what @martinklepsch is saying
Consider following the guide once from start to finish, this should give you a good understanding of the tooling available/necessary: https://github.com/cljsjs/packages/wiki/Creating-Packages
i actually did read that through 2-3 times, but now that I know what I’m looking for I can see where I went wrong. Perhaps it’s a little confusing, given the section about “see how deps.cljs was autogenerated” comes before any mention of the deps-cljs task.
@rohit i’m concerned about your error — did you clone my fork, checkout the branch, cd into the lib and try to run build package, then get that error?
@lwhorton: you mean in section 6?
yes.. in section 5 it talks about the pom and a task for packaging (doesnt talk about what the package task* might look like), but then goes right into “after the package task is done”. It might be helpful to say “here’s some examples of a typical package task, take advantage of cljsjs-packaging to autogenerate things like {foo bar baz]”.
I'm not a native speaker so maybe language is just a bit off? Feel free to edit if you have ideas how to make it clearer
Major - your usage of deps-cljs
doesn't include react. see https://github.com/cljsjs/packages/blob/master/react-motion/build.boot#L55
also your in your sift task just about the deps-cljs
, you don't need to include deps.cljs
have a look at this exact line: https://github.com/bvaughn/react-virtualized/blob/master/webpack.config.umd.js#L19
so you'll have react-addons-css-transition-group: var React.addons.ReactCSSTransitionGroup
[i think]
hm.. their packaging is so confusing. there’s a react-with-addons but what does it include? do you have to include react-with-addons and then all the react-addons-* that you want?
i see. but should my webpack then have an external react-with-addons instead of it’s current react?
^ Haha, I can agree
I hate especially the react with-addons stuff
@juhoteperi: the sad truth is that no one does
Would be much easier for us if the addons were separate package
I think the react people just expect everyone to use babel and webpack and they are building everything around those two.
In that context I\m sometimes a bid sad that we're so stuck on React as CLJS community
Yeah, it has its cons and pros
there are a bunch of alternative implementations of react— everything from reactlite, to things like virtualdom/deku
it would be great if things like reagent were a little less tied to react, and instead focused on an implementation interface
and plugins could extend the subset of the interface, so you can extend to more implementation-specific hooks or whatever
for some projects you need react for its rich ecosystem and backwards compatibility regarding browsers
and at 130kish, react is pretty intense compared to some lighter vdoms that are as small as 5k
there is preact as well. https://github.com/developit/preact
that whole es6 class thing is just another can of worms… i cant* believe they leaked classes into the spec
there’s some really good reading by this guy https://medium.com/@_ericelliott