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
It is very common for a user to define a new state/prop value with strings concatenated with some other expression. For example, in React/JS - we would typically use template literals to do the following:
<divmyProp={`Hello ${myStateVariable}!`}/>
To achieve the same result in Reka right now, we would have to use a combination of BinaryExpression and Literal which is quite verbose and awkward:
This also makes it difficult when building UI abstractions - for example, building an text field where the user could type in a string and include a variable in the input, like what typically exists in most page editors. For example, here is a screenshot of an input field in Retool:
If we were to build a UI like in the image above with what we have currently, it would be quite difficult to represent a sequence of BinaryExpression, Identifier and Literal into a nice string representation like in the image above.
We could potentially solve this by introducing a new String type that would basically achieve the same functionality as a TemplateLiteral in JS:
This will then allow us to easily stringify the above node into something like "Hello {{myStateVariable}}!". Additionally, this would also reduce the overall size of the AST.
The text was updated successfully, but these errors were encountered:
It is very common for a user to define a new state/prop value with strings concatenated with some other expression. For example, in React/JS - we would typically use template literals to do the following:
To achieve the same result in Reka right now, we would have to use a combination of
BinaryExpression
andLiteral
which is quite verbose and awkward:This also makes it difficult when building UI abstractions - for example, building an text field where the user could type in a string and include a variable in the input, like what typically exists in most page editors. For example, here is a screenshot of an input field in Retool:
If we were to build a UI like in the image above with what we have currently, it would be quite difficult to represent a sequence of
BinaryExpression
,Identifier
andLiteral
into a nice string representation like in the image above.We could potentially solve this by introducing a new
String
type that would basically achieve the same functionality as aTemplateLiteral
in JS:This will then allow us to easily stringify the above node into something like
"Hello {{myStateVariable}}!"
. Additionally, this would also reduce the overall size of the AST.The text was updated successfully, but these errors were encountered: