Title
#linking-together
Daniel Garcia

Daniel Garcia

06/10/2019, 7:02 AM
Adding to @yoz earlier point, here is a full video of SwiftUI, it looks quite impressive https://developer.apple.com/videos/play/wwdc2019/204/
s

SĂ©bastien

06/10/2019, 4:21 PM
It's good to hear that that UI programming is hard, and has similarities with concurrent/distributed programming (~27min in the talk)
d

Daniel Hines

06/10/2019, 6:15 PM
I like the bidirectional visual editor <-> code editing. How is this fundamentally different than React though? I get React has its issues as a scheduler, but wherever I don’t need extreme performance, it works really well for declarative views.
y

yoz

06/10/2019, 6:24 PM
@Daniel Hines See my original thread ( https://futureofcoding.slack.com/archives/C5U3SEW6A/p1559604803017700 ). What editing tools exist that let you select a rendered React component and jump straight to the instantiation code?
d

Daniel Hines

06/10/2019, 6:31 PM
Thanks @yoz. This shouldn’t be impossible in React, right? Decorate components with metadata and such.
y

yoz

06/10/2019, 6:32 PM
Right, yet which tools actually do that? Who’s prioritised this usage?
6:33 PM
Also note that in React, anonymous components are trivial and often end up being preferred by some, which can end up making the work harder. (But only if you actually need a name for the component, as opposed to just jumping to the code.)
d

Daniel Hines

06/10/2019, 6:35 PM
I think this bidirectional programming stuff has a lot of potential.
6:36 PM
But yeah - it does seem like just a huge oversight that we don’t have this everywhere. As soon as you see it it’s obvious.
s

SĂ©bastien

06/10/2019, 6:53 PM
It's very close to the notion "projective editing", where all the views (visual and textual) are all bidirectionnaly linked to the canonical program model.
f

fyr

06/10/2019, 7:05 PM
What editing tools exist that let you select a rendered React component and jump straight to the instantiation code?
The closest I can think is "Inspect"ing an element from React DevTools to select it in the DOM tree, and then picking "Show Component Source" out of its right-click - but that's not like, the instantiation for that particular usage
robenkleene

robenkleene

06/10/2019, 7:34 PM
I think Framer Playground supports some of bi-directional functionality? I've seen older Framer demos where editing the preview, e.g., changing the color and position in objects, automatically updates the source code https://www.framer.com/blog/posts/introducing-framer-playground/
d

Daniel Hines

06/10/2019, 7:35 PM
Granted, the editor is slick, but why is everyone clapping for all the “SwiftUI eliminates complexity by letting you declare views”. Isn’t this just standard React? Especially if you’re using a single state atom a la Redux/Om Next/Re-frame
7:36 PM
I think we should have the bidirectional editing stuff and think this is a great step, but as for the rest, it seems we’ve doing this with Clojure+React+Figwheel for a long time.
robenkleene

robenkleene

06/10/2019, 7:38 PM
Outside of the bidirectional editing, I'm not aware of anything that's really new in SwiftUI. It's just another major platform going in the direction of declarative views/programming.
7:38 PM
I.e., following in Reacts footsteps
d

Daniel Hines

06/10/2019, 7:38 PM
Ok. I just wanted to make sure I wasn’t missing something big.
7:39 PM
Don’t want to deemphasize how cool this is, rather emphasize that it’s the BX that makes it cool, not the view composition stuff.
robenkleene

robenkleene

06/10/2019, 7:41 PM
And even with the bidirectional editing, I think Framer could do it first with React
y

yoz

06/10/2019, 8:09 PM
@robenkleene Framer looks very cool, but I’d say that it’s cheating (in good & bad ways): AFAICT, components and their source files have to be explicitly declared in a Framer project. From what I can see, Framer can’t take an existing React app and just import all its components without help. (It’s possible that Framer Bridge does a lot of this, but I’m having trouble finding useful docs on this topic.)
8:12 PM
So, Framer already has its own metadata about what component is being instantiated where. So it’s “cheating” in that it doesn’t need to jump through the hoops that a more general tool (e.g. browser dev tools) would, but I think that’s also a powerful argument for using Framer X as long as you can easily migrate your project to it.
robenkleene

robenkleene

06/10/2019, 10:15 PM
Got it yeah, that's definitely a pretty big limitation. I suspect with the SwiftUI bidirectional editing, in practice it will also be really hard to get working unless you plan for it from the beginning. But I also don't think it involves explicitly declaring anything, so it's definitely an improvement.
Daniel Garcia

Daniel Garcia

06/10/2019, 10:35 PM
yeah @Daniel Hines it has a lot of stuff similar to react. What I thought it was impressive is the projectional editing capabilities, including dropping functions in the view to update the code, also the testing part it’s one of my favorite things