Fork me on GitHub
#reagent
<
2016-09-15
>
mikethompson04:09:09

ANN: thanks to @blak3mill3r re-com now has a nice typeahead component. A demo is available: http://re-demo.s3-website-ap-southeast-2.amazonaws.com/#/typeahead

mikethompson04:09:54

ANN: Reagent 0.6.0 is released (includes React 15.2.1)

artur04:09:06

@reefersleep managed to get it working, thanks for your help yesterday!

artur04:09:55

@gamecubate decided to change it so that I serve a static html and app.js along with it. Had some issues with my VPS and my JAR instance crashed after few hours.

artur04:09:27

Besides, deploying the app is just one scp as I don't need to restart anything.

artur05:09:37

Anyone tried https://github.com/RyanMcG/lein-npm for importing 3rd party React components?

pesterhazy10:09:37

have you tried cljsjs @artur ?

artur10:09:05

Yes, but it doesn't have as wide offering as npm for react components

artur10:09:28

I'm trying to find react-timeago for reagent

pesterhazy10:09:54

cool, just wanted to check

pesterhazy10:09:38

looks like it doesn't have any dependencies

pesterhazy10:09:12

maybe you can just download it and include it as a standalone js?

pesterhazy10:09:19

@artur you could also look into how other react deps are packaged on cljsjs

pesterhazy10:09:40

probably doable to include it like this

artur10:09:22

Nice, thanks!

pesterhazy10:09:42

this example just shells out to npm and webpack in build.boot

artur10:09:35

Will have a look into it

pesterhazy10:09:35

but agree that a pure clojurescript solution is peferable

martinklepsch10:09:47

that would also help, no?

pesterhazy10:09:57

would be cool to build a npm2cljsjs tool

juhoteperi10:09:58

@martinklepsch That one might return e.g "2 hours 15 minutes ago" instead of just "2 hours ago" and it is not configurable

reefersleep10:09:59

We're having some trouble with our reagent application. I'm not sure it has anything specific to do with reagent, though. There are a couple of on-click events in the UI that take a very long time to complete. When I view the Network tab in developer tools in Chrome, one of the resulting requests appear to be "Pending" for many seconds, locking up the UI. But, when it finally finishes, the logged time is in miliseconds! Have anyone encountered anything similar?

pesterhazy10:09:12

that basically imports an npm dep into cljsjs

juhoteperi10:09:13

@pesterhazy No need, this all will be fixed in future by ClojureScript compiler

juhoteperi10:09:35

Module processing will allow ClojureScript to consume npm etc. modules directly

pesterhazy10:09:37

ES6 modules for Google Closure?

pesterhazy10:09:48

sounds awesome

juhoteperi10:09:03

Should be no need for externs with module processing

juhoteperi10:09:20

And extern inference will drop need for externs with regular foreign deps

pesterhazy10:09:47

leftPad comes to clojurescript!

juhoteperi10:09:18

Yeah well, my suggestion would be to use JS libs only for stuff size of Leaflet etc. and write everything else on Cljs

juhoteperi10:09:23

But maybe I will change my mind when module processing etc. is implemented

pesterhazy10:09:57

we're using npm modules heavily with react-native

juhoteperi10:09:00

We can probably completely automate packaging certain libs from npm to clojars for easy consumption

pesterhazy10:09:10

integrating that with Google Closure would be fantastic

juhoteperi10:09:24

Unfortunately React-native has it's own packager and for now it is probably not possible to use Closure there

pesterhazy10:09:03

but maybe that can be changed

juhoteperi10:09:30

Would probably need changes on React-native side

pesterhazy10:09:29

yeah as there are native modules as well

artur12:09:54

@juhoteperi: thanks for the code but isn't that like re-inventing the wheel kind of?

juhoteperi12:09:51

@artur I don't see that as a problem when the solution is only ~30 lines, is unlikely to change (can be added to lib shared between projects) and alternative would be to use JS lib which requires complex build steps (in cljsjs or project) and which loses any benefits of Closure optimization

artur12:09:30

Point taken 😉

juhoteperi12:09:39

My code uses static interval to update the value, but even making the interval dynamic based on the current duration would only add a few lines

juhoteperi21:09:36

I finalized the timeago component to my native Reagent components lib: http://metosin.github.io/komponentit/#!/example.timeago