shuding / nextra

Simple, powerful and flexible site generation framework with everything you love from Next.js.
https://nextra.site
MIT License
11.7k stars 1.27k forks source link

Nextra 5 #3316

Open dimaMachina opened 2 weeks ago

dimaMachina commented 2 weeks ago
itsdouges commented 1 week 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.

dimaMachina commented 1 week ago

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

itsdouges commented 1 week ago

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.

dimaMachina commented 1 week ago

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