Adding to <@UFV8P4472> earlier point, here is a fu...
# linking-together
d
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
It's good to hear that that UI programming is hard, and has similarities with concurrent/distributed programming (~27min in the talk)
đź‘Ť 1
d
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
@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
Thanks @yoz. This shouldn’t be impossible in React, right? Decorate components with metadata and such.
y
Right, yet which tools actually do that? Who’s prioritised this usage?
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
I think this bidirectional programming stuff has a lot of potential.
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.
🙌 1
s
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
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
r
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/
🆒 1
đź‘Ť 1
d
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
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.
r
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.
I.e., following in Reacts footsteps
d
Ok. I just wanted to make sure I wasn’t missing something big.
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.
r
And even with the bidirectional editing, I think Framer could do it first with React
đź‘Ť 1
y
@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.)
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.
r
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.
d
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