Skip to content

feat: Vite SSG Optimized (Thread Workers) #457

Draft
reinaldomendes wants to merge 125 commits intoantfu-collective:mainfrom
reinaldomendes:main
Draft

feat: Vite SSG Optimized (Thread Workers) #457
reinaldomendes wants to merge 125 commits intoantfu-collective:mainfrom
reinaldomendes:main

Conversation

@reinaldomendes
Copy link
Copy Markdown

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

… --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
… HydrationMode when data-server-rendered is found on browser
…ions into separated process. Saves memory"

This reverts commit b8a1fcb.
…ed html comments to avoid search engine reads by mistake
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant