This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2015-08-23
Channels
- # admin-announcements (25)
- # beginners (3)
- # boot (308)
- # cider (5)
- # clojure (93)
- # clojure-bangladesh (2)
- # clojure-italy (1)
- # clojurescript (63)
- # core-logic (23)
- # datascript (6)
- # editors (1)
- # emacs (2)
- # hoplon (320)
- # incanter (1)
- # jobs (6)
- # jvm (1)
- # melbourne (1)
- # om (2)
- # re-frame (9)
- # reagent (2)
- # slack-help (5)
- # spacemacs (2)
- # yada (1)
@alandipert: yesterday you mentioned your demo hoplon contacts project. It looks nice, thanks! Is there one that would also show off the server-side? Is Castra used for that? An example of that would be cool to have.
I'm trying to set up a project where I use boot-http with a ring handler. I set resource-paths to #{"resources"}, ring's middleware resources to "public" (so that the ring server will serve static resources from resources/public), create a resources/public/js/main.cljs.edn so that my main.js will end up there. When I start the server if I go to localhost:3000/js/main.js it is indeed there which is cool, but the index page can't find goog's base.js. The created main.js points to main.out/goog/base.js while it should be pointing to js/main.out/goog/base.js. Is this something I can set up or is the compiler not configured correctly?
@micha: im testing that for an hour now with different version number combinations. i read the discussion on #C053K90BR too.
and as the page loads the title (on the chrome tab) is iterating thru all the page titles and settles with the last one
but i reverted to exicon/boot-hoplon 0.1.2-SNAPSHOT because prerendering was broken again otherwise
i got a similar error as before:
Prerendering HTML files...
• newsletters/index.html
clojure.lang.ExceptionInfo: java.io.FileNotFoundException: /Users/onetom/.boot/cache/tmp/Users/onetom/exicon/homepage/8a8/-e9icqa/newsletters/index.html (No such file or directory)
'[[exicon/boot-hoplon "0.1.2-SNAPSHOT"]
[tailrecursion/hoplon "6.0.0-alpha6"]
[adzerk/boot-cljs "1.7.48-SNAPSHOT"]
this version combo works with prerendering and there is no observable FOUC eitherbtw, i looked into what are the latest version of some indirect deps and i was wondering if there is any reason for holding back on these upgrades:
[tailrecursion/javelin "3.8.0"]
[cljsjs/jquery "2.1.4-0"]
u mentioned some change in jquery, but it worked for stuffyou'd think that goog closure would be able to do that but i found it to be only partial implementation
have u seen this: https://www.youtube.com/watch?v=GMWAHzXQnNM
in a modern fully compliant browser jquery is simply a thin layer on top of querySelector and all those things
okay. it's just dnolen was advertising learning the "awesome closure lib" and using goog.object.get
instead of aget
and stuff like that, that's why i was wondering...
i got you, no need to further elaborate. just push the fixed boot-hoplon so i can test alpha6 😉
yeah, that guy was showing of templating, but immediately made me remember coconut lisp too
yeah he mentions what FF said and he said it's easy to polyfill it so it's not a big issue...
what worries me is this new ES6 is getting accepted and the webcomponents has started to gain traction
at the same time it's all half arsed solutions really. like coffeescript goes well beyond what ES6 provides, what's the point of trying to close the gap between the 2 just a liiiill bit? 😕
i found another bug btw in the prerender task yesterday, it was caching prerendered html based on the mtime of the input html file
can u recommend anything i can read up on weak references so i can understand what r u talking about?
which was incorrect because the stuff we're prerendering has nothing to do with the initial html
when you have dev tools open you can right click on the reload button and select "Empty Cache and Hard Reload"
we had to add this to our nginx config to make sure content gets updated quickly in the visitors' browsers:
expires 1m;
add_header Cache-Control "public";
we need to fix this in hoplon, use some kind of cache busting url scheme for the js file
maybe the url is the content hash?
the time has come, my hoplon friends, to talk of many things; of nginx and cdns, of cabbages and kings
(ns appboard.api
(:require
[ring.middleware.cors :refer [wrap-cors]]
...
(def ring-handler
(-> (not-found "Not found")
(wrap-castra
'appboard.api
'leaderboards.api
'app-builder.api
'distribution.api)
(wrap-utf-8)
(wrap-session
(node-mongo-session (config :db) "sessions" "appboard.v1"))
(wrap-cors (re-pattern (str "^" (config :frontend-url) "/?$"))
(re-pattern (str "^" (config :homepage-url) "/?$")))))
the browser doesn't give any helpful insight into why it doesn't send cookies with CORS, it just silently doesn't when it doesn't want to
we are setting the cookie on *.http://exiconglobal.com so {www,app,api,appboard}.http://exiconglobal.com can all access it
we also want to be able to support whitelabeling, so we don't know what domain the frontend will be on
we don't want random domains on the internet to be able to trick people into logging into our backend from their page
the whitelist would be for the middleware to use to deetrmine whether to generate accep-origin headers for that request or not
shouldnt the Access-Control-Allow-Origin:
header contain the list of all possible frontends?
so those regexes i set in the example above are not sent back, just the requesting domain IF that domain matched any of those regexes?
it's meant for APIs that are safe to use on other people's behalf without their knowledge
the api key used is associated with the domain of the sender for acocunting purposes, not for authentication
the confused deputy is the situation where the user has authroized the browser to perform certain actions on their behalf
you "deputize" the browser such that once you log into a site the browser can cache some token and automatically send it on subsequent requests
and in another tab you navigate to a different site that wants to make AJAX requests to the first site
the browser now needs to know whether it should send credentials or allow site 2 to make the AJAX request to site 1
the way it does this is by adding an additional CORS preflight step to site 2's request
it's metadata the browser needs to determine whether credentials associated with one domain are related to another domain
so the browser can decide what the security implications are of allowing or not allowing access from site 2 to resources on site 1
yup, im clear on that i think, but thanks for the explanation irregardless. my colleagues might found your explanation more enlightening that what they read about cors so far
oh also, some of the experimental features added to alpha6 might be useful for static site generators
i will try in all combinations, it just takes 5mins to run a :simple opt + prerendering
i read your commit message and i will check your gist too soon, im just having dinner atm
i was also wondering in our specific case i would be probably a lot better off if i would just generate 1 page with sections which depend on the URL, but not on the #hashfragment but on the /path/part...
i know u r against this HTML5 history api, but for such a limited case it might work, no?
but i slowly feel like if i would break our repo into 15 repos for every page we would have less issues
all of them could be on different hoplon, cljs, etc versions and could be deployed "independently"
derp disregard where it says "http://hoplon.io"
which is important on my project because we have people testing who aren't familair with the project
so with this --ids
option can i specify multiple pages? since we usually want to build the main page and navigate from there to the other page we are working on
so how important is it to you to be able to have pages at paths like products/42/index.html
etc
i'd like to do away with the tailrecursion.hoplon.app-pages._products_42_index_DOT_html
namespace names
in thai even in speech the colors are prefixed with the word "color" so i dont see why u shouldnt prefix it here 😉
apparently even google searches are somewhat complicated by the different forms for each word
i dont use simple during dev. i used it for prod (because :advanced was buggy with some of the hoplon versions)
where is this fascination of yours w natural languages comes from? i was dating linguist girls for years...
[adzerk/boot-cljs "1.7.48-2"]
works with :optimizations :none
but the *re*compilation time is abysmal; it's 54seconds, while it's "only" 16seconds with 1.7.48-SNAPSHOT