You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As I began discussing Mesop with friends and colleagues, one thing that has come up is the difficulty of teaching and persuading non-frontend engineers to build UIs, even simple ones. CSS, particularly the rules around layout, can be quite challenging and off-putting.
11
10
12
-
I'm working on a new [visual editor](https://github.com/google/mesop/issues/31) for Mesop that aims to make UI building more approachable for beginners and more productive for experts.
11
+
I've developed a new [visual editor](https://github.com/google/mesop/issues/31) for Mesop that aims to make UI building more approachable for beginners and more productive for experts.
12
+
13
+
## What?
14
+
15
+
Let's take a look at the visual editor:
16
+
17
+

18
+
19
+
With the visual editor, you can:
20
+
21
+
- Add new components into your app
22
+
- Modify existing components
23
+
- Visualize the component tree hierarchy
24
+
- You can inspect existing components on the page by hovering over them and then change them in the editor panel
25
+
-**B**ring **Y**our **O**wn components. By decorating a Python function with `me.component`, you've turned it into a Mesop component and you can now add it with the visual editor.
26
+
27
+
What's exciting about the visual editor is that you aren't locked into it - everytime you change a component with the visual editor, it's modifying the source code directly so you can seamlessly go back forth between a regular text editor and the visual editor to build your Mesop app.
13
28
14
29
## Prior Art
15
30
@@ -25,7 +40,7 @@ One of the reasons why WYSIWYG builders have not gotten much traction with engin
25
40
26
41
To avoid this issue, I'm focusing on making the Visual Editor actually emit __code__ and _not_ just __data__. Essentially, the UI code that you produce from the Visual Editor should be the same as the code that you would write by hand.
27
42
28
-
### Un-obtrustive UI
43
+
### Unobtrustive UI
29
44
30
45
I want Mesop app developers to do most of their work (except for the final finetuning for deployment) in the Visual Editior which means that it's important the Editor UI is un-obtrusive. Chrome DevTools is a great example of a low-key tool that many web developers keep open throughout their development - it's helpful for debugging, but then it's out of your way as you're interacting with the application.
31
46
@@ -36,24 +51,18 @@ Concretely, this means:
36
51
37
52
### Contextual
38
53
39
-
It should be easy to add new components with the Visual Editor and *also* easy to add new components to the Visual Editor's component library.
40
-
41
-
Combining a few ideas from existing products that I see:
54
+
The visual editor should provide only the information that you need when you need it.
42
55
43
-
- Like Jupyter notebooks, you can add a component next to an existing component (you can specify if it's a child, below or above, with the default being below).
44
-
- Like Google Docs and similar products, there's a single command (e.g. "@") that opens a search-able library of components that you can insert. This makes it easy to extend this for more components in the future.
56
+
For example, rather than showing all the style properties in the editor panel, which would be quite overwhelming, we only show the style properties that you're using for the selected component.
45
57
46
58
### Local-only
47
59
48
-
Because the Visual Editor relies on editing files in your local filesystem, I want to avoid any accidental usages out in the wild.
49
-
50
-
Concretely, this means:
51
-
52
-
- Checking that all editor event requests are made from localhost.
53
-
- Logging a clear warning/message when the server starts up that this is in editor mode.
60
+
Because the Visual Editor relies on editing files in your local filesystem, I want to avoid any accidental usages out in the wild. Concretely, this means that you can only use the Visual Editor in localhost, otherwise the Mesop server will reject the editor edit requests.
54
61
55
-
## v0
62
+
## What's next
56
63
57
-
This is a very early glance at what the Visual Editor for Mesop might look like. There's still a lot of changes that need to be done and only half the functionality is working.
64
+
There's still a lot of improvements and polishes I would like to make to the visual editor, but a few high-level ideas that I have are:
58
65
59
-

66
+
1. Build example applications using the visual editor with a video walkthrough.
67
+
1. Create more high-level components in Mesop Labs, which I'll introduce in an upcoming blog post, to make it even easier to build apps with the visual editor.
68
+
1. Drag and drop components onto the page and within the page. This will provide an intuitive experience for building the UI, literally block by block.
0 commit comments