This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-03-27
Channels
- # bangalore-clj (1)
- # beginners (27)
- # boot (16)
- # cider (14)
- # cljs-dev (94)
- # cljsrn (8)
- # clojure (229)
- # clojure-dev (5)
- # clojure-dusseldorf (6)
- # clojure-italy (8)
- # clojure-norway (8)
- # clojure-russia (22)
- # clojure-sanfrancisco (2)
- # clojure-spec (48)
- # clojure-uk (44)
- # clojurescript (47)
- # core-async (87)
- # cursive (43)
- # datascript (22)
- # datomic (20)
- # defnpodcast (5)
- # emacs (6)
- # hoplon (4)
- # jobs-rus (4)
- # keechma (2)
- # klipse (8)
- # leiningen (2)
- # luminus (2)
- # lumo (14)
- # om (38)
- # onyx (4)
- # overtone (3)
- # pedestal (41)
- # planck (72)
- # powderkeg (42)
- # proton (46)
- # protorepl (9)
- # reagent (9)
- # ring (47)
- # ring-swagger (5)
- # rum (7)
- # sql (22)
- # unrepl (1)
- # untangled (24)
- # vim (19)
- # yada (5)
when you make something with (new ...)
using a thing you made with (deftype ...)
is its storage implemented with persistent immutable stuff?
@U06HTKDMF in Clojure I know that (deftype …) is effectively a final Java class, no data structures beyond that for max. performance; I would be curious to know what ClojureScript does if you dig into it
@tbaldridge @mikethompson @anmonteiro great discussion in general btw about the trade-offs of different libs
My experience has been with om.next, and most recently one great thing that I’ve been utilizing is the “client-queries-as-a-server-api” possibility where I send the client queries to the server, use core.match on the server to parse them there and send back the appropriate part(s) of client state. And I’m using Postgres on the backend! (even though, arguably, Datomic would be effectively ideal, since it will eliminate the majority of accidental server-side data transformation code) The conversion from om.next query data -> honeysql SQL query data has been mostly pain-free; no more REST-like madness like /update/this/id/1, /save/that, /get/products, etc; but even beyond that the biggest win for me is the effective “de-duping”/”merging" of HTTP requests or WebSocket messages; the “app launch/initializing” logic has always been super hairy in all projects that I’ve done before but now it’s effectively gone. You either had to manually enforce “one request at the start of the app only!” or coordinate a bunch of requests “in-flight” via some core.async wizard skills; it’s never pretty; Let’s say I need “products”, “account”, and “categories” data at app launch; that’s sent as one request(!), and I didn’t have to do any work to make that happen; the only part I had to do was writing a server-side core.match destructuring logic but that’s literally 100 lines or so; maybe when I flush out the idea more it can be a library one day; in any case, if you use Datomic that won’t be needed
By default deftype is immuatable, but you can define mutable elements in a type, but this does at the same time make the elements only private accessible, so you need to add getters/setter methods by using a protocol. For the javascript parts it’s almost the same, but you can also mutate the data in a normal deftype, but this is because javascript don’t have immutable data types. So in javascript you can use a set! on a type, while in java you can’t.
Looking for a library/framework for clojurescript in functional reactive style like cycle.js. Does anyone know if this exists? Or maybe an extension to one of the popular clojurescript frameworks?
@lifecoder Something like this? https://github.com/hoplon/javelin
@lifecoder I think http://github.com/funcool also has a few of those.
is there a reference frontend/backend om.next app? I dabble in om but found I had to write alot of boilerplate, didnt help I was learning clojure… There’s #untangled but I dunno how useful it is...
@lifecoder Unpopular opinion: You might not need any of those reactive/stream approaches. I'm currently writing a large SPA and I'm all synchronous code. Much easier. Anything remote will be put into data after 1-2 "hops" of async Promise. After which I'm back to synchronous.
@mping Don't start with Om.next if you're new to clojure. Go with old om, reagent, rum or quiesent.
@rauh Im not new to clojure, but there’s alot to learn 😄 I’ve done stuff with reagent already, enjoy it but om.next seems interesting
hi, has anyone tried to use this http://re-demo.s3-website-ap-southeast-2.amazonaws.com/#/date with momentjs?
@rauh, how do you have synchronous code in JS?
Or are you saying "limited async for network calls, the rest is sychronous"?
@tbaldridge Yes that's what I meant. Any state changes/event don't happen async. Every now and then I'll use goog.async.nextTick
appreciate the discussion regarding clojurescript libraries and their trade-offs. good to know that both om.next and reframe are viable solutions.
I think this is the best part of Om.next. I've been using this kind of API from re-frame for client-server communication, and it works great there too.
@isak that’s good to hear 🙂 just curious, how does a re-frame “query" look like or you made your own in some form?
@isak I agree, for various reasons using re-frame recently on something and we just did an om.next approach with Datomic - works great
I think the simplifying approach is more important than which library you use - though of course I’ll put my vote for om.next 😉
@raspasov We had the Om.next query -> SQL already handled for queries and updates, so we just made an event handler, effect handler, and subscription to make that as convenient as possible. Some places, for example, we subscribe
to an om next
query, that then gets executed on the server, and the result sent down (returns a :pending
state in the meantime). Then that data gets wiped when the subscription is disposed. So it is kind of similar to om.next in that the query can be colocated with the component, the difference of course is that it cannot be composed from the component hierarchy.
Usually, for more permanent data, we trigger it from an event, so we have an effect handler called query-next-giving-id
, which does the query, and places the data in a predicable place people can subscribe to.
I'm trying to test out using :npm-deps
in a basic figwheel project and I'm getting ^--- The key :npm-deps is unrecognized
. Is there any documentation on what else I need to update?
@rgdelato probably my fault, http://dev.clojure.org/jira/browse/CLJS-1988
just created & attached a patch to that ticket
@anmonteiro applied
@rgdelato can you try again with current master? 🙂
please report back any feedback!
...sorry if this is a dumb question, I'm still on the newer side to cljs. What do I set my dependency to to get master? Is it just [org.clojure/clojurescript "master"]
?
key is still unrecognized for me after building master and updating my clojurescript version, but I'm still digging into it to make sure I'm not making some obvious mistake
there’s a warning though:
..../1wwo/-6u3tlw/js/main.out/cljs/analyzer.js:4996: WARNING - incomplete alias created for namespace cljs.spec
var mchk = (function (){var and__5243__auto__ = cljs.spec;
^
Mar 27, 2017 3:32:16 PM com.google.javascript.jscomp.LoggerErrorManager printSummary
WARNING: 0 error(s), 1 warning(s)
@ag do you have core.async
in that project?
not a core.async problem
use 1.9.473 for now