Open dimaMachina opened 2 weeks ago
To start a discussion: What if Nextra really focused in on its core value props, removing everything out of core that causes maintenance burden?
I've built a site for Triplex using Nextra@2 and I've found I've been fighting against Nextra more than working with it. The main parts of Nextra that I've found valuable are:
I would include Search in there but unfortunately there isn't an easy way to replace the UI with something bespoke, so I had to re-implement it. Layouts aren't there yet but would be a natural fit when moving to the app router! So rather than having a single inflection point with every layout decision in a single file (app.tsx), or defining something custom (meta.tsx) it would just be native layout routes via app router.
With a new major version and a focus on app router there's an opportunity to really focus in on what core should be. My take is if Nextra focused on the plumbing/infra, MDX/Meta/Search/Layouts (powered by app router), pushing everything UI related outside of core it would reduce the maintenance cost and then let folks who want complete ownership of the UI layer build up from a solid foundation.
Focusing on that minimal surface area, and then really narrowing in on an expressive API that remain fast for great local dev would be fantastic IMO.
removing everything out of core that causes maintenance burden?
what do you mean to remove?
I would include Search in there but unfortunately there isn't an easy way to replace the UI with something bespoke
you can use any Search with nextra-theme-docs
by providing it in navbar.search
https://nextra.site/docs/docs-theme/theme-configuration#search
With a new major version and a focus on app router there's an opportunity to really focus in on what core should be.
this is already possible with Nextra 4 prerelease https://github.com/shuding/nextra/issues/2600
Your suggestions are more applicable to Nextra 4 and not Nextra 5, I would suggest first trying it as I described in https://github.com/shuding/nextra/issues/2600#issuecomment-2385107206
what do you mean to remove?
That the core of Nextra is MDX + meta + search systems to collect information about all the fs routes/content available, everything else is extra that folks would ideally opt in to instead of opt out of to keep bundle sizes lean. This would have the added benefit for maintainers in focusing on what is community or core driven.
YMMV if most folks use Nextra as-is with themes then I might be in the minority, but if all Nextra was just MDX + meta + search, no UI, while ensuring a great local DX for fast HMR with MDX/meta, it'd be all I need to productively build and ship.
you can use any Search with nextra-theme-docs by providing it in navbar.search
Exactly. I don't want to use any pre-built Nextra theme, desiring full control, so I've written my own. One friction point of that is search isn't apart of core but only in the docs theme. My take is: it belongs in core just as the meta infra does.
this is already possible with Nextra 4 prerelease
Ah fair enough, thanks! My comments might have been better placed there then TBH apologies :-). I'll start using it and comment with feedback.
Exactly. I don't want to use any pre-built Nextra theme, desiring full control, so I've written my own. One friction point of that is search isn't apart of core but only in the docs theme. My take is: it belongs in core just as the meta infra does.
btw Search in v4 is removed from core and replaced by Pagefind which indexes remote content as well
memo
,useCallback
,useMemo
andforwardRef
,useContext
,Context.Provider