This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-04-08
Channels
- # architecture (8)
- # boot (18)
- # cider (33)
- # cljs-dev (35)
- # cljsrn (3)
- # clojure (77)
- # clojure-dev (6)
- # clojure-dusseldorf (1)
- # clojure-russia (1)
- # clojure-spec (4)
- # clojurescript (40)
- # cryogen (1)
- # cursive (4)
- # dirac (2)
- # emacs (1)
- # figwheel (10)
- # funcool (2)
- # hoplon (21)
- # incanter (2)
- # leiningen (1)
- # lumo (44)
- # off-topic (2)
- # onyx (53)
- # overtone (5)
- # pedestal (8)
- # re-frame (9)
- # reagent (37)
- # rum (9)
- # spacemacs (16)
- # sql (2)
- # testing (1)
- # unrepl (4)
- # untangled (4)
- # yada (16)
Is it planned for add support new :npm-deps
compiler option and use react
dependency from npm
?
why are they deprecating createClass? That's easiest to access from compile-to-js languages
they move createClass
into separate package AFAIK
@savelichalex For Reagent? (My opinion:) Yes and no, for default dependencies I want to support using Reagent without npm, but optionally it should be possible to use :npm-deps
@juhoteperi what you mean by default dependencies
?
@savelichalex When user just adds dependency on reagent and doesn't define any additional options, like npm-deps
@pesterhazy > This will enable future code size optimizations.
@juhoteperi interesting, maybe something to do with their use of rollup?
@juhoteperi as I understand this, reagent
can describe they own dependency on react
in :npm-deps
and then user just adds reagent as dependency, that's all. Npm install react as usual in js apps
we don't want to depend on npm by default, I don't think
As was mentioned on #cljs-dev, ES6 classes are compiled into just function + prototype declarations, and Cljs can emit those, so one option will be to replace createClass
by creating function + prototypes
@savelichalex There is probably some (or even lots of) Cljs devs without npm
but optionally, as juho says, you can exclude the dependency, in which case reagent will just use js/window.React
there should be a cljs library for working with ES2015 classes
And this is something I want to improve, if using npm-deps they don't export windows.React because the code goes through optimizations
But I think we can improve Reagent React var detection to support npm-deps better
this is looks like hack for me. Why I need make global variables? This is not user friendly in my opinion. I want :npm-deps
because use third-party react components with reagent
is pain right now
yeah Reagent's React var detection is a bit wonky
there should be a way to pass in React manually
I've thought about that. do you have an idea how to do that?
I guess it'd be possible to store the React value in atom or something, and provide side-effectful function to change value of that
I hope there is a better way
js/window.React
is a bit like an atom 🙂
Hmm, yeah
All the Cljs React wrappers have to same problems so luckily this needs to be solved only once and then everyone else can copy the solution 🙂
how you guys use third-party components right now? maybe you have best practices for this?
sure, react-select, reat-datepicker
all available on cljsjs
ok, got it) looks like cljsjs
best solution right now. But this is pain anyway 🙂
if it's on cljsjs it's pretty sweet
yeah, but if not...)
if it isn't (yet), it can be annoying if you need to add it yourself
on the plus side, everyone else benefits!
@savelichalex for smaller 3rd party stuff it's also often surprisingly simple to just take a look at the js source and port it to cljs
@edannenberg yeah, that's what I'm doing right now 😆