This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-07-04
Channels
- # beginners (8)
- # boot (20)
- # cider (8)
- # cljs-dev (263)
- # cljsjs (8)
- # cljsrn (20)
- # clojure (151)
- # clojure-argentina (1)
- # clojure-belgium (7)
- # clojure-dev (18)
- # clojure-italy (25)
- # clojure-spec (34)
- # clojure-uk (15)
- # clojurescript (89)
- # component (45)
- # core-async (27)
- # cursive (16)
- # datomic (53)
- # emacs (40)
- # figwheel (3)
- # hoplon (62)
- # jobs (1)
- # jobs-discuss (7)
- # luminus (8)
- # lumo (60)
- # off-topic (3)
- # parinfer (1)
- # precept (1)
- # protorepl (15)
- # re-frame (37)
- # reagent (7)
- # ring (3)
- # ring-swagger (73)
- # slack-help (1)
- # specter (19)
- # sql (4)
- # test-check (10)
- # uncomplicate (2)
- # unrepl (14)
- # untangled (52)
- # vim (5)
- # yada (42)
Any rating lib you use that does like react-rating ? https://github.com/dreyescat/react-rating
I couldn’t find anything that works with re-frame or reagent…
@leontalbot remember that you can use React components in a Reagent app
These may not be the best links ... but are indicative of what's possible https://www.reddit.com/r/Clojure/comments/4el0xi/how_to_use_an_existing_reactjs_component_with/ https://stackoverflow.com/questions/28759108/use-predefine-react-component-from-reagent
Thank you
It does require using at least cljsjs right?
I couldn’t figure out how to create externs for react-rating
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?
@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.
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.
About to use this instead: https://github.com/Day8/re-frame-template
And then next step, I suppose I'll actually break up my messy core.cljs into a properly structured re-frame project! 😛
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
that's looking for a Clojure file
lein run
will run a clojure -main
function in a namespace
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
🙂@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.
This is still alpha quality and doesn't always work tho (any JS libs that require('xxxx.json')
won't work)
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...
@leontalbot the other option is to use the "double bundle" approach: https://github.com/pesterhazy/presumably/blob/master/posts/double-bundle.md
it's pretty straightforward and works with all 3rd party react components
@akiroz @pesterhazy Thank you so much!
@akiroz @pesterhazy what are the differences between :npm-deps
and double-bundle
approaches?
npm-deps is newer and officially sanctioned
double-bundle uses webpack so requires two build tools - meaning it's not particularly elegant
but it works great 🙂
If my server runs under JVM (and not node) both are ok?
Is there one where code get in closure compiler and therefore can offer better perf?
@pesterhazy thanks BTW
the closure compiler doesn't touch foreign libs as far as I know