This PR attempts to shave more bytes off the template code by removing or replacing the quotes, along with removing the spacing between them when it's next to a quoted attribute value.
The code would eagerly use single quotes when it can't remove the quotes entirely, this is mostly because the template literals would usually be converted into regular string by the transformer/minifier, where they would normally be double quotes. I think by doing this, gzip compression would atleast see that there are more repetitions with (", but that's something that has yet to be tested.
The one thing I haven't done here is to adjust escapeHTML code, as it still assumes that it's being wrapped in a double quote. I wasn't sure how to deal with it, so I just kept it as is but it'd definitely have to be changed I think.
Alternatively we could just drop the code relating to switching between double and single quotes for now.
This PR attempts to shave more bytes off the template code by removing or replacing the quotes, along with removing the spacing between them when it's next to a quoted attribute value.
The code would eagerly use single quotes when it can't remove the quotes entirely, this is mostly because the template literals would usually be converted into regular string by the transformer/minifier, where they would normally be double quotes. I think by doing this, gzip compression would atleast see that there are more repetitions with
("
, but that's something that has yet to be tested.The one thing I haven't done here is to adjust
escapeHTML
code, as it still assumes that it's being wrapped in a double quote. I wasn't sure how to deal with it, so I just kept it as is but it'd definitely have to be changed I think.Alternatively we could just drop the code relating to switching between double and single quotes for now.