This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-06-16
Channels
- # arachne (1)
- # beginners (27)
- # boot (17)
- # cider (10)
- # cljs-dev (5)
- # cljsrn (76)
- # clojure (59)
- # clojure-austin (2)
- # clojure-brasil (1)
- # clojure-greece (76)
- # clojure-mexico (1)
- # clojure-quebec (63)
- # clojure-russia (16)
- # clojure-spec (127)
- # clojure-uk (12)
- # clojurescript (72)
- # community-development (7)
- # core-async (3)
- # core-matrix (2)
- # cursive (13)
- # datomic (8)
- # emacs (4)
- # funcool (4)
- # hoplon (148)
- # immutant (5)
- # keechma (2)
- # lambdaisland (5)
- # lein-figwheel (15)
- # leiningen (20)
- # off-topic (23)
- # om (13)
- # om-next (19)
- # onyx (11)
- # planck (11)
- # re-frame (59)
- # reagent (14)
- # rum (34)
- # specter (30)
- # spirituality-ethics (16)
- # uncomplicate (5)
- # untangled (387)
- # yada (2)
ok, yes, I got the right version locally
still:
(page "test.html")
(html
(head (title "Test"))
(body (h1 "Test")))
Webpage error details
User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; .NET4.0C; .NET4.0E)
Timestamp: Thu, 16 Jun 2016 00:03:32 UTC
Message: 'console' is undefined
Line: 2
Char: 79
Code: 0
URI:
so i had simple optimizations on. when opts are set to simple or advanced, it works. when they’re set to none, it fails.
ah...
so even in dev mode, you use simple
is it slowing you down a bit for reloads?
so what is trying to access js/console
that get’s shaken out when simple or advanced optimizations are on?
not much… i usually have it set to none, but think it was on simple from prior testing
It works!
advanced
excellent! Thank you so much!
you saw this right?
if (typeof goog != "undefined") { goog.require("boot.cljs.main808"); } else { console.warn("ClojureScript could not load :main, did you forget to specify :asset-path?"); };
my theory is that the console in ie 8 isn’t available unless dev tools are open or something, so it errors
but that says nothing about the underlying issue of why it is trying to write this warning to the console in the first place
@leontalbot: are you running on a windows machine?
mac os
After my stuff works in chrome, then I should test with browserstack vms
simple opts is fine
yeah, i’m not going to invest too much more time on this problem… but i’d still like to understand why it is happening
that happens when the js file is missing or it's trying to load it from the wrong place
compojure routes
(GET "/test" req (-> "test"
response/resource-response
(response/content-type "text/html")))
(ns app.handler
(:require
[compojure.core :as c :refer [defroutes GET POST]]
[compojure.route :as route]
[ring.middleware.defaults :as d]
[ring.util.response :as response]
[castra.middleware :as castra]
[ring.middleware.content-type :refer [wrap-content-type]]
[ring.middleware.defaults :as d]
[ring.middleware.not-modified :refer [wrap-not-modified]]
[ring.middleware.resource :refer [wrap-resource]]
[app.routes :as routes]
[app.utils :as u]))
(defroutes www
(GET "/test" req (-> "test.html"
response/resource-response
(response/content-type "text/html")))
(route/resources "/" {:root ""}))
(defroutes data)
(def domain-specific-routes
(u/domain-routing
{"" data
"" www
"0.0.0.0:5000" www
"localhost:5000" www}))
;;;; HANDLERS
(defn global-wrap [x]
(-> x
(d/wrap-defaults d/api-defaults)
(castra/wrap-castra-session "a 16-byte secret")
(castra/wrap-castra 'vpc-hoplon.api)))
(def dev-app (global-wrap domain-specific-routes))
(def prod-app
(-> domain-specific-routes
(u/wrap-force-ssl)
global-wrap))
something like that
yeah those dev tasks are not expected to be used with browsers that have no useful dev tools
Good job!
For some pages, I still see errors but only in IE 8... weird Message: Object doesn't support this action Line: 708 Char: 194 Code: 0 URI: https://www.votepour.ca/index.html.js
IE 9 works fine everywhere
here is the portion of the js code taht seems not supported
null==b&&("undefined"!=typeof Object.defineProperty?(b=++Eq,Object.defineProperty(a,Gq,{value:b,enumerable:!1})):a[Gq]=b=++Eq)
yes, hold on
the bug we have with optimization none remains on every page
ClojureScript could not load :main, did you forget to specify :asset-path?
reload yes in dev
oh ok
so still have the IE 8 object Object problem
this is seen with opt advanced
removing reload...
ok so even when removing reload form pipeline, still got the could not load :main
issue
here is my pipeline
(deftask dev
"Build vpc-hoplon for local development."
[]
(comp
(serve
:port 5000
:handler 'vpc-hoplon.server/dev-app
:reload true)
(watch)
(speak)
(sift :move {(set->pattern excluded-files)
"src/vpc-hoplon/archives"})
(hoplon)
;(reload) ;:on-jsload 'vpc-hoplon.rpc/refresh
(cljs)))
so I have in index.cljs.hl :
(defn get-url-uri [] (-> js/window .-location .-pathname))
...
(let [u (get-url-uri)]
(case u
"/" (view-home)
(campaign/view-campaign (get pages u))))
In IE 8, when at /
I see everything. But when I am at say /test
then the view-campaign
doesn't load
in the handler
(GET "/" req (-> "index.html"
response/resource-response
(response/content-type "text/html")))
(GET "/test" req (-> "index.html"
response/resource-response
(response/content-type "text/html")))
Not sure if it is comprehensive
with opt only
i personally create my client-side hoplon artifact in a separate project from my server, and serve it statically from an s3 bucket or github
And doing so would help me you think?
this seems really interesting
ok, trying...
thanks again...
good night @jumblerg
@leontalbot: i would also argue against using the path part of the url in single page apps to determine view or screen does your SPA shows, simply because it's a lot simpler to implement that using the hash fragment part of the URL but here is an article which explains what would you need in case u insist using the path: https://kkob.us/2015/11/24/hosting-a-single-page-app-on-s3-with-proper-urls/
raises hand
@xifi: I don’t have any on-hand that I can show you (proprietary code for a client, and I would get into trouble :P) But I can come up with a quick sample later in the day for you.
Is there anything specific you want to see/do?
(my replies will be sporadic because i'm playing heroes of the storm with some friends at the moment)
levitanong: I haven't done much interop yet so I was just curious how well would it play with cljs. If the code would look like js in clojurescript notation or something
@xifi: Because of d3’s nature, I approach the cell problem by do-watch
.
(do-watch (cell= [data config])
(fn [_ [data config]
;; d3 code))
levitanong: thanks for the snippet! I'm not familiar with do-watch
, will take a look.
no problem. do-watch
is a wrapper around add-watch
. It does all the symbol generation for you. It also assumes you won’t be removing watches.
@onetom: thanks! So you too are suggesting S3 hosting for hoplon spa? This cloudfront hack is good to know.
@leontalbot: does your app hosting require a backend?
@leontalbot: yes, i agree with serving the frontend of an SPA via S3+CF i just don't agree with using this 404 trick. i would just use CF to allow HTTPS & as a CDN
@flyboarder currently I am using heroku to host both frontend and backend
If you just need static hosting for the front end you can use firebase hosting
provided your backend isn't serving the front end
Yeah i got a firebase free account. Why not...
@leontalbot: if you havnt already tried the new google firebase console, you should check it out
@flyboarder: yeah. I saw the announcement on producthunt. Google seems serious about this!
If my 2cents is worth anything, it’s pretty slick now and all the bugs i had when i first upgraded to v3 have been sorted 🙂
having no backend helped accelerate our development