3 ms·
Count me in! Introducing multiline string comments to ES6 (python syntax) would have been a better option. """ <div> <p> {{ hello_world }} </p </div> """
by crudbug 11y ago
Count me in!
Introducing multiline string comments to ES6 (python syntax) would have been a better option.
"""
<div>
<p> {{ hello_world }} </p
</div>
"""
- grayrest 11y agoYou're in luck. ES6 introduces quasi-literals which are multi-line and will do exactly what you want. You can even tag them to set up parsing. jsx`<div><p>${hello_world}</p></div>` I don't know why it'd be a better option. You're moving the time/cost of parsing client side and preventing minification. If you're going to do a build time parse, I don't understand what the extra quoting buys you.
- egeozcan 11y agoIt could have the benefit of not breaking other "X-to-JavaScript" transpilers as it is just a string.
- insin 11y agoRelevant: "Why Not Template Literals?" on the JSX specification site: http://facebook.github.io/jsx/#why-not-template-literals http://facebook.github.io/jsx/#why-not-template-literals