Closed eight04 closed 2 years ago
After changing the regex, I found that some tests failed:
https://github.com/Elderjs/elderjs/blob/bf528f1a20da10586467ce6c891d5bf3eafe3c79/src/partialHydration/__tests__/mountComponentsInHtml.spec.ts#L36-L41
It this a valid use case? While debugging the server, I saw data like "
were encoded into "e;
to produce valid HTML. But the test file doesn't seem to quote them. It is not valid svelte syntax either.
https://github.com/Elderjs/elderjs/blob/bf528f1a20da10586467ce6c891d5bf3eafe3c79/src/partialHydration/mountComponentsInHtml.ts#L17 This runs forever when:
<\/\1>
doesn't match.This happens naturally when there is another tag stick with ejs component. Here is an example:
p><div
.</p><div>
can't match</div>
in the file.[^]*?
expand down to the entire file.[^]*?
down to the entire file...I think it will be better to write it as:
Ensure that:
After the fix, the build time reduces from 5 minutes to 9 seconds.