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

Closed
16 of 20 tasks
dimaMachina opened this issue Jan 28, 2023 · 39 comments
Closed
16 of 20 tasks

Nextra 3 #1421

dimaMachina opened this issue Jan 28, 2023 · 39 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
Contributor

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
Contributor

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 Nextra 3 x Pages Router #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

@mmkal
Copy link

mmkal commented Jul 12, 2024

Hi, not sure this is the right place to put this, but I didn't want to create a new issue since v3 is in alpha (feel free to mark as off topic and I can post as an issue).

Looks like there's a small CSS bug in ``` blocks (at least, single line ones that don't have a language tag - see the left padding):

Example: https://www.pgkit.dev/packages/migrator - source code here: https://github.com/mmkal/slonik-tools/blob/pgkit/apps/docs/pages/packages/migrator.md

image

It doesn't seem to affect code blocks:

image

Also, the backgroundColor.dark property didn't seem to do anything - note that the above page is in the normal colour even though I set backgroundColor.dark = 'green': https://github.com/mmkal/slonik-tools/blob/pgkit/apps/docs/theme.config.tsx#L24-L27

@dimaMachina
Copy link
Collaborator Author

dimaMachina commented Jul 13, 2024

Looks like there's a small CSS bug in ``` blocks (at least, single line ones that don't have a language tag - see the left padding):

bug, will be fixed

Also, the backgroundColor.dark property didn't seem to do anything - note that the above page is in the normal colour even though I set backgroundColor.dark = 'green'

use 0,255,0 for green

example

backgroundColor: {
dark: '15,23,42',
light: '254,252,232'
},

@equinusocio
Copy link

equinusocio commented Jul 15, 2024

Any hope to see this fixed with v3?

#1403

The most easy and basic fix is this, just wrap nextra styles in a css layer.

The only solution I found is to run a postintall script that takes the CSS content from node_modules/nextra-theme-docs/style.css and wraps it inside a CSS layer named core, which is our basic layer for core CSS like resets, so we are able to use other CSS layers from the DS

@logemann
Copy link

Looks like we cant use Nextra with React19 because of this:
#3037 (comment)

Are there any efforts to upgrade to latest headlessui/react so that we can use Nextra with a React19 NextJS project?

@logemann
Copy link

Configuring sidebar menus with explicit definition instead using the folder structure? No thanks. ;-)

@Genesis3800
Copy link

Genesis3800 commented Aug 23, 2024

@logemann:

  1. Even now in Nextra, you need to create individual _meta.json files to define sidebar menus with any sort of complexity at all. For example, something like this (that I made recently) requires a bit of refining in the _meta.json
  2. Configuring sidebar menus with explicit definitions isn't unprecedented either, Docusaurus does it that way too.
  3. That being said, I still believe Nextra is better than Vocs.

@dimaMachina
Copy link
Collaborator Author

Nextra 3 is finally released today, feel free to update and create new issues, I will lock this thread to avoid spamming those who had a notification enabled on this PR

Blog post / migration guide https://the-guild.dev/blog/nextra-3

Nextra 4 with app router support and server components will coming next, feel free to try v4 alpha versions as well https://github.com/shuding/nextra/releases/tag/nextra%404.0.0-app-router.3
https://github.com/shuding/nextra/releases/tag/nextra-theme-docs%404.0.0-app-router.3
https://github.com/shuding/nextra/releases/tag/nextra-theme-blog%404.0.0-app-router.3

Repository owner locked as resolved and limited conversation to collaborators Sep 28, 2024
@dimaMachina dimaMachina unpinned this issue Sep 28, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests