This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-09-11
Channels
- # bangalore-clj (1)
- # beginners (24)
- # boot (134)
- # boulder-clojurians (2)
- # cider (3)
- # cljs-dev (2)
- # cljsjs (44)
- # clojars (9)
- # clojure (60)
- # clojure-greece (2)
- # clojure-quebec (1)
- # clojure-russia (44)
- # clojure-spec (15)
- # clojure-uk (1)
- # clojurescript (37)
- # core-matrix (1)
- # datomic (7)
- # emacs (1)
- # hoplon (154)
- # liberator (3)
- # mount (2)
- # om (20)
- # onyx (2)
- # pedestal (3)
- # planck (12)
- # re-frame (26)
- # reagent (32)
- # uncomplicate (4)
(deftask build-heroku
"Builds a standalone jar."
[]
(comp (aot :namespace #{'app.main})
(hoplon)
(cljs :optimizations :advanced
:compiler-options { :parallel-build true }
(prerender)
(uber)
(jar :main 'app.main)
(sift :include #{#"\.jar$"})
(target :dir #{"target_prod"})))
(ns app.main
(:require [app.handler]
[clojure.string :as string]
[clojure.tools.cli :refer [parse-opts]])
(:gen-class))
(def cli-options
[["-u" "--db-update"]])
(defn error-msg [errors]
(str "The following errors occurred while parsing your command:\n\n"
(string/join \newline errors)))
(defn exit [status msg]
(println msg)
(System/exit status))
(defn -main [& args]
(let [{:keys [options arguments errors summary]} (parse-opts args cli-options)]
(if errors (exit 1 (error-msg errors)))
(apply (resolve 'app.handler/-main) arguments))))
(ns app.handler
(:use org.httpkit.server)
(defn -main [& [port]]
(let [port (Integer. (or port (environ.core/env :port)))]
(sente.wire/start-router!)
(run-server app {:port port})))
@danvingo not a totally clean example, but it’s the guts of what works for me on heroku
ultimately i bailed on the war and just made a jar
heroku deploy:jar --jar target_prod/project.jar --app my-app;
@thedavidmeister very cool, thanks!
Hello! Newb to hoplon here, just learning. I ran into something odd experimenting with for-tpl the other day. Here’s a simplification that demonstrates what I’m seeing...
In the snippet above, if I change for to for-tpl, I don’t see any output on my test page
What I end up with in <body> is a bunch of <script> references.
you only need the tpl ones when the collection will change over time and you want to update the dom accordingly
Yep @micha in my more complicated case there was a cell
I tried to simplify it down to the simplest possible example
Sure - makes sense
but I didn’t have a cell in my example
unless for-tpl somehow turns it into a cell
Ahh okay that’s the bit.
items
doesn't have to be a cell, it must be either a cell containing something seqable, or a seqable thing itself
Okay that helps me understand better - thanks @micha!
Very much so. Nifty development experience with the sounds and the auto-refresh.
The reactive framework behind is neat - watched the video about how it works. Just trying to get my head around all of it now 🙂
i guess the main way it diverges from most other approaches is by leveraging static allocation wherever possible
rather than the react model where you conceptually allocate and deallocate all the time
@leontalbot Reading through the hoplon/ui faq I found some dead links. I was going to update, but editing is not public. The second one on window attrs looks like it should be https://github.com/hoplon/ui/blob/master/src/hoplon/ui.cljs#L524
@leontalbot and the link for the tests file should be: https://github.com/hoplon/ui/blob/master/tst/hoplon/ui-test.cljs
@micha thanks for the castra error/exception tip yesterday. I added a little info to the wiki on this: https://github.com/hoplon/hoplon/wiki/Castra
@micha it’s been fun exploring. I made some primitive pagination. Then I noticed you have defp
in the sample you shared with me yesterday. Is that public code or internal?
however it's pretty tightly coupled to the scheme we use on the backend to make efficient optimized paginated queries on ms sql server
I’m building this exploration over a large database that often has thousands of rows
this thing has been pretty much the berzerker of databases considering what we throw at it all day 24/7
organizational state is like customer configuration info and stuff like that, like our customers setting up ad campaigns and so on
It’s been a decade since I’ve been on it. I recall now you or Alan telling me you were building over an old MS app.
sounds familiar. I haven’t done ASP since before C# and http://asp.net. Did a bunch back in the late 90s to 2000.
Mongodb. It’s been great, mostly. In the Rails world it’s great to have dynamic schemas. It was a great fit for our original system, but as I want some more relational data, it’s limitations show
the way i do the pagination with sql is to compile the query with the pagination added, sort of like a view, but by compiling the queries individually we can optimize them better
the main idea in this scheme is to use "common table expressions" which are sort of analogous to what you'd use temporary tables for in mysql
@jamieorc: thanks ! I am away from my computer right now. Maybe @jumblerg can assist you!
I was wondering if hoplon web app can be ported to android and iOS easily
(other subject)
so for example, the :data
field of the state machine returned by paginate
is a javelin cell whose contents are the paginated data
that will change potentially as you apply methods to the state machine object, like next-page!
etc
cool. It’ll take me a while to digest this, but this is great. Already gives me some ideas.
i have been struggling to express these machines in a more rigorous state machine model
so a cool thing aabout factoring out the state machine is that different components in the UI can be hooked up to it
there are at least 5 completely independent UI components there that are hooked up to the same pagination machine
in the upper right in the orange bar there is the refresh button, the page navigation and page size widget, and the search box for filtering
there is a lot of business logic in the c# application that we can't just duplicate (for cost reasons)
but the c# UI just wasn't cutting the mustard anymore, too many performance problems mostly caused by the ORM
but of course the ORM becomes the core of the whole thing so it's not really feasible to fix that in place either
so what we did was make a castra backend to give us the CQRS dataflow that separates the commands that might change something int he database from the queries that are just reading from the database
we could then make optimized queries in the castra :query
functions that talk directly to the database
but the "commands", eg. modifying something, those are proxied to our public management API
this guarantees that the new code can't introduce corrupted data into the database, and all other side effects that happen in the ORM on update or create are still done by the existing legacy system
later we can migrate the backend to something more sane without running two possibly incompatible versions of our business logic
@micha thanks for the additional info - sorry I’d stepped away from the computer
That strategy of replacing the UI first is what I’m hoping to eventually do with my rails app
yeah we needed to triage the UI first, it was just taking more and more developer hours to do simple things
we just want to get the implementation into a sane platform that we can iterate on later
^ hoplon.firebase
now also manages user authentication for you, cells are provided in hoplon.firebase.auth
for consumption in your application.