This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-12-19
Channels
- # beginners (240)
- # boot (9)
- # braveandtrue (2)
- # bristol-clojurians (2)
- # cider (2)
- # cljsrn (84)
- # clojars (1)
- # clojure (195)
- # clojure-belgium (9)
- # clojure-china (5)
- # clojure-denmark (4)
- # clojure-italy (7)
- # clojure-mke (1)
- # clojure-norway (1)
- # clojure-russia (16)
- # clojure-spec (74)
- # clojure-uk (15)
- # clojurescript (78)
- # clr (3)
- # code-reviews (4)
- # datascript (8)
- # datomic (71)
- # emacs (9)
- # hoplon (18)
- # jobs (3)
- # kekkonen (32)
- # klipse (19)
- # lambdaisland (2)
- # luminus (15)
- # off-topic (6)
- # om (35)
- # om-next (62)
- # onyx (17)
- # overtone (5)
- # pedestal (1)
- # perun (1)
- # planck (31)
- # protorepl (1)
- # re-frame (135)
- # reagent (34)
- # ring-swagger (6)
- # rum (54)
- # specter (3)
- # untangled (14)
- # yada (14)
A new slack community for React Native devs: https://nativedevs.slack.com/shared_invite/MTE3NTA1NzMzNjQ4LTE0ODIwMTYyMTYtNDk5Y2YxMmU3OA
for those non-cljs concerns 🙂
Sweet! It would be nice if it was in Matrix though… Not convinced slack could handle a RN community...
not convinced in the long term viability of slack either personally
but maybe cross that bridge when we get to it kind of thing?
What is it Matrix? 🙂
posted in #clojure but was thinking -- could be neat to impl this type of interface to live edit an app on the ipad with the app itself on the side in iphone-sized window, maybe using suggestions from clojure.spec for local UI like colorpicker for colors or predefining child sexp layouts etc.
i think it can like remove the idea of buffers and you just look up names through namespaces to edit their source and the namespace in which that source is meant to be interpreted is known
@nikki have you seen planck for iOS?
oh, no, it’s called replete
PR are welcome I guess 🙂
the nice thing about running in a runtime that is enriched by React Native and some other things is that you can build UIs in it easily 😮
i'm among the people working on http://getexponent.com and lein new exponent
makes an exponent project 😄
but the whole dev experience is desktop based, but i'm toying with idea of doing it in tablet
@mfikes is author, but pretty much you can hack it https://github.com/mfikes/replete
@savelichalex The protocol that powers Riot
@artemyarulin do u know if replete and planck code is shared
nope, not aware about internals
could be fun to code graphics live on ipad with colorpickers etc. don't u think @artemyarulin 😄
i want to just forget about buffers tho and just edit directly by looking up source from namespace
well I spend 99% time in my emacs so hardly I’m your target audience 🙂 but idea is cool
but yeah target audience is idk -- dj'ing some music live or teaching kids to make fun apps
planning on hacking on similar idea around christmas break so will hit you up if i do something
Hi, i do experience delays with re-natal (reagent) on text inputs. If using plain JS, those lags do not occur. Does anyone have any ideas as to what I might be missing?
@nikki When Replete was developed (mid-2015), we barely had self-hosted ClojureScript running properly, and at the time ClojureScript on React Native was still very new. I specifically decided to avoid mixing two immature things and went with Replete having a fully native UI. But now, more than a year later, I could see a React Native REPL with a rich UI experience being completely feasible.
@mfikes: nice! I was reading ur blog like planck's eval and stuff, your work / insight into this space is helpful! :)
I think bootstrapping in a sense of the editor UI be codeable from itself would be so nice
@mfikes: one of the things i did recently was expose opengl to javascriptcore in a webgl-like api that works on android and ios (just uses jsc c api directly with crossplatform cpp) but in a non-browser jsc (so no jit for now :( ) and want to see if i can make a playground env for it sort of ... https://getexponent.com/@community/gl-test you can try it out and https://github.com/exponentjs/gl-test is the code
It runs in the same js env as where the react native ui happens, and so u can use react native to make gui stuff over the gfx, had some folks try making games on it and people ended up doing that for menus a lot -- with clj's nice paradigm for reacty uis could be neat
Ahh. @nikki perhaps the Ejecta stuff here could be inspiration or maybe you are doing some similar stuff: https://youtu.be/ByNs9TG30E8?t=2143
I actually borrow ejecta's typedarray conversion hack haha, a lot of exponent's gl thing owes itself to looking at ejecta's code
Luckily the hack isnt needed in latest jsc which is in ios10, you can get direct access to typedarray's underlying buffer
Yeah u still want to probs memcpy out or GC pin it if ur gonna access the data later tho 😮
It might be this: https://github.com/swannodette/ejecta-cljs-template
I want to see if i can write the rasterizer itself in glsl with raymarching style rendering
Raymarching style rendering sort of allows u to use manifold transforms to construct scenes: you can do crazy operations like twisting and subtracting objects from other objects but its written down as the actual algebra of those ops
http://iquilezles.org/www/articles/distfunctions/distfunctions.htm is probs a better concrete set of examples
@mfikes: im still new to clojurescript and learning -- do u think living clojure is pretty good you've said nice thingd
@rukor it is an issue with every RN wrapper.
I workaround it (in rum
) by wrapping input with a stateful component, which passes :defaultValue
to input on every value change, instead of using :value
.
The other workaround I heard of here – is to interop with js.
@misha thanks. I worked around it by using the react’s local state in a controlled way for the wrapper ‘form’, and doing some js interop. thanks again
@rukor mind share it here as a code snippet?
you are, like 3rd person with input lag with reagent
issue here in 5 weeks or so
(defn basic-form [props & _]
(let [ref (cljs.core/atom nil)
init-state (fn [r]
(reset! ref r)
(when r
(.setState r #js{:__formstate (:init props)})))
get-state (fn []
(when-let [r @ref]
(when-let [s (.-state r)]
(.-__formstate s))))
set-state (fn [v]
(when-let [r @ref]
(.setState r #js{:__formstate v})))
set-field-value (fn [k]
(fn [v]
(let [current (get-state)
new-value (if (vector? k)
(assoc-in current k v)
(assoc current k v))]
(set-state new-value)
(when-let [f (:on-field-change props)]
(f k v)))))
get-field-value (fn [k]
(when-let [state (get-state)]
(if (vector? k)
(get-in state k)
(get state k))))
do-submit (fn []
(when-let [f (:on-submit props)]
(f (get-state))))
]
(r/create-class
{:display-name "basic-form"
:component-will-mount
#(this-as this (init-state this))
:reagent-render
(fn [props & children]
[apply vector rn/view
(dissoc props :init :on-field-change)
(for [child children :let [[component child-props & vs] child]]
(cond
(= component field)
(apply vector component
(assoc child-props :value (get-field-value (:key child-props))
:on-change (set-field-value (:key child-props)))
vs)
(= component submit-button)
(apply vector component
(assoc child-props :on-press do-submit)
vs)
:else
child))])})))
where field & submit-button are components that just render text-input & button respectively
(defn a-form []
(let [init {}]
(fn []
[basic-form {:init init
:style {:padding 15}
:on-field-change (fn [k v] (log/debug "field" k "=" v))
:on-submit (fn [v] (log/debug "submitting: " v))}
[field {:type :text :key :name :label "Name"}]
[field {:type :switch :key [:details :crazy] :label "Crazy?"}]
[submit-button {:label "OK"}]
])))
@ruko, I had the react-native input lag issue with reagent too