This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
Has anyone looked at Deku at all? It's ridiculously small compared to React and I kinda like the look of the API, but I haven't tried it yet. (https://github.com/dekujs/deku)
@micha hey, thanks. Hoplon and Elm were significant influences on re-frame.
@mikethompson: thanks! i'm 100% on board with re-frame (maybe minus react 😄 )
i think the water cycle is a better illustration of the concept than the thing i did http://hoplon.io/img/arch-full.png
@micha I love a good colour gradient, so I'm a fan.
@ul I really appreciate you doing the archiving, thanks! http://clojurians-log.mantike.pro/
(although it doesn't look like the google bot has deeply visited yet)
Looks pretty nice too http://clojurians-log.mantike.pro/clojurescript/2015-06-05.html
Send a private email from your gmail account, including the required link. I've found that triggers a bot visit soon afterwards.
Hello, did anybody have experience of writing WebGL apps in ClojureScript? What option did you find good for you - using cljs-webgl or wrapping some library like threejs or just plain js interop?
@nidu: No specific WebGL experience or opinion here, but keep in mind some of them are already available on https://github.com/cljsjs/packages e.g. three and hence on clojars.
@denisj: thanks. three is a very thin wrapper for threejs. I initially thought it's a wrapper for d3 because it's mentioned as a home website at https://clojars.org/cljsjs/three
@blissdev: that's more about cool live editing than about graphics though i found some interesting stuff in :require)
@nidu: it’s actually about live editing WebGL tutorials. The tutorials use a new library called Gamma by Kovas Boguta. It’s worth looking into and I think a better direction than the alternatives.
I've got sente running in a project currently in conjunction with some om components and it works reasonably well, but the project isn't very complex yet.
create a compojure POST route for /login, use friend/buddy for the auth, then use the auth middleware with ring? so auth before initialising the sente websockets?
If you authenticate after you init the socket (or if you change your authentication at some point) you need to restart the socket.
BTW, in terms of making my reagent app a bit more "reload friendly", my solution was to add a small bit of indirection.
(defonce ^:private pages
(atom {:loading (fn [] [nav-border {:title "Loading ...."
:hide-login true}])}))
(defn register-page
"Maps a keyword to a component function, used by [[current-page-view]]."
[name f]
(swap! pages assoc name f))
(defn current-page-view
"Determines which 'page' to view based on the :current-page key of the app-db, and previously registered
pages (via [[register-page]])."
[]
(let [current-page (subscribe [:current-page])]
(fn []
[(get @pages @current-page)])))
so the non-logged in user has no uid, they get assigned a uid serverside after auth, clientside restarts the socket connection, new socket has the new session uid!
So the data in the app-db is just a keyword (which is an improvement), and reloads of the namespaces will update the pages atom with new functions. Now everything works without any need to mess with secretary and/or History.
@ej don't think an if-let helps me here, the :current-page key should always match an entry in the pages map; if not, I'd be more likely to add a default to the get call, to a "not yet implemented" view.
(defn init-routes []
(secretary/set-config! :prefix "#")
(defroute "/home" []
(dispatch [:render-component :home]))
(defroute "/next-page" []
(dispatch [:render-component :next-page]))
(hook-browser-navigation!))
(register-sub
:component-to-render
(fn [db _]
(reaction
(condp = (:component @db)
:home home/component
:next-page next-page/component
(error-page)))))
@dnolen: as far as i can see Gamma covers shaders only using goog.webgl for everything else. I was looking for a more general solution like threejs or scenejs (declarative style of this one would probably play very well with clojurescript immutability).
nidu: I played around with https://github.com/Izzimach/om-react-pixi and it was decent. He's also built https://github.com/Izzimach/react-three, though I don't see any specific cljs wrappers for it
@nidu there’s also the driver component. As far as scene graph maybe toxi has something?
@leonoel: I’m actually surprised that works at all. I would just rewrite your conditional. While there may be a bug that’s going to be pretty low priority.
Thanks for great links! @xeqi: react-three looks very promising. @dnolen: Codefactory looks decent. It seems like rendering is based on http://thi.ng (or maybe http://thi.ng came from codefactory) mostly or entirely.
Luke Vanderhart and Stuart Sierra are working on a new edition of ClojureScript: Up & Running
still that’s not going to help with fast rate of change wrt. the various React bindings
dnolen: agreed.. the various blog posts has been interesting. As well as your work on om.next
@dnolen: I did some more digging in the slides about relay and mutation - looks totally like they have support for stuff like tx-report-que
@tcrayford: yeah they alluded to it at the end.
@dnolen: think om.next
might the final brick in the wall that moves yeller away from server rendered templates
Speaking of relay, (maybe I read some stuff wrong) I am kind of curious how Datomic will also fit into that (still need to try it out).
I'm not sure I'm phrasing this well, but here goes: So, in Om, for component data that you don't expect to change is it acceptable to simply set it via a closure, or does it belong in the component-local state? e.g. (defn my-component [unchanging-data data owner] …)
followed by use of my-component
with partial
.
zane: with closure, do you mean wrapping an om component in a closure.. something like:
(defn some-component [x]
(fn [data owner]
(om/component
(span nil x))))
@markstang: my comment above was about my code snippet, not yours
@jonas: The function that creates some-component
takes an additional prefix argument, which is later parameterized via partial
.
@rtorr: Datomic supports Pull syntax and can return deltas, there’s not much more info to know
(def some-component
(fn [x data owner]
(om/component
(span nil x))))
(om/build (partial some-component "foo") ..)
I’m pretty sure this will also remount for each render@jonas: Okay, good to know. So the right thing to do is put it in component-local state?
Hey, @dnolen, is there a document or talk somewhere that documents the expected changes in Om Next?
@dnolen: I am more speaking to checking it out myself so I am not so ignorant with it, and integrating it with react. I am also looking forward to using the relay model with react itself and seeing how gql plays out.
@tcrayford I had that same thought, (moving from server side rendering to Om) hoping I can do something worthy of a blog post
@gary: What's the idea there? Just that there isn't a significant enough perf gain by rendering the initial app state on the server?
So, in reagent, I'm still trying to wrap my head around one aspect of form-2 component functions (function that returns a render function).
The docs mention that you have to declare the same set of parameters in both functions.
I would assume that's because the Reagent hiccup syntax sees [my-func :a :b]
and invokes (my-func :a :b)
But I kind of don't get why that function needs the parameters AND I totally don't get the bit about the render function being re-invoked with different data, later.
I mean, I guess it's related to Reagent atoms & subscriptions, So if a subscription changes, the render function is re-invoked. But why would any of the parameters be different at that point? And if not, why are they even needed?
@hlship: excellent question. All I know is that the component re-renders when the props (args) change or the subscribed atom(s) change. If setup state (that the component closed over) would also change because of props, how would that work...
@borkdude: one of the best talks from Clojure/West a must watch https://www.youtube.com/watch?v=j-kj2qwJa_E&index=33&list=PLZdCLR02grLrKAOj8FJ1GGmNM5l7Okz0a
I thought I read somewhere that it was a portmanteau/play on words with repl somehow. Maybe that's weasel, though.
so that's probably wordplay? or is that a technical term for some side process running
@hlship: I made an example that shows what happens https://www.refheap.com/102131
@zane: the idea is that html templating gets messy and slow when the application state starts getting complicated
@hlship: When you pass a prop and initialize local state and rely only on that local state to display stuff, you won't see a changed prop. if you use it directly you will
@hlship: there is also some documentation about the difference between [foo x] and (foo x)
@hlship: here are some useful resources (I'm not suggesting to use this framework though, didn't look into it myself): https://github.com/Day8/re-frame/wiki
@hlship: especially this one about [] and (): https://github.com/Day8/re-frame/wiki/Using-%5B%5D-instead-of-%28%29
@zane: yes, I'm also interested in helping other Java/Spring developers out of the tarpit
Angular is getting some traction at my dayjob, so once people get comfortable with SPAs I'm going to go to the managers and say "hey this Angular thing is great but I know this other thing that leverages the JVM." they'll always pick a technology that has java in the description over anything else
but first I need to be an expert in it and have an elevator pitch style answer for every little question anyone has
@gary my current client have rejected Angular as ‘too opinionated’. They are more open to React as they prefer it’s paradigm. However, given their conservative nature I suspect Reagent or Om would be several steps too far!
@akiva: one fairly clever JS developer who has the ear of the right people!
@martinklepsch: I take it the codemirror addons haven’t yet been bundled with the codemirror cljsjs JAR?
Linux fans: A demo of REPL into iOS: https://youtu.be/IyPvEY97i3k
@borkdude So my guess is that if you had something like:
[my-component @(subscribe [:foo])]
And my-component is a form-2, then it will be invoked directly once (with the :foo value), then the returned renderer will be invoked once (again, with the current :foo value), then the returned renderer will be invoked again when the value of :foo changes.
Anyway, that's my guess as to what's going on.
My point is that it feels like the form-2 function should capture its parameters, and the renderer should always be invoked with no parameters.you can use the initial props to set up local state, but that's only before the component will be mounted
next time you pass other props the component will only be re-rendered. that's why you have to use two times the same arity I guess
@borkdude: Not to be pedantic, but looking at https://www.refheap.com/102131, it seems like the component generated from hello-world will always re-render when app-state changes, so there's no chance for the form-3 component to re-render "in place". I think that would hold not just for the [:p "App Sate " @app-state] element, but also for the [form-3 @app-state] itself ... the process of providing a new value from an ratom should, as I understand it, invalidate the outer component as well a the inner one ... but perhaps I'm underestimating Reagent's cleverness. I haven't looked at the code yet.
And, to be honest, it doesn't matter that much for a mostly-crud app like I'm currently working on. Maybe something with a lot of charts/graphs/graphics it would be different.
@hlship: there is a chance for the form 3 component to re-render in place: when you hit its button
I think you're right ... I'm just trying to wrap my head around things conceptually. I'm finding that a lot easier with React than with, say, Angular.
@dnolen: addons as in language modes?
@martinklepsch: no addons like bracematching, closebrackets etc.
@dnolen: ah. Not that I'm aware of.
@martinklepsch: seems like something simple enough to add given you guys already have the modes sorted out