This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2015-10-26
Channels
- # admin-announcements (1)
- # beginners (167)
- # boot (117)
- # boulder-clojurians (1)
- # cbus (1)
- # clara (3)
- # clojure (87)
- # clojure-conj (2)
- # clojure-japan (2)
- # clojure-russia (23)
- # clojure-spain (3)
- # clojure-za (2)
- # clojurescript (184)
- # community-development (8)
- # core-async (7)
- # core-matrix (4)
- # cursive (36)
- # data-science (74)
- # datascript (3)
- # datomic (171)
- # events (6)
- # hoplon (83)
- # ldnclj (5)
- # ldnproclodo (1)
- # lein-figwheel (2)
- # leiningen (19)
- # liberator (2)
- # off-topic (5)
- # om (227)
- # onyx (5)
- # re-frame (142)
- # reagent (4)
- # yada (5)
@alandipert: I have no idea how to make a war work. I get servlet errors every time. I'm coming from a PHP background, not Java, so while the programming concepts in clojure are not too hard to pick up, the specifics on deploying and the JVM are taking me aaages to nut out
actually, i don't even really know the differences/pros/cons between ring handlers, serving a directory, pom, war, jar, etc...
i'm trying to reverse engineer all that >.<
also, philosophically, I'd imagine hoplon would want to be free-tier compatible for heroku
in order to encourage uptake and generally keep the barrier to entry low
from what i saw, you can't get a dyno with more than 512mb RAM on heroku for under $50USD per month
which, when the AUS$ is like 0.75c, is pretty hard on the pocket for something i'm just trialling
especially when the pure client-side stuff compiles so nicely
@thedavidmeister: i'll try and get a minimal war example working today
amazing!
thanks
hoplon actually was born of PHP
the first hoplon backend was php, that is
well i’m happy learning
also, i just installed cursive because it was recommended in a different chat room
i thiiiink that .hl files aren’t detected
does that sound right?
also, @alandipert i think the stuff i want to do on the server will work better in threads, so kind of glad it’s no longer PHP
does hoplon work with the cursive IDE?
cursive is a fine editor of .hl files, supports only Leiningen projects atm (hoplon is boot-only)
however you can get a degree of IDE-ness with https://github.com/boot-clj/boot/wiki/For-Cursive-Users
i don't know much else, as i haven't tried it myself
btw re: heroku and ram... it's kind of an antipattern to compile cljs on the server, which the existing heroku tools apparently encourage you to do
for our production stuff we compile cljs during a build and then deploy the static JS to CDN
that's why the .war deployment option on heroku is appealing... it's a way to upload what amounts to a zip file of pre-compiled cljs to them to serve out, while still having the ability to run a clj backend on them
@alandipert: yeah, i got that far, at least, figuring out what a war is
and that it probably does what i think needs to happen
but not far enough for it to actually work 😞
@alandipert: i just went back to sublime, all good
@thedavidmeister: good news! making a war is really easy. first, make a new hoplon app with a backend: lein new hoplon-castra my-app
. Then cd my-app
. Then boot make-war
, which makes target/project.war
then you can deploy the project.war file as per https://devcenter.heroku.com/articles/war-deployment
@alandipert: awesome news!
i might use it for experimentation and teaching.
(the css took awhile (~0.6s) to arrive FOUC again)
oh yeah, i don't prerender
don't want to demand phantomjs
im just looking at the contents of the .war (because it's 21MB)
and i see WEB-INF/lib/boot-cljs-1.7.48-6.jar
which seems unnecessary.
is it a matter of specifying :scope "test"
to exclude it from the war?
micha: that would be great because on el capitan i was just fighting w phantomjs the other day. it's segfaulting because they are using the upx
exe packer on the default distribution file...
@micha fyi I made a trivial little macro to be able to define elements in html/hlisp:
(defmacro html-elem
[{:keys [name]} kids]
(let [n (symbol name)]
`(defelem ~n [_ _] ~kids)))
it looks like there are already some ways in hlisp to incorporate bound variables into content generation - e.g. attrs with values surrounded in {{…}} get evaluated
i don’t know if there is a similar mechanism to eval text node content? or if there is an <eval>...</eval> element?
yes, but how to do something like:
<html-elem name="my-head">
<head>
<title>Main Title{{(when subtitle (str “ - “ subtitle))}}</title>
<link href="/css/styles.css" rel="stylesheet" type="text/css">
</head>
</html-elem>
i don’t think you can do inline eval like in the title above.. maybe something like this would be possible tho:
<title>Main Title<eval expr=“{{(when subtitle (str “ - “ subtitle))}}”/></title>
just some thoughts. this is kind of a lark because i’m really fine w/just doing everything in clojurescript, but it’d be nice to have some of these facilities on the hlisp side too.
Probably u have to do
<title>Main Title{{opt-subtitle}}</title>
and calculate the opt-subtitle
outside, where u define subtitle
itselfso the ways to access programmatic/cell state in hlisp is either attr=“{{xyz}}”
or <text>something ~(xyz)</text>
?
not a bad idea. btw is there a reason that the string interpolation syntax is different for attrs vs. text nodes?
@esp1: I’m guessing text nodes have a lot of other strings you want to include like “Hello, my name is…”, whereas in attrs, it’s usually just the cell you want to refer to.