Frontend Performance improvements
Highlights
- Smaller frontend payload
- Use a better library for the search engine, rewrote the UI with preact
- Dropped jQuery entirely
- Removed the inline code blocks feature, drastically reduced the CSS complexity.
- Changed the code highlight theme
- Upgrade highlight.js to 9.15.10
- Fix a small bug in the Vanilla JS side navigation
Performance improvements
The typical Daux page went from 333K to 96.7K. How did we do it ? Let's look at the details.
- Lazy load the
highlight.js
library (~158K) - Lazy load the search index (~30K in Daux's documentation)
- We removed jQuery entirely, replaced with vanilla JavaScript, even in search (~32K)
- Replaced the Twitter button/iframe with a built in solution, which has the added benefit of more privacy (~20K)
Added to that, we now do the highlight.js
rendering on the server side, so if you use fenced code blocks with the language specified in your documentation, we won't load highlight.js
at all.