Fork me on GitHub
#clojurescript
<
2016-03-21
>
Alex Miller (Clojure team)14:03:13

it could also check sequential? instead of vector?

fasiha16:03:10

I've been majorly cargo-culting lein, but here's my attempt to clarify things. I've been happily developing with the lein-figwheel plugin, but I need backend stuff now. So, in order to add Sente/http-kit/ring, I've specified a :main in project.clj which starts the http-kit server. So right now I do lein run in one terminal to start the clojure-based server, and lein figwheel dev in another terminal for figwheel auto-compiling-reloading magic. And it works ☺️, but I wonder if there's a way to combine the two steps into one?

lopalghost16:03:01

You could write a function to start both the server and figwheel, then call it from the REPL.

lopalghost16:03:51

See the updated figwheel docs

dokeeffe16:03:00

Hi guys, I’m completely new to Clojurescript and I’m hitting a snag trying to use materializecss with it. Specifically, I want to use a select field and in the docs, I’m told I need to call this function:

dokeeffe16:03:58

I’ve tried adding this in my index.html at the bottom of the body, but the select field won’t render. Any pointers on what I’m doing wrong?

dokeeffe16:03:32

Woops, I should have said that I’m using Reagent (actually the re-frame template)

jr16:03:34

That jquery selector won’t work unless jquery is loaded on the page (it may be). Also the page is considered ready when the scripts are loaded and not necessarily when react has rendered the initial dom. The approach I usually take is to add a :component-did-mount hook to that select and call (.material_select this)

dokeeffe16:03:25

Perfect, thanks

noonian17:03:23

@fasiha: this is what I do and I call it with a lein alias of lein run -m clojure.main/main bin/figwheel.clj: https://www.refheap.com/116227 It was adapted from the figwheel nrepl docs.

noonian17:03:00

If I am actively working on the server I just start it from a repl and use the reloaded.repl workflow

fasiha18:03:19

Thanks @noonian and @lopalghost! I like the "one command start" but learning how to make REPLs will be useful, since lein run right now doesn't launch a REPL for me (just starts the server).

base69818:03:34

Anyone know how to add reagent to an existing figwheel project? it's low on my list of things to do

base69818:03:41

so if it's too hard I'll wait

bhauman18:03:36

@faisha if you add -r to the end of the command @noonian posted that will start a repl

bhauman18:03:01

@base698: the question is a bit vague eh?

bhauman18:03:59

Just published lein-figwheel 0.5.1-SNAPSHOT with the new configuration validation code in it. Lots of edge cases so I would really appreciate it if folks could give it a try.. If it runs fine you may want to fuzz your configuration and see if the errors you get make sense.

base69819:03:02

@bhauman I am just using standard html in the index and have my src file. it's got no reagant stuff anywhere in it. is it as a simple as saying: require the reagent lib, and refresh?

bhauman19:03:10

you will need to add reagent to your :dependencies in your project clj

base69819:03:20

and that step

bhauman19:03:25

yep you will then need ot require it and start using it per the instructions https://github.com/reagent-project/reagent

bhauman19:03:45

we also have a #C0620C0C8 channel

base69819:03:44

yeah it just worked, at least i required an ratom from the figwheel repl

base69819:03:52

thanks. wasn't as scary as I figured

bhauman19:03:42

there is also a #C073DKH9P channel thats pretty active

bhauman19:03:59

they are all using reagent

mmeix19:03:18

because re-frame builds on reagent

bhauman19:03:57

@chrisoakman: hey do you have a cljs favicon?

chrisoakman19:03:46

not in my back pocket... but I suspect one could be made from the .svg pretty easily

bhauman19:03:28

do you have a url for the svg on hand?

amacdougall19:03:16

Oh hey, @junegunn — I didn't know you used Clojure! I use fzf all the time, great tool.

bones22:03:56

When specifying dependencies how does, say “org.omcljs/om” refer to the actual github account?

danielcompton22:03:03

@bones they are completely unrelated. org.omcljs/om is the . This can be completely different from the namespaces you require: om.core, and different again from the Github account: omcljs/om

bones22:03:02

Got it, cheers : )

martinklepsch23:03:12

In single page apps how do you deal with "not-found" situations? Do you have some hack to get a 404 or do you just not care?

bostonaholic23:03:05

@martinklepsch: that's going to be very dependent on your specific app

bostonaholic23:03:55

the behavior can be different for a user navigating to a "not found" page vs. someone clicking a link (e.g. from Twitter) to find themselves on a "not found" page

martinklepsch23:03:52

@bostonaholic: sure, interested in all of these cases really. Also less interested in solutions than just in other peoples thoughts/experiences w/ this. Seems like a generally not-so-straightforward thing with SPAs

bostonaholic23:03:58

rarely is anything straightforward when building SPAs IMO