This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-11-15
Channels
- # beginners (138)
- # bigdata (2)
- # boot (45)
- # cljsrn (29)
- # clojure (108)
- # clojure-austin (1)
- # clojure-gamedev (1)
- # clojure-korea (9)
- # clojure-russia (50)
- # clojure-spec (2)
- # clojure-uk (28)
- # clojurescript (40)
- # component (1)
- # cursive (35)
- # datomic (39)
- # dirac (16)
- # emacs (22)
- # flambo (11)
- # funcool (6)
- # hoplon (74)
- # leiningen (4)
- # off-topic (1)
- # om-next (2)
- # onyx (141)
- # planck (7)
- # proton (10)
- # protorepl (4)
- # re-frame (21)
- # reagent (13)
- # remote-jobs (1)
- # ring (3)
- # specter (9)
- # sql (3)
- # test-check (14)
- # untangled (1)
- # vim (9)
- # yada (16)
@thedavidmeister seems like a small improvement using codox. Now we know that the public api is missing docstrings all over the place 😉
@mynomoto the biggest problems I always have when I'm starting a new language is figuring out how all the various include paths work and fit together.
So, for example, one difficulty I had was figuring out exactly where compojure/ring looked for the pages specified in the routing and how to setup the .hl file correctly so it could be found. I think I've figured that out well enough for now, but I'm still not exactly sure how to make use of the data parsed out of the path by compojure in a page template.
(to be clear, this scenario involves the castra template mentioned in hoplon's Getting Started wiki page)
@fiddlerwoaroof yeah, serving from the classpath is not very intuitive. I will make a note to explain that on the tutorial, it's relevant even for client side only, thanks. About compojure params, what are you trying to do? I'm asking because castra doesn't use them.
@mynomoto basically, I wanted to write a little demo application with two different views: a list of links and a list of comments on the links. So, I started with this: https://github.com/tailrecursion/hoplon-castra-template/blob/master/src/leiningen/new/hoplon_castra/handler.clj and I modified it to look like this:
(defroutes app-routes
(GET "/" req
(-> "index.html"
(resource-response)
(content-type "text/html")))
(resources "/" {:root ""})
(GET "/comments/:idx" [idx]
(println "Idx: " idx)
(-> "comments.html"
(resource-response)
(content-type "text/html")))
(not-found (or (io/resource "public/404.html")
"Oups! This page doesn't exist! (404 error)")))
The difficulty I'm having is figuring a good way to use the idx
parameter.Although, I'm beginning to suspect that this isn't really an intended way to use the framework.
@fiddlerwoaroof I see the problem. So if you are using resource-response
this only serves the file. If you want to generate html server-side there are a bunch of options in the "Template languages" section from http://www.clojure-toolbox.com/
A word of caution, that is not curated, once things get in there they tend to live forever even if the project is not maintained anymore. I think Hiccup and Selmer are the most used of the list but I haven't being doing server-side rendering in a while. I also know that Rum can be used that way too I played with it a bit some time ago.
In the Hoplon/Castra way if you want more than one view you probably want to do client side routing. I don't think we have examples of that on demos, I will add an issue so this is not forgotten and hopefully I can provide one soon.
@mynomoto i just saw it last friday that FUOC was still an issue at exicon. prerendering is not an option because you can't prerender the logged in state.
@onetom If prerender is not an option what I usually do is manual loading and putting the css on the base html file. I still have to try ui.
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="app.css" rel="stylesheet" type="text/css">
</head>
<body>
<div id="app"></div>
<script src="main.js" type="text/javascript"></script>
</body>
</html>
(defn mount-root []
(js/jQuery #(.replaceWith (js/jQuery "#app") (home))))
(mount-root)
@mynomoto: yay cleanup!
@flyboarder someone needs to do it 😉 One of the first things I did when I was trying to contribute was a cleanup of issues for lighttable. That was crazy, I help to close 200 issues or something like that 😅
@mynomoto no, im at https://github.com/addplus but exicon is 5 mins walk away and 2 of my ex-colleagues live on the same island as me so we ride the ferry often together either in the morning or the evening...
@onetom for http://app.adzerk.com we have a spinner that is shown while the app is loading, because you can't prerender logged in state and you don't want the user to see the actual app before their logged-in status is determined
you can see there is no FOUC for http://app.adzerk.com
@laura @peterromfeld @ayaz @kenneth in case you want to take another stab at the FUOC issue, just look above! ^^^^ 🙂
the ui.app
namespace generates the html that's prerendered: https://gist.github.com/e57a8b1bdabe78d748b6a9b0b486eeec
btw, im just trying the latest hoplon/ui demo.cljs with clojurescript 1.9.293 and i can just use ns
instead of ns+
and it still works (if i remove the reference to markdown
)
like tricking the user into clicking on a button in the iframe by putting something on top of it for example
if you load the app in an iframe you just see the spinner forever, the app doesn't ever load
@micha there is no changelog file for hoplon, so i thought i would at least try github's release notes feature: https://github.com/hoplon/hoplon/releases/tag/6.0.0-alpha17 i just copied your merge-commit message. .i hope u don't mind.
the best would be to follow http://keepachangelog.com/ but im too sleepy for that now
@jumblerg: found some blocking issues for boot-electron, so I haven't been able to upload it yet
Just an FYI
no worries. i like how it drops into the build pipeline like the pom task. nicely done.
@onetom: yeah... the browser really shouldn't be able to blow away someone's clipboard with copy!
, but there is is. i haven't looked into paste!
yet lol.
but i think i'm going to pioneer a new, innovative genre in the advertising space: clipboard ads. customers embed this little script in their site, and next time a visitor pastes into an office doc, bam!. "little blue pills. $2.50".
I am presenting for the ClojureToronto meetup soon, if anyone wants an invite to the hangout!