Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nextra 5 #3316

Open
5 tasks
dimaMachina opened this issue Sep 28, 2024 · 8 comments
Open
5 tasks

Nextra 5 #3316

dimaMachina opened this issue Sep 28, 2024 · 8 comments
Labels
enhancement New feature or request

Comments

@dimaMachina
Copy link
Collaborator

dimaMachina commented Sep 28, 2024

  • optional use mdxjs-rs parser
  • set minimal React version for 19
  • set minimal Node.js version to 20
  • update TailwindCSS to v4
  • remove all usages of memo, useCallback, useMemo and forwardRef, useContext, Context.Provider
@dimaMachina dimaMachina added the enhancement New feature or request label Sep 28, 2024
@dimaMachina dimaMachina pinned this issue Sep 28, 2024
@itsdouges
Copy link

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:

  • MDX
  • Meta

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
Copy link
Collaborator Author

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 #2600


Your suggestions are more applicable to Nextra 4 and not Nextra 5, I would suggest first trying it as I described in #2600 (comment)

@itsdouges
Copy link

itsdouges commented Oct 9, 2024

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
Copy link
Collaborator Author

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

@eliot-akira
Copy link

remove all usages of memo, useCallback, useMemo and forwardRef, useContext, Context.Provider

Just curious if these are being replaced by something better, I'd love to learn about it. Maybe React Compiler will handle memoization, but context?

@dimaMachina
Copy link
Collaborator Author

Just curious if these are being replaced by something better, I'd love to learn about it. Maybe React Compiler will handle memoization, but context?

I meant to replace useContext with use hook 😄

@eliot-akira
Copy link

I see, looking forward to following the progress on Nextra 4 & 5. Thanks!

@dimaMachina
Copy link
Collaborator Author

Stay tuned! The blog post about Nextra 4 is now finished and will be published later this week. 😜

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants