feat: Vite SSG Optimized (Thread Workers) #457
Draft
reinaldomendes wants to merge 125 commits intoantfu-collective:mainfrom
Draft
feat: Vite SSG Optimized (Thread Workers) #457reinaldomendes wants to merge 125 commits intoantfu-collective:mainfrom
reinaldomendes wants to merge 125 commits intoantfu-collective:mainfrom
Conversation
… --skip-build param to reuse last server and client builds(usefull for debugging)
…o work with string, is 7.2 times faster than JSDOM
…ring substitute version but stil faster then JSDOM), some performance optimizations includes only inject html code once instead of using replace and JSDOM
…adding more tests
… HydrationMode when data-server-rendered is found on browser
…e whitespaces due breaks hydration
…o separated process. Saves memory
…ions into separated process. Saves memory" This reverts commit b8a1fcb.
…fore call onFinish
…ed html comments to avoid search engine reads by mistake
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Thank you for contributing!
Description
The original implementation have problems with performance when it rendering many routes.
I did a set of improvements to attend my necessities.
Replaced @unhead/dom by @unhead/ssr
Used a custom injectInHtml using html5Parser instead of jsdom with is faster
Added worker threads to avoid locking main event loop
Avoid grow the number of tasks in queue when we have many routes
Added teleport support, the original vite-ssg don't writes teleports to the final file causing SSR mismatches
Detect if is in isHydrationMode by quering [data-server-rendered] on client
Creates SSRApp or App accord with environment and hydration