Fork me on GitHub
#hoplon
<
2016-04-14
>
jouerose00:04:00

<!-- and --> do not work for me at least with this: <!-- (p "this is a new world ") -->

jouerose00:04:47

the content is still present on the page

micha00:04:09

@jouerose: (p "the ship ... looks fine

jouerose00:04:52

@micha sorry i missed the "(" in the case of the multi line comments

micha00:04:42

there is also the clojure reader macro: #_(this sexp will be ignored by the reader)

alandipert00:04:13

@jouerose: another option, no longer ships with hoplon itself but available as separate boot task: https://github.com/tailrecursion/boot-heredoc

alandipert00:04:31

so you could do e.g.

(p
  ;;{{
  Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam eget
  eleifend metus. Curabitur vitae vestibulum ligula, vel pulvinar nisl. Sed
  cursus ipsum id enim rutrum iaculis. Mauris non ullamcorper sem. In porttitor
  mi ut massa molestie, eu pharetra turpis aliquet. Ut fermentum varius tortor,
  sit amet maximus mi. Praesent et orci orci. Nullam auctor nisi eget sagittis
  pharetra. Sed ullamcorper mauris sit amet metus pulvinar, et pretium elit
  tincidunt.
  ;;}}
)

leontalbot01:04:06

@l1sp3r: For scrolling events, I know there is also the cljsjs lib Waypoints https://clojars.org/cljsjs/waypoints #justincase

leontalbot01:04:45

You are probably all set with Hoplon though.

l1sp3r10:04:18

castra = very cool

l1sp3r10:04:29

wanted this for ages, glad i found it

micha12:04:08

@l1sp3r: castra docs are still pretty basic, lmk if you have issues

micha12:04:32

alpha14 is now available on clojars

alandipert13:04:34

@l1sp3r: also don't hesitate to contribute, can really use help with docs especially

alandipert13:04:02

you will be rewarded with an abundance of emoji

lspector13:04:02

Trying to get started with hoplon. Following https://github.com/hoplon/hoplon/wiki/Get-Started but "boot dev" fails with "clojure.lang.ExceptionInfo: java.lang.IllegalArgumentException: No such task (dev)". New install of boot. Ideas? #C08BDAPRA

alandipert13:04:00

@lspector: hey, welcome! 👋

alandipert13:04:12

@lspector: are you perhaps not inside the project directory that was created?

alandipert13:04:43

after doing boot -d seancorfield/boot-new new -t hoplon -n address-book you should cd address-book

lspector14:04:53

Beautiful yes, was following by rote, didn't cd, and didn't understand the error. Thanks @alandipert!

alandipert14:04:42

@lspector: my pleasure :thumbsup:

raywillig14:04:53

@alandipert: are you aware of any changes to AWS EB that would break the adapter servlet?

alandipert14:04:29

@raywillig: i am not, what are you seeing?

raywillig14:04:30

i first noticed this yesterday. I added one new defrpc to my api and did my usual boot build-tomcat beanstalk -de …. when my front end hit the api, i got back an error that unable to resolve symbol x. I did this a few more times and got similar errors but each time with a different symbol or unbound function or similar

raywillig14:04:17

things that I hadn’t touched in weeks. Led me to think that clj files weren’t being compiled. So i added aot -a to my build pipeline and yahtzee

raywillig14:04:57

i just retested again. built the war w/o aot and errors, build it with aot and working

raywillig14:04:05

i only mentioned that I added one new defrpc so you understand I didn’t make a major overhaul, etc. also tested the api ns in the repl w no problems and it works locally with boot-jetty with no issues

alandipert14:04:46

hm, sounds like maybe a corrupt zip file or something?

alandipert14:04:08

i vaguely remember running into obscure problems like that and just doing the deploy again fixing them

raywillig14:04:44

hmm, it’s very repeatable tho. i could build without aot 10 times in a row and have that problem. i’ll aot for now, but it makes me feel dirty and ashamed

alandipert14:04:58

i dunno if micha told you about it yet, but we have been moving away from eb to a think that micha came up with

alandipert14:04:10

basically a set of shell scripts that do everything eb does but way simpler

alandipert14:04:21

we can get you on the private beta

alandipert14:04:42

and by that i mean, we can send you these scripts and help you use them lol

raywillig14:04:02

oh that would be awesome

alandipert14:04:14

is this app a web or a worker?

raywillig14:04:24

does the beanstalk task just shell out to the eb cli?

raywillig14:04:44

the one in question is a web

alandipert14:04:47

uses eb java APIs

alandipert14:04:54

many levels of disgust

raywillig14:04:47

is it possible those got updated and it’s a breaking change?

alandipert14:04:40

i would be a little surprised if it broke and you didn't press the "upgrade container" button

raywillig14:04:13

yeah, that was actually the first thing i did when the issue manifested

raywillig18:04:41

does anyone here use mixpanel for analytics?

roti19:04:37

does hoplon provide something to get data out of form fields? cells are a one-way binding mechanism between fields and values. is there a mechanism for the other way?

roti19:04:35

I know I can do get element by id, but I'm wondering whether there's a goody in hoplon for that simple_smile

jumblerg19:04:23

@roti: i’m accomplishing this by having each field update an atom bound to a dynamic var, then retrieving the contents of that atom to create the full transaction from the form when an appropriate event is fired, like this: https://github.com/hoplon/ui/blob/master/src/hoplon/ui.clj, https://github.com/hoplon/ui/blob/master/src/hoplon/ui.cljs.hl#L472-L480

jumblerg19:04:56

i know micha has an even more elaborate technique, but i don’t think it is part of hoplon… yet.

roti19:04:16

true, that's better than getting the element by id

roti19:04:46

any idea if I can use the this js keyword in the change handler? this way there is no need to covert the element into a jquery object every time

roti19:04:14

apparently it's enough to call this.val()

roti19:04:17

or I could just get the value directly from the dom element simple_smile (.-value (.-target %))

jumblerg19:04:40

i think you can also get it by derefing the event

alandipert20:04:44

(input :type "text" :keyup #(reset some-cell @%))

leontalbot20:04:44

@roti for textarea and input I use : :keyup #(reset! cell (-> % .-target js/jQuery .val)

leontalbot20:04:42

@alandipert right, except this does not work with IE (any version)

alandipert20:04:59

whoa, i did not know

leontalbot20:04:37

for :type "radio" I use

:click #(reset! cell @item)

leontalbot20:04:59

@alandipert: yeah, at least this is what i have experienced

jumblerg20:04:12

@leontalbot: i’m curious why that is, the implementation of IDeref is the same code.

jumblerg20:04:28

(-deref [this] (-> this .-target js/jQuery .val))

leontalbot20:04:32

for :type "checkbox" it is a bit more tricky simple_smile

:click #(let [c @cell, i @item]
                               (if (some #{i} c)
                                 (reset! cell (vec (remove #{i} c)))
                                 (reset! cell (vec (conj c i)))))

leontalbot20:04:11

@jumblerg: if this code is older than 01/2016, then I has not been working. If more recent maybe micha has made an update...

leontalbot20:04:23

let me see...

leontalbot20:04:10

and to clojar too?

leontalbot20:04:19

here is the discussion

jumblerg20:04:50

did you try (deref %)?

leontalbot20:04:15

no I didn't...

jumblerg20:04:01

i’m just a concerned citizen that hasn’t bothered to do any of my x-browser testing on my current project. will find out what the deal is when i do. simple_smile

leontalbot20:04:12

I use browser stack. I have a subscription. I f you need help, you can tell me...

jumblerg20:04:42

many thanks, will keep in mind.

leontalbot20:04:41

btw, for working with your lib, can I directly use alpha14 from clojar?

jumblerg20:04:51

no, i haven’t convinced @micha to take my last couple prs yet. and the one that introduces support for responsive attributes isn’t ready for prime time because it doesn’t collect its own handlers.

jumblerg20:04:38

if you checkout this branch, boot build-jar, then boot build in the ui repo, you’ll be good to go. https://github.com/hoplon/hoplon/tree/responsive-layout-attributes

leontalbot21:04:20

Yes, regarding this, where do I put the hoplon and ui jars back in my project?

leontalbot21:04:06

It would be the first time I use other jars then clojar jars

jumblerg21:04:28

they all end up in the same place, your ~/.m2 directory

leontalbot21:04:48

so if I want to push this to heroku, what do I do?

jumblerg21:04:40

ah, you’re running a build script on heroku that pulls the jars at deployment time…

leontalbot21:04:03

oh no, I get this.

jumblerg21:04:06

i need to config my keys on this laptop, but i’ll try to put a jar out there in the next couple days.

leontalbot21:04:09

But I undertand, when i do boot make-war, then this war files includes ~/.m2 dependencies...

leontalbot21:04:29

So I guess i'll be all set...

jumblerg21:04:24

give it a whirl, the layouts seem to be working well now in most cases, there are still a few i haven’t covered.

leontalbot21:04:40

I use your master?

leontalbot21:04:09

I think i'll try hoplon/ui tonight simple_smile

jumblerg21:04:10

you can do boot run first and play with the demos in what was originally intended to be the test directory