When we receive a dynamic value that we cannot analyze statically we need to ensure that it is escaped properly before processing it. This PR adds a new jsxEscape() function from the jsx runtime to support that.
The reason the new transform is fast is because it only concerns itself with concatenating strings together. To make this work efficiently jsxssr expects values to be pre-escaped. This is necessary to make jsxattr performant, otherwise you'd need to allocate the full props object again.
// input
<div>{foo}</div>
// out
jsxssr(tpl, jsxEscape(foo))
When we receive a dynamic value that we cannot analyze statically we need to ensure that it is escaped properly before processing it. This PR adds a new
jsxEscape()
function from the jsx runtime to support that.The reason the new transform is fast is because it only concerns itself with concatenating strings together. To make this work efficiently
jsxssr
expects values to be pre-escaped. This is necessary to makejsxattr
performant, otherwise you'd need to allocate the full props object again.