state-of-js-graphql-results-api icon indicating copy to clipboard operation
state-of-js-graphql-results-api copied to clipboard

Unify interpolation delimiters

Open lex111 opened this issue 5 years ago • 3 comments

This is related to https://github.com/StateOfJS/state-of-js-graphql-results-api/pull/78

Unfortunately, the "Leave an issue" link on the JS survey does not actually work now.

So I think we need to go back to interpolation delimiters (without "$") in Vulcan.js style, and for survey results on Gatsby define custom delimiters in the Lodash template in translator.js file, this way interpolation will work the same for both frameworks.

cc @SachaG

lex111 avatar Dec 06 '20 22:12 lex111

Good point! To clarify, we're talking about

  • hello ${name}, how are you today?

vs

  • hello {name}, how are you today?

The first one seems more standard to me since it's already how string interpolation works in JS, so maybe we should keep that?

SachaG avatar Dec 06 '20 23:12 SachaG

It doesn't really matter, I just didn't find a way to define custom delimiters in Vulcan.js, but in Lodash (i.e. Gatsby results app) it's possible.

lex111 avatar Dec 07 '20 06:12 lex111

Oh actually I think you were right, if we use ${} then it becomes a pain to escape the $ when the strings are defined in JavaScript files. Let's change it the other way around then.

SachaG avatar Dec 14 '20 01:12 SachaG