This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-05-03
Channels
- # admin-announcements (6)
- # beginners (73)
- # boot (84)
- # cider (9)
- # cljs-edn (5)
- # cljs-site (8)
- # cljsrn (2)
- # clojure (158)
- # clojure-austin (1)
- # clojure-canada (1)
- # clojure-dusseldorf (2)
- # clojure-ireland (1)
- # clojure-russia (45)
- # clojure-sg (2)
- # clojure-uk (28)
- # clojurebridge (2)
- # clojurescript (142)
- # core-async (43)
- # cursive (23)
- # datascript (5)
- # datomic (9)
- # dirac (4)
- # emacs (23)
- # funcool (1)
- # garden (1)
- # hoplon (280)
- # jobs (1)
- # ldnclj (6)
- # leiningen (37)
- # luminus (6)
- # om (30)
- # om-next (1)
- # onyx (6)
- # perun (24)
- # re-frame (10)
- # reagent (20)
- # remote-jobs (1)
- # rethinkdb (2)
- # ring-swagger (4)
- # rum (3)
- # spacemacs (6)
- # untangled (36)
- # yada (5)
@leontalbot: there is the *request*
dynamic var i think
@micha! Excellent! Can you provide a minimal exemple so I can figure out how to use it?
could you try putting something like (prn castra.core/*request*)
into one of your rpc functions in the server?
(defrpc test! [] (str castra.core/*request*))
(test!)
=> ""
@micha ^^^I must do something wrong...
@micha You are right! it works, thanks!
Castra is a really nice piece of software
Count me in if you need help
Hi all! Javelin question: Given a large data structure, would a change in a very specific and small part of that structure cause reevaluation for all cells that have that large data structure as a source? For example:
(defc data {:a 2
:b {:c 3 :d 4}
:e {:f 5 :g 6}})
(defc= bd (get-in data [:b :d]))
(swap! data assoc-in [:f :g] 7)
In the example above, will the swap cause bd
to reevaluate?Does anyone actually uses the castra.core/*validate-only*
dynamic var?
It seems to me it's just some debug helper feature:
https://github.com/hoplon/castra/commit/aebc5c37fc8558255c1756c0f6342a5619f84cd0
@dm3: Wouldn’t that mean that ultimately for large projects, datascript is untenable?
@dm3 say… enterprise software 😛
@micha: @jumblerg:
would it make sense to hook up the castra xhr responses to some cells earlier,
instead of staying in promise land across mkremote
, ajax
, ajax-fn
?
we were trying to handle unauthorized responses to castra rpc requests.
1. make rpc call #1
2. it responds with a castra {:error {:message "Unauthorized" :data :unauthorized}}
3. show a login dialog until the user successfully logs in
4. make rpc call #2 (with the same parameters as rpc call #1)
5. return the response of call #2 as the response for call #1
to implement this with promises is quite unreadable and would require to redefine all of castra/core.cljs
as i understood.
@levitanong: i’ve been thinking about this. One idea I had was filtered databases.
@levitanong: also, there’s nothing to say you can’t have as many databases as you want
@levitanong: e.g. I’m probably going to have a separate database for “status messages”
one reason to pass your conn
around, so you can re-use utility functions for different dbs
i haven’t tried this, but a filtered database would change less frequently than the whole db, so if you had queries that you know only applied against a subset of the main db, and they were more expensive than a filter, you could squeeze some efficiency out there
@thedavidmeister: oooh! that looks like it could be useful. I’ll give it a try one of these days. Thanks for the tip
org.sonatype.aether.resolution.ArtifactResolutionException: Could not find artifact com.datomic:datomic-transactor-pro:jar:0.9.5350 in clojars (
@levitanong: @jumblerg any ideas?
running boot datomic -k XYZ
looks suspicious… i don’t really know anything about maven though
Failed to execute goal org.apache.maven.plugins:maven-install-plugin:2.4:install-file (default-cli) on project standalone-pom: The specified file '/Users/thedavidmeister/estimate-work/datomic-transactor-pro-0.9.5344.jar' not exists -> [Help 1]
hmm, but https://github.com/jamesmartin/datomic-tutorial works in the repl
Hmm. I do something different with datomic.
(let [uri "datomic:"]
(d/delete-database uri)
(d/create-database uri)
(def conn (d/connect uri))
(d/transact conn schema)
(sample/init-all! conn))
@thedavidmeister: u probably want to cd /your/datomic-pro/
and bin/maven-install
oh wait, you’re using pro
this is the free version
i can do either...
if thats the thing which doesnt work then it's because u tried to install it over the net and in your ~/.m2
folder there is some maven metadata file which tells maven to keep trying to get it over the network
if i have [com.datomic/datomic-pro "0.9.5344”]
in boot
then where do i find it?
hmmm actually this problem sounds familiar
what i do is have a :repositories arg in set-env!
(conj % ["my-datomic" {
:url ""
:username “xxx"
:password “xxx"}])
@onetom: where actually is that bin/maven-install
if boot pulled it down?
That way, you just get the repo from datomic’s servers
(i think)
@levitanong: which is the more complicated way and u have to inlcude your secret into it and not something u can remember easily
yeah @levitanong i did this
:repositories [["clojars" " "]
["maven-central" " "]
["datomic" {:url ""
:username (System/getenv "DATOMIC_REPO_USERNAME")
:password (System/getenv "DATOMIC_REPO_PASSWORD")}]]
@thedavidmeister: if boot has successfully downloaded it then u dont need that bin/maven-install
Okay, I think i’ll defer to @onetom in this matter. My knowledge about maven is limited.
ok so basically...
my end goal is just to have some datomic thingo running so i can save some data in it, locally
i was not following the conversation though. i just saw the error message and it looked familiar.
not trying to get anything up in the cloud yet
That’s weird. My :repositories
is a function, while yours is a vector of vectors.
so if i do a repl
i can (require ‘datomic.api)
and then do stuff
yeah that’s fair
I do suppose this could go to #C053K90BR
well maybe i don’t need boot?
i don’t know...
i was hoping to just have castra talking to datomic
as an mvp
if you are happy with trying things our with an in-memory db first, then u don't need anything else just the free version of the datomic client because it contains the "in-memory transactor"
yeah but i don’t know how to set up either
some tutorials say one thing, others say another
@thedavidmeister: do u want to do a screen sharing session? i can help quickly
so if i have castra setup, will the in-memory db work between ajax calls?
well it’s probably working enough for now then 😛
@onetom: when you bind that to true in the client and you call an rpc function the backend rpc fn is called, but the body of it is not evaluated (only the preconditions)
when do i lose the memory db?
@thedavidmeister: when u stop your jvm
@onetom: oooh ok, so as long as i have serve
running with boot, i get the same db, so castra will work. That sounds good enough for experimentation for a bit
@onetom: the crucial thing is that when you're validating input you must not evaluate the body of the rpc fn
hi a question around focus, i have a use-case where users are editing a dom of code, i want to move focus around the dom. two ways I can think of to do this, 1) have a toggle of focus on each node, 2) after an update set focus explicitly, is there a ‘best practice’ approach?
because sometimes you just want to validate input that the user is typing, but the user doesn't want side effects to happen
why don’t you save the user input always, but have a way of knowing whether the input is “safe” or not for general usage?
that would be very confusing for the user if we were accepting input in the backend as they type
why would the user know what you put in the database?
when they start seeing those ads show up on their website they know it got into our database
oooh, i mean, have an extra thing in the database
a place to put raw input
that the user doesn’t see
until they make it match validation rules
oh, but you do validation server side?
i dunno? i’m literally about to try this approach, i’ll let you know how i go 😛
@micha: and what do u think about the automatic unauthorized response handling in castra?
well, what if a user was struggling with the validation
if you had the raw input in the db
your support staff could see the problem straight away
that’s one idea
if you rolled a new release that relaxed validation rules for something that was previously invalid, maybe you could retroactively allow things already in the system
@thedavidmeister: thats how @jumblerg is planning to extend hoplon. storing the whole frontend state in datomic so you can replay or join any user session any time
if people were consistently failing validation, you’d have data to do UX review on
@onetom: i’ve been using datascript for front end state
@onetom: it’s OK, but for my use case i’m finding that having a few different dbs and cells in different ns is better than one big one
@thedavidmeister: i see whta you mean now with saving in the database
that would be pretty sweet, and you could activate that behavior in castra when validate-only is bound
oh, fair enough
i’m playing around with this:
(defprotocol ISafe
"Safe values can be extracted from raw user input"
(raw [this] "The raw user input")
(safe [this] "The safe version of whatever the user input")
(raw? [this] "Is there any user input at all?")
(safe? [this] "Is the user's input safe?”))
then an input on a form would have something like
(h/input
:type "text"
:data-raw (j/cell= (item-data/raw? v))
:data-safe (j/cell= (item-data/safe? v))
:value (j/cell= (item-data/raw v))
sure, i’m just messing around with it client side
yeah totally
you could see what people are constantly getting wrong
that's aweosme when you can check out a copy of the database that is rewound in time to when the validation failed
when you don't have datomic it gets less useful i think, but still probably worthwhile to have
how come you can’t use datomic at adzerk?
is there a problem with it?
ah, so it’s byo db for your customers?
i thought the whole thing was you could have as many peers as you want?
oh sure
yeah i dunno
like what if cognitect goes under or what if there are intellectual property issues with datomic
we'd basically go out of business if that happened probably, if our whole thing was relying on it
that’s fair
so who is paying for it then?
i wonder if it would be OK to just stick entities somewhere
like, in rethinkdb or something
@micha: yes, 2nd response (if succeeds) would be the response of the 1st request. im just talking about retrying the rpc call, which would be "interrupted" by a login screen.
having a staet machine that mediates interaction with the backend is pretty key for that
the doomsday scenario is somebody buys datomic just to shut it down
ah yeah, foundationdb
i was using that
luckily, not for much 😉
is apple going to buy adzerk and take away my hoplon?
that’s fair
i am definitely not able to make database software
it’s ok, i have other skills
yeah i’d fork it
i’d rather not have to though
that’s true, github is buyable by apple too
lol “apple bought github to shut down all competitors everywhere"
imagine tomorrow you find that notice on http://github.com
If I was running Apple, I'd probably buy bitbucket, gitlab and github and shut down just for laughs
anyone here used rethinkdb before?
looks like they have a query powered data streaming thing
wondering how hard it would be to plug into javelin
yeah i don’t know if that’s exactly how it works
i’ll just read up and play around
changes
(changes table)
Return an infinite stream of objects representing changes to a table or a document.
i think that’s where i’d do it
but actually, that happens server side
maybe castra is not the right thing here
@micha quick question
With (env/def KEY "value")
"value" will be use as KEY key only if there is no environnement variable set-up, correct?
thanks!
Hey guys! I just started with Hoplon and I really like it! I'm using the default template from the tutorial (`boot -d seancorfield/boot-new new -t hoplon -n address-book`), but somehow there's no output generated when I run boot prod
or boot hoplon
. What am I missing?
@beatngu13: hi! Temp solution: If you want to test hoplon, you can also do lein new hoplon address-book
You can then run with boot dev