-
-
Notifications
You must be signed in to change notification settings - Fork 223
Open
Labels
Description
Is your feature request related to a problem? Please describe.
svelte2tsx transformation is triggered on every document change / on every key stroke. This may be imperformant. Also, since it relies on the svelte parser, it will not return anything in error states.
Describe the solution you'd like
In case of addition/deletion of a single character, try some kind of update to the transformed code instead. This could improve the performance and also prevent some error states.
Logic could be the following:
- Inside style tags, use the old version and adjust offset afterwards, because style tags will never alter the output (they are blanked out)
- Inside script tags, try to add it at the correct position. Do a complete reparse in case of characters that might need special treatment, like
exportor$ - Template: If it's a new tag getting added
<b.., try to add it, else reparse - in error state, always reparse
Problems:
- source mapping
Describe alternatives you've considered
Wait on more robust/error forgiving and incremental svelte compiler.
jasonlyu123, shirakaba, milahu and mekwall