This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2015-09-22
Channels
- # admin-announcements (5)
- # aws (32)
- # beginners (2)
- # boot (51)
- # cider (33)
- # cljs-dev (4)
- # clojure (83)
- # clojure-berlin (11)
- # clojure-czech (23)
- # clojure-poland (3)
- # clojure-russia (51)
- # clojure-seattle (4)
- # clojure-sg (1)
- # clojure-uk (4)
- # clojurescript (48)
- # clojurex (1)
- # datomic (26)
- # devcards (10)
- # devops (12)
- # editors (9)
- # emacs (12)
- # events (1)
- # funcool (14)
- # hoplon (117)
- # immutant (1)
- # jobs (2)
- # ldnclj (32)
- # ldnproclodo (12)
- # om (51)
- # onyx (17)
- # reagent (11)
- # yada (4)
@mynomoto: many thanks for your work updating those!
Re: Docs - any change this mind be useful : https://github.com/weavejester/codox ?
@donmullen: Looks nice! Was that on your radar last time you were looking @micha?
When I include a google analytics snippet in a hoplon page (e.g. (script "(function(i,s,o,g,r,a,m){...
) I get Uncaught NotFound error: Failed to execute 'removeChild' on 'Node': The node to be removed is not a child of this node.
. Google is no help. Can anyone point the way?
I take it you can't expect to be able to add script-elements-that-insert-script-elements this way
Looking at the pre-rendered page, that script element doesn't get pre-rendered, which I'd want it to
I grepped the hoplon demos repo for analytics and didn't find any examples, maybe i'll add one once I figure this out -- Google Analytics is a pretty common thing to want
@alandipert: Just documented that wisdom you dropped on me yesterday at https://github.com/hoplon/hoplon/wiki/API-Documentation -- hope that's helpful
@jab: quick fix is (js/jQuery (fn [] (js* "... google analytics javascript ...")))
i've also added this externs file https://github.com/exicon/homepage/blob/master/src/google-analytics.ext.js which is referenced from the deps.cljs
(which should really be called deps.cljs.edn
i guess) but i can't remember if that was necessary for this script tag solution or not
we tried c3 since it was cljsjs packaged already but when we call js/c3.generate
it inserts a new chart every time into the specified div
@alandipert, @micha, @onetom Thanks and sorry I only just saw your replies! But not before I submitted https://github.com/cljsjs/packages/pull/239 -- not sure if that's useful? (See my questions there if you get a chance.) The link to the exicon site source looks like it'll be a great reference, thanks. But taking a quick look, it still isn't clear to me it's doing what I'm curious about, i.e. hooking into hoplon's html generation process and providing a literal chunk of markup to include in certain places, that effectively remains outside the hoplon app's awareness. Google Analytics seems like a good example where you'd want this, since the goal is to fetch analytics.js and record the pageview as early as possible (in case the user closes the tab before domready) without blocking rendering of the page, hence the advice to make it the last element in <head>
(...and also unless your app's actually doing anything with the ga api beyond the typical record-a-pageview, you probably don't want to bog down your hoplon app code with this and just want hoplon to dump this chunk of markup in the right place and otherwise pretend it doesn't exist)
@onetom: Is that cljsjs package useful? Would you switch to using that once it's merged?
well, in theory it shouldn't be a win to take on the responsibility of serving this library since it's most likely to be cached already in the users' browser
@onetom: makes sense. so looking at the exicon site source, when you add integrations/google-analytics
at the end of your (body...)
element in homepage/layout.cljs.hl...
we also had to trick around a bit for the original snippet to work: https://github.com/exicon/homepage/blob/master/src/homepage/layout.cljs.hl#L138-L139 i think it still throws errors under certain circumstances if we leave this dummy script tag out
which you really don't want to have to wait for the hoplon app to be up and running to do?
wait so was there a way to just dump inert markup into the head without it becoming part of the hoplon app?
which is the other thing annoying us. the execution model is quite tricky this way, because it looks like it's part of the markup which would make u think it gets executed serially, but in fact it gets into the dom dynamically...
but these are 2 orthogonal approaches; i don't really see a sane way to integrate them yet
hence it makes no sense to talk about inserting a literal html string into the middle of hlisp
onetom: i think i get all that, and am envisioning just one or two slots you can hook into, such as just before </head> and just before </body>, to tell hoplon you want a literal string to be injected there once, at pre-render time, and hoplon can thereafter forget it's there
so that would be part of the boot-hoplon task, but hoplon at runtime should play well with that too both in production and development modes
just as some semi-static site generator like we did with our homepage or r u building a "webapp"? if it makes sense to do such delineation at all...
i'm really still a total n00b and don't even know hoplon well enough to tell if it'll be a good fit, but i really hope so, because what I know about it so far appeals to me much more than alternatives
i'd want to use it for static site generation as well as single- and multi-page webapps. the boot stuff + hoplon pre-rendering is way more appealing to me than any other site building tool
i came across assetgraph a long time ago after hitting all kinds of bugs in grunt due to unfixable design flaws and that seemed to address the problems, but never figured out how to use it
thanks @micha, i did see prerendering?
in the exicon source and it's good to have confirmation that's what you recommend. i'll use it!
@micha: hm, https://github.com/exicon/homepage/blob/9c5d79/src/homepage/layout.cljs.hl#L157-L161 uses (when-not prerendering?...
. and neither is resulting in the (script) getting dumped into the prerendered html when i try it.
...i commented out the (when...) so i just have a (script) tag in my (head). when i use the chrome develoepr console to inspect the live dom, i see my script tag. but when i View > Developer > View Source to view the initial html that was served, i don't see it there. shouldn't it have been prerendered?
no, i meant (when-not prerendering? ...
because if i have the script tag in the prerendered html, then as the hoplon code kicks in, that script dom element gets blown away and some scripts wont initialize correctly
@onetom, @micha: wrapping my (script) in a (when prerendering?) isn't including it at all, and when i comment out the when, it's not ending up in the prerendered html whether it's in the head or body
@micha: should i open a new issue since the prerenderer is stripping out my script element? is there anything i can do to work around this as long as the (:prepend-head...
hooks are no longer available?
the place to implement :prepend-head etc would be in the boot-hoplon compiler namespace
@micha, well if prerender?
is a more elegant solution like you said, i'd sooner just open a feature request asking for script to be pre-renderable. should i?
@jab @micha could this be why my parallaxing in materializecss isnt working? the timing of the jquery?
I thought it might be the cdn file taking too long to download
@onetom: http://dimplejs.org/ looks interesting though haven’t used it — used in https://github.com/omcljs/om-cookbook
@onetom: @donmullen I'm experimenting with vega (https://github.com/cljsjs/packages/tree/master/vega). Simple example on http://mynomoto.github.io/#/chart (click on the header to add one to each column)
Code to render the chart: https://github.com/mynomoto/mynomoto.github.io/blob/sources/blog/src/hoplon/vega.cljs.hl
@micha: just came across https://github.com/funcool/boot-codeina (via https://github.com/boot-clj/boot/wiki/Community-Tasks) in case that's another good contender for an api docs generator