This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-07-11
Channels
- # arachne (5)
- # beginners (28)
- # boot (59)
- # cider (10)
- # cljs-dev (10)
- # cljsrn (10)
- # clojure (58)
- # clojure-brasil (2)
- # clojure-czech (9)
- # clojure-miami (1)
- # clojure-poland (2)
- # clojure-russia (12)
- # clojure-spec (16)
- # clojure-sweden (1)
- # clojure-taiwan (1)
- # clojure-uk (77)
- # clojurebridge (3)
- # clojurescript (108)
- # cursive (5)
- # datomic (25)
- # defnpodcast (2)
- # editors (1)
- # events (1)
- # funcool (24)
- # hoplon (37)
- # instaparse (1)
- # lein-figwheel (7)
- # leiningen (7)
- # luminus (3)
- # off-topic (9)
- # om (90)
- # onyx (88)
- # proton (3)
- # protorepl (9)
- # re-frame (30)
- # reagent (23)
- # rethinkdb (2)
- # untangled (33)
- # vim (1)
- # yada (6)
Is there a way of embedding some raw html in a hoplon page? I have some nice html output from Google's diff-match-patch library that I would like to include in a page.
(with-let [d (div)] (.html (js/jQuery d) "<p>foo</p>"))
is one way
@mac (div :html "<p>hello world</p>") ;; string
(div :html cell-containing-html-string) ;;
micha [9:55 PM]
thats the easiest way to do it in hoplon. the :html
attribute expands to (.html (js/jQuery the-element) "<p>hello world</p>")
[9:56]
or in plain js, jQuery(the-element).html("<p>hello world</p>")
[9:58]
you can see all the custom attributes provided by hoplon here: https://github.com/hoplon/hoplon/blob/master/src/hoplon/core.cljs#L522-L586
I just released the initial version of https://github.com/mynomoto/hoplon-spectre.css demo page on http://mynomoto.github.io/hoplon-spectre.css/
It's not as ambitious as hoplon-ui but has lots of useful elements. I will implement forms and autocomplete bound to cells next.
@martinklepsch: @juhoteperi: @micha:
im getting this error with boot-hoplon:0.2.2
using boot-reload:0.4.11
:
"adzerk/boot_reload/init4776.cljs"
java.lang.IllegalArgumentException: Don't know how to create ISeq from: clojure.lang.Symbol
...
clojure.core/first/invokeStatic core.clj: 55
clojure.core/first core.clj: 55
clojure.core/map/fn core.clj: 2646
...
clojure.core/seq/invokeStatic core.clj: 137
clojure.core/filter/fn core.clj: 2700
...
clojure.core/seq/invokeStatic core.clj: 137
clojure.core/keep/fn core.clj: 7044
...
clojure.core/seq/invokeStatic core.clj: 137
clojure.core.protocols/seq-reduce/invokeStatic protocols.clj: 24
clojure.core.protocols/fn/invokeStatic protocols.clj: 75
clojure.core.protocols/fn protocols.clj: 75
clojure.core.protocols/fn/G protocols.clj: 13
clojure.core/reduce/invokeStatic core.clj: 6545
clojure.core/into/invokeStatic core.clj: 6610
clojure.core/into core.clj: 6604
hoplon.boot-hoplon.refer/get-cljs-deps/invokeStatic refer.clj: 148
hoplon.boot-hoplon.refer/get-cljs-deps refer.clj: 137
this line seems to expect a :require
'd namespace to be in a sequence if i understand it correctly:
https://github.com/hoplon/boot-hoplon/blob/master/src/hoplon/boot_hoplon/refer.clj#L143
but boot-reload
generates a simple namespace symbol (eg app.main
):
(ns adzerk.boot-reload.init4779 (:require [adzerk.boot-reload.client :as client] app.main))
if i fix it like this:
(mapcat (comp (partial map #(if (symbol? %) % (first %))) (partial drop 1)))
so the list of namespaces for the reload namespace is correctly: (adzerk.boot-reload.client app.main)
i get the following error in the browser on the 1st reload:
display.cljs:93 Uncaught TypeError: goog.dom.constHtmlToNode is not a function adzerk$boot_reload$display$construct_hud_node @ display.cljs:93
adzerk$boot_reload$display$insert_container_BANG_ @ display.cljs:104
(anonymous function) @ display.cljs:126
(anonymous function) @ core.cljs:4151
cljs.core.swap_BANG_.cljs$core$IFn$_invoke$arity$2 @ core.cljs
:4151cljs$core$swap_BANG_ @ core.cljs:4144
adzerk$boot_reload$display$display @ display.cljs:120
(anonymous function) @ client.cljs:42
G__11015__3 @ core.cljs:9888
G__11015 @ core.cljs:9997
(anonymous function) @ client.cljs:59
goog.events.EventTarget.fireListeners @ eventtarget.js:284
goog.events.EventTarget.dispatchEventInternal_ @ eventtarget.js:381
goog.events.EventTarget.dispatchEvent @ eventtarget.js:196
goog.net.WebSocket.onMessage_ @ websocket.js:426
reload.cljs:66 Reload
okay, so i think it boils down't to my specific boot-reload
configuration because im using the :on-jsload
option to update the dom with the app.main/index
function which calls the hoplon.ui/window
function to rebuild the whole dom...:
> cat /Users/pair/.boot/cache/tmp/Users/pair/ap/fe//9d9/-6qen6r/adzerk/boot_reload/init4782.cljs
(ns adzerk.boot-reload.init4782 (:require [adzerk.boot-reload.client :as client] app.main))
(client/connect "" {:ws-host nil, :asset-host nil, :on-jsload (fn* [] (app.main/index))})⏎
@eric.shao: Thanks a lot.
i added some documentation for pages and routes in the wiki
@alandipert: would you be able to review it and update the @todo
for how the page
macro works?
@thedavidmeister: for sure, i'll give it a look today!
I know Hoplon is usually used for enterprise software. But I want to ask: Is Hoplon friendly with SEO?
@eric.shao: not as friendly as a static content site, if SEO is important then it's probably a good idea to have separate content pages and app page
but there is the prerender task which can be used to get some level of search engine visibility
@alandipert: Thank you for your reply.
@eric.shao: https://github.com/hashobject/perun looks like a really nice way to make static sites w/ boot+clojure
i haven't used it myself for anything. but it might be possible to combine it with the prerender task in order to make hoplon-based static sites, basically using hoplon as html
https://github.com/luminus-framework/luminus-template/issues/235 Luminus Template is going to add Hoplon support.
I adopted it from developing matchbox, @crisptrutski was using it there, im not sure what the correct name is but it is also used in the Om documentation:
> korks
is a key or sequence of keys
yeah 😛
ha i remember it from original om source, great word
Weak refs on javascript may become a thing https://github.com/tc39/proposal-weakrefs
the last time it came up it was rejected for security reasons
i will follow this, thx for pointer @mynomoto
how can I get an attribute to update when a cell changes that isnt the incoming attr value?
Ideally I would like some-other-cell
to be an instance of route-cell