Skip to main content

2 posts tagged with "react-router-config"

View All Tags

· 5 min read
Roger Jiang

As discussed in prior posts, Docusaurus (2.4.0) relies on react-router-config to statically serve up a monolithic route config object, with EVERY ROUTE for the WHOLE site. This gets stuffed down the client on first page load. There's no code splitting - just big fat TBT surpise for the client - not what'd you'd want for a seamless browsing experience. See for yourself, inspect your own docusaurus site's bundle and it's likely bursting at the seams with plaintext routes.

It's the Docusaurus Way or the Highway

The best (and only simple) solution is to USE LESS PAGES, LINKS & TAGS.

· 4 min read
Roger Jiang

A Centralized Pain in the Config

Sadly, Docusaurus 2.4.0 is still stuck in the past - and uses react-router-config - which has pretty much became obsolete since react-router version 4, which released in 2017 (latest version is v6 and docusaurus uses v5).

The end result is that EVERY SITE ROUTE is forced onto the main client bundle, even for the homepage! Maybe you're lucky, and your site only has a few hundred routes with relatively short url paths.

But imagine how this scales for thousands of routes...