Static HTML + Full React DOM - Is this expected #11184
Replies: 1 comment 5 replies
-
Docusaurus Faster initiative but somehow I am puzzled if I might be doing something wrong or it might be better to change my approach. The more pages you have, the more time it takes: that's something common with all static site generators. Static site generators based on frontend framework/routing offer a nice modern navigation experience, but are also usually slower to build per page than pure server-only static site generators. Why don't you try Docusaurus Faster? With recent improvements, I've seen large sites building 3-4x times faster recently. If you don't share more details (number of input docs, build times etc) it's hard to tell if there's a problem or if it's expected.
It's unclear if you speak of input files (not under our control) or output files (in
This is how React SSR/SSG historically works, and Docusaurus is not doing anything different from any other React SSR/SSG framework:
Yes, you'll see exactly the same using Next.js, Remix, Gatsby
There are many reasons for that:
You didn't trigger it, it has always been like that
Thanks, and I'm sure you'll find recent improvements will make your site build much faster. Before rethinking anything, maybe try to use Docusaurus Faster.
Use Docusaurus Faster Use this env variable to print more "performance-related logs" and see which step takes time. export DOCUSAURUS_PERF_LOGGER=true Related, but regarding the "duplication" of html/js content. This only affects the initial page load, not subsequent navigation. It's a React problem, not Docusaurus. React needs the JS code to hydrate to the existing HTML page (which as we have seen, should rather be pre-rendered). Many other frameworks work like that (apart Qwik, which is quite different). I think in the future, supporting React Server Components in Docusaurus. As of today, I think the duplication is still there, but you'll still be able to have much lighter JS files. There's various feedback online about improvements, for example: https://www.mux.com/blog/the-building-blocks-of-great-docs It will take a while before we support RSCs, but I plan to start working on it as soon as v4 is out. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I lately started to auto-generate many docs from my TS Docs into MarkDown pages for people to use.
As you might expect this quickly bloated my page and compilation times spiked. I am aware of the Docusaurus Faster initiative but somehow I am puzzled if I might be doing something wrong or it might be better to change my approach.
I was shocked to see how the file count of my website exploded and I noticed a wierd thing:
assets.js
output containing the "react component" flavor of my pages (likely for https://docusaurus.io/docs/markdown-features/react#importing-markdown?).Is this really the expected behavior? For the dynamic components of the pages (like Tabs), React is anyhow needed. Then why I should pre-render the pages to HTML at all? Sure, pages might render a bit faster as the initial DOM is available, but considering the duplication it might be better to just go for a "compiled React SPA website" and accept a bit more initial render time than having a heavyweight HTML per page which anyhow needs to use react afterwards.
At this point I think I just might have messed up my website somehow to trigger this behavior.
npm i && npm run generate-alphatabdoc && npm run build && npm run serve
I still love Docusaurus and would like keep using it. But if that's the expected behavior I have to rethink how I manage my generated reference docs.
Any feedback is welcome on how I could troubleshoot this 😁
Beta Was this translation helpful? Give feedback.
All reactions