Closed kenchris closed 6 years ago
Hmm, in some sense it's neat to tie this into the same syntax as JS.
On the other hand, this isn't actually the same thing at all. It isn't JavaScript (it's JSON), it isn't the template literal syntax (it doesn't use backticks), and the body of those braces is not allowed to be an arbitrary JavaScript expression, just one of a handful of special names. It might be confusing to use that syntax.
We chose bare braces because they were the simplest syntax that is unambiguous (since braces are completely forbidden in URLs, they unambiguously represent a template parameter). I'm hesitant to change this to match the JS template literal syntax.
Ok, makes sense
Why not change
"/share?title={title}&text={text}&url={url}"
into
"/share?title=${title}&text=${text}&url=${url}"
Now they refer to properties on a JS object (JSON)?