[JavaScript] Fix nested template strings #4318
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Resolves #4220
This PR...
introduces JavaScript (Plain), TypeScript (Plain), JSX (Plain) and TSX (Plain) without syntax highlighted template strings as possible base syntax for template languages which don't need them or would fail loading due to complexity otherwise.
replaces
embed
directives byset
and includes all syntaxes used for highlighting template strings, to prevent them being prematurely terminated by interpolations with nested template strings.Nested template strings don't highlight any syntax to keep syntax cache size in sane limits.
Note:
Compiled syntax cache of each language grows from about 170kB to 1.2MB also causing all template languages which make use of it to grow. I didn't hit any limits yet and Python is also 2.5MB now with new SQL syntax being included a couple of times. The overall size of all compiled languages together grows from 4.2MB to 5.4MB, only. So maybe it is safe enough for production.