Closed lubieowoce closed 1 week ago
This is a good point! There are lots of little details of why I think Tree Notation (or someone else's similarly minimal notation) would be the best solution for this.
One main reason is that you never need to escape anything (just indent blocks). For instance, let's say the form is for filing a bug report and has a textarea for including source code. Perhaps the form is:
Name [Mary]
SourceCode
[ print "Hello"
print "World" ]
This could serialize to Tree Notation as:
Name Mary
SourceCode
print "Hello"
print "World"
While JSON would require lots of escaping into something like this:
{
"Name": "Mary",
"SourceCode": [
"print": "\"Hello\"\n",
"print": "\"World\""
]
}
Thinking about it more, it seems the best approach would probably to allow the serialization to/from any format when possible as you suggested. I think Tree Notation would work best for most cases, for little detail reasons like the one above, but we could make a toggle or something to add support for other formats as well.
After many years, we are very close to having CopyPaster functionality easy to use!!!!
I'm thinking in a very short time, we will ship this in Scroll.
Here's the new issue to track https://github.com/breck7/scroll/issues/133
making forms copy-pastable is a neat idea! but i feel like the same benefits could be achieved by simply making web forms serializable to any suitable format of choice, preferably a human-readable/editable one. i think this proposal would benefit from clarifying the unique advantages of using tree notation vs, say, JSON + a schema.