Readit News logoReadit News
rheeseyb commented on Utopia, a visual design tool for React, with code as the source of truth   utopia.app/... · Posted by u/rheeseyb
imvetri · 4 years ago
How does it detect source element when hovered on preview?

Preview would have a dynamic ID that maps to the source JSX.

rheeseyb · 4 years ago
At the very high level, yeah that's pretty much what's happening. We generate IDs that we map to each of the elements statically and that we inject into the DOM so that we can capture metadata about the element. We're currently writing an in-depth explanation of how this all works, which will be uploaded on our blog in the very near future.
rheeseyb commented on Utopia, a visual design tool for React, with code as the source of truth   utopia.app/... · Posted by u/rheeseyb
kyawzazaw · 4 years ago
I am student and I think my instructors who teach a Software Engineering class would be very very interested. We typically have non-CS majors in that class and it can be a bit of a learning curve.
rheeseyb · 4 years ago
Helping people learn to code is something that we're very keen to achieve with Utopia.
rheeseyb commented on Utopia, a visual design tool for React, with code as the source of truth   utopia.app/... · Posted by u/rheeseyb
throwaway-42808 · 4 years ago
Probably Bret Victor - "Inventing on Principle" (2012) - https://www.youtube.com/watch?v=PUv66718DII
rheeseyb · 4 years ago
Bret Victor is our idol! I didn't even have to click the video to know exactly which one you were talking about :)
rheeseyb commented on Utopia, a visual design tool for React, with code as the source of truth   utopia.app/... · Posted by u/rheeseyb
da39a3ee · 4 years ago
The page is completely broken for me with most links failing due to certificate errors:

  Failed to load resource: net::ERR_CERT_INVALID 4b99d2cfb81c64aed531.css:1
  Failed to load resource: net::ERR_CERT_INVALID cdn.utopia.app/_next/static/chunks/webpack-50bee04d1dc61f8adf5b.js:1
etc

Same in Chrome and Safari

rheeseyb · 4 years ago
Is this still the case for you? I don't believe we've seen this issue from anyone else, so I'm wondering if it was a blip or something more insidious
rheeseyb commented on Utopia, a visual design tool for React, with code as the source of truth   utopia.app/... · Posted by u/rheeseyb
scotty79 · 4 years ago
I think tools like Dreamweaver and FrontPage ultimately failed due to many factors. By respecting the existing code you address one.

Other is that CSS can be shared between unrelated elements and cascading. FP and Dw worked pretty well for HTML where the looks of the elements were determined by their properties. Once CSS showed up they tried to adjust by encoding same things in inline styles of the elements. There was some support for css classes but it wasn't first class. You couldn't easily click to make a group of visual properties a style, name it (or choose a selector for it) and use it in other element somewhere on the page. The css classes are one thing, the other is 'cascading'. You couldn't do that conveniently either. So the moment you wanted to use the actual innovation that css brought to the table you had to pretty much drop into code and rarely ever come back to gui, which made visual part of FP and Dw obsolete.

And since you are dropping into editor you might want to drop into your favorite one where you have your own file tree, plugins and such. I think Utopia would make more sense if it could be run as a VSCode plugin.

To try to avoid that fate I think Utopia might consider some way of extracting those sliders on the right hand of UI out of specific component and into a shared group of styles. If you were working with CSS instead of css in js react-style the best idea would be to just mirror what css has, like named classes and complex selectors. And when you click a component you should let edit both inline component style and all the selectors that apply to it. It should basically mirror Chrome CSS inspector but in visual form with sliders and friendly names and other stuff. Since you are using React it would be best to mirror what React developers use to share styles between components. Some commentators here mentioned some libraries and solutions for sharing styles between components in React. But it doesn't look in Utopia it is as essential for survival since in React sharing styles by sharing whole components is a valid approach.

The other thing that made me abandon FP and Dw was that my HTML was generated server-side with a lot of PHP and parts of it kept in multiple files. You neatly address this using React and keeping it alive enough to populate the page you edit with state. React also enables composition of the page from components that can be edited separately which neatly resolves the issue of web page being spread over multiple files. I see that Utopia deals with editing components that include other component from different files neatly and it could be used flexibly to edit all the components however small and large and complex they are.

Other than that visual tools like that are great, both for people learning web development and people doing their work. I hope that Utopia thanks to your effort and power of React and its ecosystem will eventually becomes the standard way how people begin React project. Sort of like visual form of create-react-app.

rheeseyb · 4 years ago
Thank you for taking the time to write this!

Wrt the VS Code plugin, it was an idea we were toying with. Ultimately we decided to go with a standalone editor because we didn't want to limit our market and run the risks involved with coupling our existence to them. That being said, a VS Code plugin is absolutely in our future and something we would want.

You're absolutely right that by targeting React we are mitigating some of those issues you've mentioned, but they are still issues that we still need to address, so we do need to adjust or introduce further tooling. All of these things are on our roadmap, but we're a small team so it's a case of prioritising, which is where comments like this come in to play as they help us add weight to those priorities.

We've got a long way to go, but thoughtful and constructive comments like these help us immensely along the way :)

rheeseyb commented on Utopia, a visual design tool for React, with code as the source of truth   utopia.app/... · Posted by u/rheeseyb
rho4 · 4 years ago
As a kid (and adult) you need to see some immediate tangible result of your virtual labor.
rheeseyb · 4 years ago
That's absolutely true for sure, and I'd go so far as to argue that it's one of (if not the) primary driving forces behind development tooling decisions. Whereas some changes are well suited to e.g. unit testing (and where a passing suite of tests provides that instant feedback), when working on the design or interactions of an interface it's very important to actually "see" and/or play with the result of each minor tweak, so the faster you can make that loop the more pleasurable the development experience will be.
rheeseyb commented on Utopia, a visual design tool for React, with code as the source of truth   utopia.app/... · Posted by u/rheeseyb
lstamour · 4 years ago
Slight correction, though it’s too late to edit: I meant to say at the end, “it’s unclear if Utopia will follow the same standards and patterns that production code demands,”
rheeseyb · 4 years ago
That's exactly our aim - if making a change via the canvas or inspector doesn't result in production grade code then the tool is failing in our eyes. We're well aware that there are parts where we're not hitting the mark there (effectively we're in an alpha stage here), but we're working hard to improve that.
rheeseyb commented on Utopia, a visual design tool for React, with code as the source of truth   utopia.app/... · Posted by u/rheeseyb
supermatt · 4 years ago
Looks nice!

It seems that any "logic" (conditionals, iterators, etc) in the components will prevent the component (and their children) from being inspectable.

Is the intent to keep it "no-code" in this respect (i.e. effectively a visual JSX editor), or will you be adding the ability to inspect more "dynamic" components to make it useful for app development?

rheeseyb · 4 years ago
Our goal isn't a no-code tool, but rather an editor that provides the tools for both developers and designers. We're iteratively improving the level of complexity of code that we can fully parse and expose to the rest of the editor, so you can expect these kinds of cases to become fewer and far between over time.

If you do have specific cases that you come across and are interested in following the development or just want to let us know of them, please do file an issue on our GitHub repo.

rheeseyb commented on Utopia, a visual design tool for React, with code as the source of truth   utopia.app/... · Posted by u/rheeseyb
raidicy · 4 years ago
As soon as I resize the code menu this[0] happens. Everything shifts up and I cannot scroll it down or get it back to normal without refreshing.

[0]https://imgur.com/a/N82Zutz

rheeseyb · 4 years ago
Hmmm that's incredibly frustrating. I'm trying to reproduce this but failing. Are you able to do this every time? If so is there any chance you could take a screen recording please to help us debug it?

u/rheeseyb

KarmaCake day404September 8, 2011View Original