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 3 #1421

Open
16 of 20 tasks
dimaMachina opened this issue Jan 28, 2023 · 32 comments
Open
16 of 20 tasks

Nextra 3 #1421

dimaMachina opened this issue Jan 28, 2023 · 32 comments
Labels
enhancement New feature or request
Milestone

Comments

@dimaMachina
Copy link
Collaborator

dimaMachina commented Jan 28, 2023

below of my thoughts on the next biggest release

the whole nextra should be bundled to ESM only instead of mixing cjs and esm

also this should fix blocked renovate PRs #1136 #1083 which one now ESM only

this should fix the following #1263 and avoid future bugs with redirects of #1354 #1402

@dimaMachina dimaMachina added the enhancement New feature or request label Jan 28, 2023
@dimaMachina dimaMachina pinned this issue Jan 28, 2023
@juliusmarminge
Copy link

You got a rough timeline for this release?

@dimaMachina
Copy link
Collaborator Author

@juliusmarminge nope

@pomber
Copy link

pomber commented Feb 7, 2023

any plans for experimental support for React Server Components? or you'll wait for a stable app directory?

@dimaMachina
Copy link
Collaborator Author

no plans currently

@ecraig12345
Copy link

Whatever features you include, please try to document the breaking changes better. Migrating a simple site from 1 to 2 was a big headache due to the lack of documentation about renamed settings and other changes.

@dimaMachina
Copy link
Collaborator Author

Whatever features you include, please try to document the breaking changes better. Migrating a simple site from 1 to 2 was a big headache due to the lack of documentation about renamed settings and other changes.

Which renamed settings were not documented and other changes?

@ecraig12345
Copy link

Whatever features you include, please try to document the breaking changes better. Migrating a simple site from 1 to 2 was a big headache due to the lack of documentation about renamed settings and other changes.

Which renamed settings were not documented and other changes?

This discussion was the only migration/upgrade guide I could find. It doesn't mention any of the renamed settings (specifically for nextra-theme-docs config in my case), and it's not linked from the changelog or anywhere else that I saw (I found it with search).

Looking again at the nextra-theme-docs changelog, I now see there is an entry for "various theme config options was renamed" (under "patch" which is incorrect for a breaking change), but just linking out to a code file which doesn't mention the old names is not very helpful. There were also some settings like the search and footer where the expected type changed from boolean to object.

The other break I noticed was an nx- prefix was added to class names (some of the code in the site I was upgrading used those), though I'm not sure if those were intended for public use.

The simplest way to make future upgrades easier for your users is to make sure that any breaking changes have a changeset with type "major" (with a detailed description of any breaks) so that they end up in the "Major changes" section of the changelog--that would probably have been enough to help me. But it also doesn't hurt to have a separate upgrade/migration guide, sort of like these ones for Next.js, ESLint, or Fluent UI React (those are much larger tools/libraries, but it shows the general idea).

It might also be worth more explicitly calling out that there were styling changes, with before/after screenshots of a demo site so people can see how their site will change (though this isn't quite as important, since it's automatic and people can see it in local testing). The parts of the v2 styling changes that confused me were the footer moving from the bottom of the main column to the bottom of the page, and the edit link moving from the footer to the right sidebar. When testing, I thought the edit link had disappeared or maybe I was missing a setting to make it show up--but it turns out this was just because my window width was under 1280px (laptop screen with vertical tabs) and the right sidebar isn't shown at that width. A before/after screenshot would have clarified that the link had moved and my screen was too small to see it.

@dimaMachina
Copy link
Collaborator Author

dimaMachina commented Apr 24, 2023

#257 was the only migration/upgrade guide I could find. It doesn't mention any of the renamed settings (specifically for nextra-theme-docs config in my case), and it's not linked from the changelog or anywhere else that I saw (I found it with search).

For theme config options just look at docs page https://nextra.site/docs/docs-theme/theme-configuration
Also, I made setup zod validation of theme config options to avoid typos, also you can use theme.config.tsx file and import DocsThemeConfig type

Looking again at the nextra-theme-docs changelog, I now see there is an entry for "various theme config options was renamed" (under "patch" which is incorrect for a breaking change), but just linking out to a code file which doesn't mention the old names is not very helpful. There were also some settings like the search and footer where the expected type changed from boolean to object.

Not a big deal, the most important thing is that it was released as Major release

The other break I noticed was an nx- prefix was added to class names (some of the code in the site I was upgrading used those), though I'm not sure if those were intended for public use.

it was made to avoid conflicts with the user's tailwind config

The simplest way to make future upgrades easier for your users is to make sure that any breaking changes have a changeset with type "major" (with a detailed description of any breaks) so that they end up in the "Major changes" section of the changelog--that would probably have been enough to help me.

we already use changesets, we had 100 alpha releases and we can't catch everything

But it also doesn't hurt to have a separate upgrade/migration guide, sort of like these ones for Next.js, ESLint, or Fluent UI React (those are much larger tools/libraries, but it shows the general idea).

Unfortunately, Nextra is not a such popular as your mentioned repository where there are 5-10 maintainers and a LOT of contributors, we try to improve it as we can

It might also be worth more explicitly calling out that there were styling changes, with before/after screenshots of a demo site so people can see how their site will change (though this isn't quite as important, since it's automatic and people can see it in local testing). The parts of the v2 styling changes that confused me were the footer moving from the bottom of the main column to the bottom of the page, and the edit link moving from the footer to the right sidebar. When testing, I thought the edit link had disappeared or maybe I was missing a setting to make it show up--but it turns out this was just because my window width was under 1280px (laptop screen with vertical tabs) and the right sidebar isn't shown at that width. A before/after screenshot would have clarified that the link had moved and my screen was too small to see it.

As I mentioned I can't cover everything just feel free to contribute, @shuding already wrote amazing docs for Nextra v2

@dacevedo12
Copy link

Any chance of supporting turbopack in the next major or will nextra wait for a stable release?

#1054

@dimaMachina dimaMachina added this to the 3.0 milestone Sep 6, 2023
@dimaMachina
Copy link
Collaborator Author

@dacevedo12 no chances, pr welcome

@chakhsu
Copy link

chakhsu commented Nov 6, 2023

Thank you very much for this project and I can't wait to use the Nextra 3. https://grpcity.vercel.app/ is the use of the Nextra 3 online example, running very well, thanks again.

@abenhamdine
Copy link
Contributor

abenhamdine commented Nov 9, 2023

Thank you very much for this project and I can't wait to use the Nextra 3. https://grpcity.vercel.app/ is the use of the Nextra 3 online example, running very well, thanks again.

I see that this site has been built with v3 branch https://github.com/chakhsu/grpcity-docs/blob/56e95759c2510d9103892e81dd6e28aeeba54eba/package.json#L21
Did you encounter any bug/gotcha ?

@chakhsu
Copy link

chakhsu commented Nov 16, 2023

Thank you very much for this project and I can't wait to use the Nextra 3. https://grpcity.vercel.app/ is the use of the Nextra 3 online example, running very well, thanks again.

I see that this site has been built with v3 branch https://github.com/chakhsu/grpcity-docs/blob/56e95759c2510d9103892e81dd6e28aeeba54eba/package.json#L21 Did you encounter any bug/gotcha ?

I didn't encounter a bug. I just make sure that the configuration and usage are the same as in the v3 example.

@GraceWalk

This comment was marked as resolved.

@abenhamdine

This comment was marked as resolved.

@GraceWalk

This comment was marked as resolved.

@abenhamdine

This comment was marked as resolved.

@GraceWalk

This comment was marked as resolved.

@dimaMachina
Copy link
Collaborator Author

For anyone wants to try Nextra 3 here is my blog post with all the features and a migration guide from Nextra 2

https://the-guild.dev/blog/nextra-3

@SaadBazaz
Copy link

Been waiting for Nextra 3 for too long <3

However, would really really need appDir support. Bumping up to >= Next 13 does not make sense if we can't use the new router; we're pretty much stuck at Next 13 because 14 doesn't even have the pages dir.

Need this in appDir because I want to build a hybrid site which can have both docs and SaaS. Less maintenance, single repo, shared providers... that's the sweet deal.

@abenhamdine
Copy link
Contributor

However, would really really need appDir support. Bumping up to >= Next 13 does not make sense if we can't use the new router; we're pretty much stuck at Next 13 because 14 doesn't even have the pages dir.

I disagree it does not make sense, pages router is going nowhere and will probably be supported several years by Next.js, given the huge amount of websites using it.

Need this in appDir because I want to build a hybrid site which can have both docs and SaaS. Less maintenance, single repo, shared providers... that's the sweet deal.

You can just set two different folders (a la monorepo).
For example, we have our SaaS in folder /client and the docs in folder /docs
They are different apps, each with its package.json file.

@SaadBazaz
Copy link

SaadBazaz commented Dec 14, 2023

I'm more of a monolith guy :p
I was thinking of having tight knit integration between my docs, and SaaS. That's why was preferring to have just App Router.

app
|_ (docs)
|_ (saas-tool)
|_ layout.tsx

I thought Next was deprecating pages as they moved forward? It's still in the air and I wouldn't risk being on an old architecture for such an awesome library like Nextra which, honestly, has great potential to be the go-to static site maker.

++ Another reason why monolith is so I can get the sweet-sweet routes:
https://myapp.com/docs -> Nextra
https://myapp.com -> SaaS tool
Without having to manage a reverse proxy or anything of the sort.

@SaadBazaz
Copy link

SaadBazaz commented Dec 14, 2023

I think from here onwards, given all the effort put in by the awesome @dimaMachina , a good way forward is:

  1. Make a shittonne of good templates for Nextra 3,
  2. Separate the Nextra Components library and give devs easy access to add more components (Maybe using shadcn/ui or Radix as a base design system would help in that), add components like Editor.js built-in
  3. Put in major effort in appDir migration, and try to make Nextra part of Nextjs mainstream

@dimaMachina
Copy link
Collaborator Author

⚠️ Nextra 3 will not have support for the app router, please move all discussions and ideas related to the app router in according pinned issue #2023

@hariria
Copy link

hariria commented Jan 8, 2024

@dimaMachina any ETA on when we will be able to try this out? Would rather use Nextra 3 than 2 if it's coming out soon. Looks great btw (https://the-guild.dev/blog/nextra-3)

@dimaMachina
Copy link
Collaborator Author

@hariria you can already try v3 alpha version, there is no date when it will be released since I maintain this framework alone

@maciejkwas
Copy link

@SaadBazaz were you successful on getting your setup right? I need exactly same structure but with i18n support, would you like to collab to get some PR maybe on that?

@dimaMachina
Copy link
Collaborator Author

@Genesis3800
Copy link

Hey @dimaMachina lots of love and regards to you for what you've built.
Really excited for Nextra 3.
Do you have a rough timeline right now for when it might be ready for stable release?

@dimaMachina
Copy link
Collaborator Author

Hey @dimaMachina lots of love and regards to you for what you've built. Really excited for Nextra 3. Do you have a rough timeline right now for when it might be ready for stable release?

Thank you 🙌.
The stable release will be released once I will polish own Nextra 3 docs to include new changes, I can't say when it will be done.
Also, I already started work on Nextra 4 with app router support, so more amazing things coming this year.

@Genesis3800
Copy link

Hey @dimaMachina lots of love and regards to you for what you've built. Really excited for Nextra 3. Do you have a rough timeline right now for when it might be ready for stable release?

Thank you 🙌. The stable release will be released once I will polish own Nextra 3 docs to include new changes, I can't say when it will be done. Also, I already started work on Nextra 4 with app router support, so more amazing things coming this year.

Haha fair enough. We at my work are looking forward to versioning support, plus the upgrade to _meta.tsx . If there's any way I can help (I am a technical writer) please let me know.
It'll be an honor if I can help with the release in any way.

@dimaMachina
Copy link
Collaborator Author

@Genesis3800 thank you! It would be a huge help with v3 release 🙏.

If you want to help with docs updates

  • please go to v3 alpha #2245, and use this PR as base branch
  • once you are v3 branch run pnpm dev:website to run nextra.site locally
  • go over all existing docs and update them according to the-guild.dev/blog/nextra-3 changes
  • try to create separated PRs to make review easy

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