Fork me on GitHub
#hoplon
<
2015-10-25
>
thedavidmeister04:10:27

hey, can we get a gitignore on .nrepl-history?

thedavidmeister04:10:34

not sure what repo that should go against

micha04:10:50

how do you mean?

thedavidmeister04:10:21

a file called .nrepl-history is showing up in git as unstaged

thedavidmeister04:10:26

looks like something that should be ignored

micha04:10:46

you can make a .gitignore file in your project directory

thedavidmeister04:10:17

i’m suggesting that one is shipped with the project

micha04:10:25

which project?

thedavidmeister04:10:31

the one that gets auto generated

thedavidmeister04:10:44

in fact there is one

thedavidmeister04:10:04

`/.boot/ /.nrepl-port /.repl-history /.lein-* /target /classes /checkouts `

thedavidmeister04:10:12

/.boot/
/.nrepl-port
/.repl-history
/.lein-*
/target
/classes
/checkouts

thedavidmeister04:10:25

and it doesn’t contain .nrepl-history

micha04:10:04

it's the lein-hoplon repo i think

thedavidmeister05:10:54

ok, so, say i write a little re-usable component element thing with hoplon in a hl file

thedavidmeister05:10:10

what might be a good way to test it?

micha05:10:43

there is a library, cljs.test that you can use

micha05:10:54

it's part of the cljs core distribution

micha05:10:01

you don't need any extra dependencies for it

thedavidmeister05:10:47

ah cool, i’ll have a look

thedavidmeister06:10:47

@micha: hey, i’m noobing out with your heroku deployment example

micha06:10:33

i haven't looked at that in a while

thedavidmeister06:10:38

is there a different heroku example?

thedavidmeister06:10:59

i’m just wondering what :main-class is supposed to be

micha06:10:31

i don't really remember what i did with heroku, it was pretty long time ago

micha06:10:03

i think there is a boot build pack for heroku now

thedavidmeister06:10:15

let me google what that means 😛

thedavidmeister06:10:06

so, originally i ran

thedavidmeister06:10:07

lein new hoplon-castra my-project-name

thedavidmeister06:10:17

but i did not get a project.clj file

micha06:10:01

that sounds correct

micha06:10:08

you should have a build.boot file though

thedavidmeister06:10:40

but heroku rejects my pushes because of the missing project.clj file

micha06:10:45

that's what the buildpacks are for

micha06:10:53

the boot one uses boot instead of leiningen

micha06:10:02

so it doesn't complain if you don't have a project.clj

micha06:10:19

but maybe you can make a bogus one just to shut heroku up and let you compute

micha06:10:37

i think it's just trying to be helpful

micha06:10:42

and it doesn't really need it

thedavidmeister06:10:41

is this what you’re talking about?

micha06:10:23

yes, i think so

thedavidmeister06:10:48

taking a step back

thedavidmeister06:10:00

i don’t get any .jar

thedavidmeister06:10:28

hmm, getting further along

thedavidmeister06:10:32

the buildpack did something...

thedavidmeister06:10:19

desc="No web processes running

thedavidmeister06:10:22

means for heroku?

thedavidmeister06:10:04

nm, think i found it

thedavidmeister07:10:58

Error: Could not find or load main class clojure.main

thedavidmeister08:10:25

i sort of got it working with

thedavidmeister08:10:43

(serve …) (hoplon) (reload) (cljs) (wait)

thedavidmeister08:10:21

but (cljs :optimizations :advanced) seemed to freak out the free dyno on heroku because of memory

thedavidmeister08:10:33

trying to get it working with a war file

thedavidmeister08:10:05

anyone know what Set the 'serve' callback function to SYM. means for boot web?

thedavidmeister09:10:17

actually show how to get something deployed somewhere

thedavidmeister09:10:45

"A deftask form that creates a prod task. We would use this to compile the project for deployment."

thedavidmeister09:10:05

that has not really helped me so far

thedavidmeister09:10:36

it would be great to show a basic deployment to a free service like heroku for the demo app

thedavidmeister12:10:45

can anyone tell me what i’m supposed to set serve as in boot web in the hoplon/castra template to get a war file working?

thedavidmeister13:10:38

ok, a different question...

thedavidmeister13:10:19

(serve …)
(hoplon)
(cljs)
(wait)

thedavidmeister13:10:47

(hoplon)
(cljs)

thedavidmeister13:10:54

in one boot task

thedavidmeister13:10:05

(serve …)
(wait)

thedavidmeister13:10:11

in a different one just afterwards

thedavidmeister13:10:27

i get a response from the server, but it’s a WSOD

thedavidmeister13:10:44

what’s going on there?

martinklepsch13:10:45

@thedavidmeister: are you serving from filesystem or classpath?

thedavidmeister14:10:23

(serve :dir "./target" :port 3000 :handler 'my-app.handler/app)

thedavidmeister14:10:25

is what i’m trying

thedavidmeister14:10:51

so i guess the filesystem?

thedavidmeister14:10:54

not sure how to tell

martinklepsch14:10:10

@thedavidmeister: it’s generally easier in my experience to just serve from classpath, I think that would be just (serve :port ….)

thedavidmeister14:10:26

so drop the :dir?

thedavidmeister14:10:51

@martinklepsch: the problem is i get this

thedavidmeister14:10:57

Oct 25 07:07:37 estimate-work app/web.1:  Compiling ClojureScript... 
Oct 25 07:07:37 estimate-work app/web.1:  Adding :require adzerk.boot-reload to index.html.cljs.edn... 
Oct 25 07:07:37 estimate-work app/web.1:  • index.html.js 
Oct 25 07:07:40 estimate-work heroku/web.1:  Process running mem=512M(100.1%) 
Oct 25 07:07:40 estimate-work heroku/web.1:  Error R14 (Memory quota exceeded) 

thedavidmeister14:10:40

I assume it’s the compiling using all that memory

thedavidmeister14:10:58

and that a minimum hoplon/castra setup does not consume over 500mb

thedavidmeister14:10:18

so I’m trying to get all the compiling done either when I push to heroku or on my local

thedavidmeister14:10:23

and then just serve from heroku

martinklepsch14:10:52

Are you setting appropriate JVM options so that used memory does not surpass heroku’s limits?

thedavidmeister14:10:31

i just did this:

thedavidmeister14:10:34

web: boot heroku-serve -p $PORT

thedavidmeister14:10:58

(deftask heroku-serve
  [p port PORT int "The port to serve on"]
  (comp
    (serve :port port :handler 'my-app.handler/app)
    (hoplon)
    (reload)
    (cljs :optimizations :whitespace)
    (wait)
  )
)

thedavidmeister14:10:17

in the procfile and build.boot respectively

thedavidmeister14:10:46

how would I set JVM options?

martinklepsch14:10:06

via environment variables

martinklepsch14:10:20

check the boot wiki for details

thedavidmeister14:10:33

heroku sends jvm options doesn’t it?

thedavidmeister14:10:58

@martinklepsch: regardless, i only get the errors when i try to serve, not during the build

thedavidmeister14:10:16

@martinklepsch: is there a reason why i need to compile after serving to see my work?

thedavidmeister14:10:44

@martinklepsch: if i already generated a target folder, why can’t I just run (serve) (wait)?

martinklepsch14:10:19

if you serve from the filesystem you can do that

thedavidmeister14:10:14

right, and that’s what dir does?

martinklepsch14:10:24

@thedavidmeister: all tasks have built in documentation you can view with boot task -h, e.g. boot serve -h

thedavidmeister14:10:00

yeah, i’ve read it all like 10x

thedavidmeister14:10:09

it’s a bit cryptic and terse for me

martinklepsch14:10:38

oh ok. so :dir is how you can specify a directory to serve from like target/

thedavidmeister14:10:50

let me try one more time, now that you’ve said it simple_smile

thedavidmeister14:10:42

(deftask make-thing
  []
  (comp
    (hoplon)
    (cljs)
  )
)

(deftask serve-thing
  []
  (comp
    (serve :dir "target/" :port 3000 :handler 'my-app.handler/app)
    (wait)
  )
)

thedavidmeister14:10:03

$ boot make-thing; boot serve-thing

thedavidmeister14:10:23

2015-10-26 01:30:24.064:INFO:oejs.Server:jetty-7.6.13.v20130916
2015-10-26 01:30:24.120:INFO:oejs.AbstractConnector:Started [email protected]:3000
<< started Jetty on http://localhost:3000 >>

thedavidmeister14:10:36

but when i go there in chrome, i just get a WSOD

martinklepsch14:10:54

oh… I see now. you can’t use :handler and :dir at the same time

martinklepsch14:10:29

if you specify a handler that handler has to take care of serving static resources.

thedavidmeister14:10:53

so this looks better

thedavidmeister14:10:13

my random number updating does not work

thedavidmeister14:10:24

so something in castra is nqr

thedavidmeister14:10:37

@martinklepsch: is :handler able to do things that :dir cannot?

thedavidmeister14:10:15

oh yay, :dir is working on heroku too

thedavidmeister14:10:30

but no castra love on heroku or local 😞

thedavidmeister14:10:26

@martinklepsch: well, thanks for helping. I have to get some sleep, it’s 2am here

martinklepsch14:10:08

@thedavidmeister: castra works via ring handlers so you’ll need to use :handlers and not :dir if you want to use castra

thedavidmeister14:10:47

@martinklepsch: so basically i just have to figure out the memory thing

thedavidmeister14:10:15

@martinklepsch: if i figure out how to make a war file, will that allow castra to work without me needing to compile things on a dyno?

martinklepsch14:10:53

I’m sorry I got no clue about that

thedavidmeister14:10:07

well, thanks again for helping

thedavidmeister14:10:17

i guess i’ll try again tomorrow simple_smile

alandipert15:10:21

@thedavidmeister: good point about deploying... maybe deploying a war to heroku is better, and then doing the cljs compile locally

levitanong19:10:04

Hey guys. What’s the intent of the HLisp section of the documentation? Is the intention to list all the supported HTML tags? Is it intended to teach users the general pattern of HLisp usage as in (tag :attr attr-value :attr2 attr-value2 children) ? Perhaps I could help flesh this out.

onetom19:10:22

levitanong: maybe the html2cljs task from boot-hoplon belongs to that topic too, since that's the one which can convert html 2 hlisp

onetom19:10:10

but i think you should write whatever you feel appropriate and afterwards we can move it around

levitanong20:10:16

@onetom: Okay, I’ll give it a shot.

levitanong20:10:22

Thanks for the advice!