Fork me on GitHub
#re-frame
<
2017-07-04
>
leontalbot02:07:17

Any rating lib you use that does like react-rating ? https://github.com/dreyescat/react-rating

leontalbot02:07:22

I couldn’t find anything that works with re-frame or reagent…

mikethompson02:07:41

@leontalbot remember that you can use React components in a Reagent app

leontalbot03:07:14

It does require using at least cljsjs right?

leontalbot03:07:48

I couldn’t figure out how to create externs for react-rating

mattgeb04:07:52

I have a stupid question. I got a little re-frame app working on my local machine (pretty pleased with it! 🙂 ). It's modified using the Simple template as a base (as in, everything is just in Core.cljs and I didn't write anything involving servers). What would be the most straightforward way to be able to just upload this to Heroku?

mikethompson04:07:54

@mattgeb this is probably more compilated than you want but ... perhaps draw inspiration from Luminus http://www.luminusweb.net/docs/deployment.md#heroku_deployment Or perhaps cheat a bit: 1. use Luminus to create the project for you lein new luminus myappname +re-frame you might need other + options on the end, not sure 2. and then copy in the code for your re-frame app 3. Use the deployment options provided by Luminus Yeah, probably too complicated.

mattgeb04:07:08

Ha, I actually just did exactly that. I feel like I'm not quite getting the Routing, though - I ran the little template app Luminus made (it seems like it does stuff, so I figured "mess with it until it does other stuff" would be a better route than "blindly overwrite it"), buuut can't quite navigate to a page that has anything but Figwheel complaining at me.

mattgeb04:07:06

huzzah, re-frame-template got my where I wanted a bit faster

mattgeb05:07:46

Now let's see about translating it!

mattgeb05:07:07

Basically works! 🙂

mattgeb05:07:10

Now for heroku...

mattgeb05:07:32

And then next step, I suppose I'll actually break up my messy core.cljs into a properly structured re-frame project! 😛

mattgeb05:07:49

Hrm, it's complaining about a lack of "main". Let's see if a tweak he;ps..

mattgeb06:07:05

It's not recognizing my clojurescript file as "Main"

mattgeb06:07:08

Can't find 'src/cljs/life-told-heroku2.core.cljs' as .class or .clj for lein run: please check the spelling.
Exception in thread "main" java.io.FileNotFoundException: Could not locate src__init.class or src.clj on classpath., compiling

danielcompton06:07:13

that's looking for a Clojure file

danielcompton06:07:35

lein run will run a clojure -main function in a namespace

mattgeb06:07:49

Just wound up getting it to work with Compojure

mattgeb06:07:05

So, for anyone else messing with anything similar, fastest way to make a re-frame app that's deployable with minimal nonsense in the fastest "0-to-hello-world" time, use the template

lein new re-frame <project-name> +handler
🙂

akiroz10:07:15

@leontalbot You can try out one of the latest features of cljs -- put :npm-deps {:react-rating "0.8.0"} in your compile options then (:require [react-rating]) in your code.

akiroz10:07:34

This is still alpha quality and doesn't always work tho (any JS libs that require('xxxx.json') won't work)

akiroz10:07:15

Otherwise you'll have to port it to cljsjs, which is a bit of a pain TBH since js libs are kinda dynamic and automatic extern generators always fail...

pesterhazy10:07:10

it's pretty straightforward and works with all 3rd party react components

leontalbot15:07:27

@akiroz @pesterhazy what are the differences between :npm-deps and double-bundle approaches?

pesterhazy15:07:50

npm-deps is newer and officially sanctioned

pesterhazy15:07:10

double-bundle uses webpack so requires two build tools - meaning it's not particularly elegant

pesterhazy15:07:17

but it works great 🙂

leontalbot15:07:27

If my server runs under JVM (and not node) both are ok?

leontalbot15:07:04

Is there one where code get in closure compiler and therefore can offer better perf?

pesterhazy15:07:52

the closure compiler doesn't touch foreign libs as far as I know