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

Add Fumadocs #111

Open
wants to merge 51 commits into
base: main
Choose a base branch
from
Open

Add Fumadocs #111

wants to merge 51 commits into from

Conversation

pomber
Copy link

@pomber pomber commented Nov 15, 2024

This is a draft PR showing how to use fumadocs as the docs framework.

  • currently only applied to /docs path (with placeholder content)
  • the rest of the website remains using the pages router without any changes

TODO

  • there are some issues with the postcss plugins I still need to fix (I disabled them for now)
  • locale routing isn't included so far, the app router only works for English
  • added some @ts-ignore annotations that can be removed after the old docs framework is replaced (because of some conflicts between different versions of mdx/types)

RE Tailwind duplication:
fumadocs components ship with unprefixed classes, while solana-lib use the tw prefix, this means that we need to include two tailwind stylesheets (only for the routes that use fumadocs), we can still use something like cssnano to remove any duplicated CSS (like tailwind's preflight styles)

Copy link

vercel bot commented Nov 15, 2024

@pomber is attempting to deploy a commit to the Solana Foundation Team on Vercel.

A member of the Team first needs to authorize it.

Copy link

vercel bot commented Nov 15, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
solana-com ✅ Ready (Inspect) Visit Preview Jan 15, 2025 9:38pm

@ZYJLiu
Copy link
Contributor

ZYJLiu commented Nov 18, 2024

It looks like on mobile we're missing the hamburger that opens the sidebar nav. Will need an alternative.

On the POC, the issue is that when on mobile, there's no way to open sidebar. The icon on the solana-com nav is for the entire website.
CleanShot 2024-11-18 at 15 20 10@2x

On the current solana-com its floating on the bottom left:
CleanShot 2024-11-18 at 15 20 10@2x

On the default fumadocs layout the icon to open the sidebar is part of the nav, but that's overridden by the default solana-com navbar.

CleanShot 2024-11-18 at 15 20 10@2x

@ZYJLiu
Copy link
Contributor

ZYJLiu commented Nov 18, 2024

Minor styling things:

The font type and font size may need to be updated to better match solana-com.

The breadcrumbs should stick below the navbar when scrolling.
Right now the navbar covers the breadcrumbs when scrolling

Expected Behavior Current Behavior
Before After

There's extra spacing above the TOC:

CleanShot 2024-11-18 at 15 20 10@2x

@ZYJLiu
Copy link
Contributor

ZYJLiu commented Nov 18, 2024

There is also currently a bunch of "webpack-internal" warnings when running locally

Copy link
Collaborator

@catalinred catalinred left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pomber Thanks for working on this!

Overall, this is looking promising, and I’m looking forward to seeing locale implementation for the app router. Having an alternative app router layout is something I’m particularly excited about, as it will help us migrate pages step-by-step from the pages router to the app router.

I second what John wrote above: first and foremost, we don’t want to lose any of the existing functionality. The UI should also match the current level of implementation, including hovers, active states, sizing, and overall typography.

Additionally, tables, alerts, and code snippets from within the /docs* are critical elements, and we need to ensure they are migrated properly.

P.S. Please fetch the latest changes from the main branch and apply them to the newly created next.config.mjs and rewrites-redirects.mjs.

"@types/node": "^22.7.4",
"@types/styled-components": "^5.1.34",
"autoprefixer": "^10.4.20",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this really needed? Trying to understand how autoprefixer helps here since most modern browsers implemented standardized CSS properties with minimal need for prefixes.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's probably safe to remove, I need to check if Tailwind is using any newish feature that depends on prefixes though, because they recommend it in their docs

@@ -73,17 +78,19 @@
"postcss-preset-env": "^10.0.5",
"prettier": "^3.3.3",
"svg-react-loader": "^0.4.6",
"tailwindcss": "^3.4.14",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I read your comment about Tailwind and yeah am not a big fan of including tailwindcss once again and w/o the tw prefix this time. But we can accept that given the situation - looking forward though to have this polished as much as possible to reduce the amount of unused CSS here.

Curious if you have any other insights overall here, considering the solana-lib repo et all.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have a few questions about solana-lib, I'll ask later on slack

Copy link
Collaborator

@catalinred catalinred Nov 19, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I read the postcss notes, and yeah these changes need to be reverted back, otherwise as you expect lots of stuff will break.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep I'll add the purge plugin back, it's a matter of writing the right regexp so it includes the missing tailwind classes, but I want to profile and compare the before and after output to make sure it's done right

@pomber
Copy link
Author

pomber commented Nov 21, 2024

Additionally, tables, alerts, and code snippets from within the /docs* are critical elements, and we need to ensure they are migrated properly.

I think the idea for most of those components is to use the ones built-in in fumadocs. For example, the steps component. We shouldn't lose any functionality, the current issues with the layout and styles are mainly because of the "minimum viable fumadocs integration" state of the PR.

@pomber
Copy link
Author

pomber commented Nov 26, 2024

There is also currently a bunch of "webpack-internal" warnings when running locally

What are the errors? these? Warning: PodcastInline: Support for defaultProps will be removed from function components in a future major release. Use JavaScript default parameters instead.

I think those were there from before, I can take a look if you want. I'm guessing they come from svg-react-loader.

@ZYJLiu
Copy link
Contributor

ZYJLiu commented Nov 26, 2024

There is also currently a bunch of "webpack-internal" warnings when running locally

What are the errors? these? Warning: PodcastInline: Support for defaultProps will be removed from function components in a future major release. Use JavaScript default parameters instead.

I think those were there from before, I can take a look if you want. I'm guessing they come from svg-react-loader.

You're right it seems the warnings already existed. I just cloned the repo again, ran locally, and got the same warnings. Please leave them for now and prioritize the migration, thanks.

 ✓ Compiled /[...slug] in 6.2s (1393 modules)
Warning: A props object containing a "key" prop is being spread into JSX:
  let props = {key: someKey, page: ..., _nextI18Next: ...};
  <Home {...props} />
React keys must be passed directly to JSX without using spread:
  let props = {page: ..., _nextI18Next: ...};
  <Home key={someKey} {...props} />
    at App (webpack-internal:///./src/pages/_app.js:25:16)
    at I18nextProvider (/Users/johnliu/code/misc/delete/solana-com/node_modules/react-i18next/dist/commonjs/I18nextProvider.js:11:5)
    at AppWithTranslation (/Users/johnliu/code/misc/delete/solana-com/node_modules/next-i18next/dist/commonjs/appWithTranslation.js:73:22)
    at Ge (/Users/johnliu/code/misc/delete/solana-com/node_modules/styled-components/dist/styled-components.cjs.js:1:16567)
    at StyleRegistry (/Users/johnliu/code/misc/delete/solana-com/node_modules/styled-jsx/dist/index/index.js:449:36)
    at eU (/Users/johnliu/code/misc/delete/solana-com/node_modules/next/dist/compiled/next-server/pages.runtime.dev.js:8:20489)
    at eH (/Users/johnliu/code/misc/delete/solana-com/node_modules/next/dist/compiled/next-server/pages.runtime.dev.js:17:1788)
    at eJ (/Users/johnliu/code/misc/delete/solana-com/node_modules/next/dist/compiled/next-server/pages.runtime.dev.js:17:3091)
    at div
    at e9 (/Users/johnliu/code/misc/delete/solana-com/node_modules/next/dist/compiled/next-server/pages.runtime.dev.js:26:761)
react-i18next:: You will need to pass in an i18next instance by using initReactI18next
Warning: LogotypeInline: Support for defaultProps will be removed from function components in a future major release. Use JavaScript default parameters instead.
    at LogotypeInline
    at a
    at LinkComponent (webpack-internal:///./node_modules/next/dist/client/link.js:118:19)
    at Link (webpack-internal:///./src/components/shared/Link.js:22:17)
    at div
    at nav
    at /Users/johnliu/code/misc/delete/solana-com/node_modules/react-bootstrap/cjs/Navbar.js:38:43
    at header
    at Header (webpack-internal:///./src/components/Header.js:45:19)
    at Layout (webpack-internal:///./src/components/layout.js:15:19)
    at Page (webpack-internal:///./src/pages/[...slug].js:35:17)
    at Home
    at ThemeProvider (webpack-internal:///./src/themecontext.js:19:26)
    at $29383e587d62412a$export$9f8ac96af4b1b2ae (/Users/johnliu/code/misc/delete/solana-com/node_modules/@react-aria/ssr/dist/main.js:49:43)
    at App (webpack-internal:///./src/pages/_app.js:25:16)
    at I18nextProvider (/Users/johnliu/code/misc/delete/solana-com/node_modules/react-i18next/dist/commonjs/I18nextProvider.js:11:5)
    at AppWithTranslation (/Users/johnliu/code/misc/delete/solana-com/node_modules/next-i18next/dist/commonjs/appWithTranslation.js:73:22)
    at Ge (/Users/johnliu/code/misc/delete/solana-com/node_modules/styled-components/dist/styled-components.cjs.js:1:16567)
    at StyleRegistry (/Users/johnliu/code/misc/delete/solana-com/node_modules/styled-jsx/dist/index/index.js:449:36)
    at eU (/Users/johnliu/code/misc/delete/solana-com/node_modules/next/dist/compiled/next-server/pages.runtime.dev.js:8:20489)
    at eH (/Users/johnliu/code/misc/delete/solana-com/node_modules/next/dist/compiled/next-server/pages.runtime.dev.js:17:1788)
    at eJ (/Users/johnliu/code/misc/delete/solana-com/node_modules/next/dist/compiled/next-server/pages.runtime.dev.js:17:3091)
    at div
    at e9 (/Users/johnliu/code/misc/delete/solana-com/node_modules/next/dist/compiled/next-server/pages.runtime.dev.js:26:761)
Warning: AngleDownInline: Support for defaultProps will be removed from function components in a future major release. Use JavaScript default parameters instead.
    at AngleDownInline
    at button
    at /Users/johnliu/code/misc/delete/solana-com/node_modules/react-bootstrap/cjs/DropdownToggle.js:20:3
    at li
    at Dropdown (/Users/johnliu/code/misc/delete/solana-com/node_modules/@restart/ui/cjs/Dropdown.js:41:3)
    at /Users/johnliu/code/misc/delete/solana-com/node_modules/react-bootstrap/cjs/Dropdown.js:41:43
    at ul
    at HeaderList (webpack-internal:///./src/components/header/HeaderList.js:37:79)
    at div
    at Transition (/Users/johnliu/code/misc/delete/solana-com/node_modules/react-transition-group/cjs/Transition.js:135:30)
    at /Users/johnliu/code/misc/delete/solana-com/node_modules/react-bootstrap/cjs/TransitionWrapper.js:16:3
    at /Users/johnliu/code/misc/delete/solana-com/node_modules/react-bootstrap/cjs/Collapse.js:38:3
    at /Users/johnliu/code/misc/delete/solana-com/node_modules/react-bootstrap/cjs/NavbarCollapse.js:16:3
    at div
    at div
    at nav
    at /Users/johnliu/code/misc/delete/solana-com/node_modules/react-bootstrap/cjs/Navbar.js:38:43
    at header
    at Header (webpack-internal:///./src/components/Header.js:45:19)
    at Layout (webpack-internal:///./src/components/layout.js:15:19)
    at Page (webpack-internal:///./src/pages/[...slug].js:35:17)
    at Home
    at ThemeProvider (webpack-internal:///./src/themecontext.js:19:26)
    at $29383e587d62412a$export$9f8ac96af4b1b2ae (/Users/johnliu/code/misc/delete/solana-com/node_modules/@react-aria/ssr/dist/main.js:49:43)
    at App (webpack-internal:///./src/pages/_app.js:25:16)
    at I18nextProvider (/Users/johnliu/code/misc/delete/solana-com/node_modules/react-i18next/dist/commonjs/I18nextProvider.js:11:5)
    at AppWithTranslation (/Users/johnliu/code/misc/delete/solana-com/node_modules/next-i18next/dist/commonjs/appWithTranslation.js:73:22)
    at Ge (/Users/johnliu/code/misc/delete/solana-com/node_modules/styled-components/dist/styled-components.cjs.js:1:16567)
    at StyleRegistry (/Users/johnliu/code/misc/delete/solana-com/node_modules/styled-jsx/dist/index/index.js:449:36)
    at eU (/Users/johnliu/code/misc/delete/solana-com/node_modules/next/dist/compiled/next-server/pages.runtime.dev.js:8:20489)
    at eH (/Users/johnliu/code/misc/delete/solana-com/node_modules/next/dist/compiled/next-server/pages.runtime.dev.js:17:1788)
    at eJ (/Users/johnliu/code/misc/delete/solana-com/node_modules/next/dist/compiled/next-server/pages.runtime.dev.js:17:3091)
    at div
    at e9 (/Users/johnliu/code/misc/delete/solana-com/node_modules/next/dist/compiled/next-server/pages.runtime.dev.js:26:761)
Warning: Each child in a list should have a unique "key" prop.

Check the top-level render call using <div>. See https://reactjs.org/link/warning-keys for more information.
    at p
    at HtmlParser (/Users/johnliu/code/misc/delete/solana-com/node_modules/@solana-foundation/solana-lib/dist/solana-lib.cjs.development.js:1280:3)
    at div
    at div
    at div
    at section
    at div
    at Section (/Users/johnliu/code/misc/delete/solana-com/node_modules/@solana-foundation/solana-lib/dist/solana-lib.cjs.development.js:351:3)
    at Hero (/Users/johnliu/code/misc/delete/solana-com/node_modules/@solana-foundation/solana-lib/dist/solana-lib.cjs.development.js:2857:3)
    at s (/Users/johnliu/code/misc/delete/solana-com/node_modules/next/dist/compiled/next-server/pages.runtime.dev.js:8:2924)
    at div
    at BuilderBlock (/Users/johnliu/code/misc/delete/solana-com/node_modules/@builder.io/react/dist/builder-react.cjs.js:1:13322)
    at div
    at BasicProvider (/Users/johnliu/code/misc/delete/solana-com/node_modules/@emotion/core/dist/emotion-element-c423a2c0.cjs.dev.js:45:32)
    at EmotionCssPropInternal
    at t (/Users/johnliu/code/misc/delete/solana-com/node_modules/@builder.io/react/dist/builder-react.cjs.js:1:22284)
    at div
    at div
    at VariantsProvider (/Users/johnliu/code/misc/delete/solana-com/node_modules/@builder.io/react/dist/builder-react.cjs.js:1:27510)
    at BuilderContent (/Users/johnliu/code/misc/delete/solana-com/node_modules/@builder.io/react/dist/builder-react.cjs.js:1:28637)
    at div
    at t (/Users/johnliu/code/misc/delete/solana-com/node_modules/@builder.io/react/dist/builder-react.cjs.js:1:41463)
    at main
    at Layout (webpack-internal:///./src/components/layout.js:15:19)
    at Page (webpack-internal:///./src/pages/[...slug].js:35:17)
    at Home
    at ThemeProvider (webpack-internal:///./src/themecontext.js:19:26)
    at $29383e587d62412a$export$9f8ac96af4b1b2ae (/Users/johnliu/code/misc/delete/solana-com/node_modules/@react-aria/ssr/dist/main.js:49:43)
    at App (webpack-internal:///./src/pages/_app.js:25:16)
    at I18nextProvider (/Users/johnliu/code/misc/delete/solana-com/node_modules/react-i18next/dist/commonjs/I18nextProvider.js:11:5)
    at AppWithTranslation (/Users/johnliu/code/misc/delete/solana-com/node_modules/next-i18next/dist/commonjs/appWithTranslation.js:73:22)
    at Ge (/Users/johnliu/code/misc/delete/solana-com/node_modules/styled-components/dist/styled-components.cjs.js:1:16567)
    at StyleRegistry (/Users/johnliu/code/misc/delete/solana-com/node_modules/styled-jsx/dist/index/index.js:449:36)
    at eU (/Users/johnliu/code/misc/delete/solana-com/node_modules/next/dist/compiled/next-server/pages.runtime.dev.js:8:20489)
    at eH (/Users/johnliu/code/misc/delete/solana-com/node_modules/next/dist/compiled/next-server/pages.runtime.dev.js:17:1788)
    at eJ (/Users/johnliu/code/misc/delete/solana-com/node_modules/next/dist/compiled/next-server/pages.runtime.dev.js:17:3091)
    at div
    at e9 (/Users/johnliu/code/misc/delete/solana-com/node_modules/next/dist/compiled/next-server/pages.runtime.dev.js:26:761)
Warning: React does not recognize the `builderState` prop on a DOM element. If you intentionally want it to appear in the DOM as a custom attribute, spell it as lowercase `builderstate` instead. If you accidentally passed it from a parent component, remove it from the DOM element.
    at a
    at LinkComponent (/Users/johnliu/code/misc/delete/solana-com/node_modules/next/dist/client/link.js:121:19)
    at VideoPopup (/Users/johnliu/code/misc/delete/solana-com/node_modules/@solana-foundation/solana-lib/dist/solana-lib.cjs.development.js:191:3)
    at Button (/Users/johnliu/code/misc/delete/solana-com/node_modules/@solana-foundation/solana-lib/dist/solana-lib.cjs.development.js:291:3)
    at s (/Users/johnliu/code/misc/delete/solana-com/node_modules/next/dist/compiled/next-server/pages.runtime.dev.js:8:2924)
    at div
    at BuilderBlock (/Users/johnliu/code/misc/delete/solana-com/node_modules/@builder.io/react/dist/builder-react.cjs.js:1:13322)
    at div
    at EmotionCssPropInternal
    at t (/Users/johnliu/code/misc/delete/solana-com/node_modules/@builder.io/react/dist/builder-react.cjs.js:1:22284)
    at div
    at EmotionCssPropInternal
    at div
    at EmotionCssPropInternal
    at t (/Users/johnliu/code/misc/delete/solana-com/node_modules/@builder.io/react/dist/builder-react.cjs.js:1:67463)
    at div
    at BuilderBlock (/Users/johnliu/code/misc/delete/solana-com/node_modules/@builder.io/react/dist/builder-react.cjs.js:1:13322)
    at section
    at EmotionCssPropInternal
    at t (/Users/johnliu/code/misc/delete/solana-com/node_modules/@builder.io/react/dist/builder-react.cjs.js:1:95670)
    at div
    at BuilderBlock (/Users/johnliu/code/misc/delete/solana-com/node_modules/@builder.io/react/dist/builder-react.cjs.js:1:13322)
    at div
    at BasicProvider (/Users/johnliu/code/misc/delete/solana-com/node_modules/@emotion/core/dist/emotion-element-c423a2c0.cjs.dev.js:45:32)
    at EmotionCssPropInternal
    at t (/Users/johnliu/code/misc/delete/solana-com/node_modules/@builder.io/react/dist/builder-react.cjs.js:1:22284)
    at div
    at div
    at VariantsProvider (/Users/johnliu/code/misc/delete/solana-com/node_modules/@builder.io/react/dist/builder-react.cjs.js:1:27510)
    at BuilderContent (/Users/johnliu/code/misc/delete/solana-com/node_modules/@builder.io/react/dist/builder-react.cjs.js:1:28637)
    at div
    at t (/Users/johnliu/code/misc/delete/solana-com/node_modules/@builder.io/react/dist/builder-react.cjs.js:1:41463)
    at main
    at Layout (webpack-internal:///./src/components/layout.js:15:19)
    at Page (webpack-internal:///./src/pages/[...slug].js:35:17)
    at Home
    at ThemeProvider (webpack-internal:///./src/themecontext.js:19:26)
    at $29383e587d62412a$export$9f8ac96af4b1b2ae (/Users/johnliu/code/misc/delete/solana-com/node_modules/@react-aria/ssr/dist/main.js:49:43)
    at App (webpack-internal:///./src/pages/_app.js:25:16)
    at I18nextProvider (/Users/johnliu/code/misc/delete/solana-com/node_modules/react-i18next/dist/commonjs/I18nextProvider.js:11:5)
    at AppWithTranslation (/Users/johnliu/code/misc/delete/solana-com/node_modules/next-i18next/dist/commonjs/appWithTranslation.js:73:22)
    at Ge (/Users/johnliu/code/misc/delete/solana-com/node_modules/styled-components/dist/styled-components.cjs.js:1:16567)
    at StyleRegistry (/Users/johnliu/code/misc/delete/solana-com/node_modules/styled-jsx/dist/index/index.js:449:36)
    at eU (/Users/johnliu/code/misc/delete/solana-com/node_modules/next/dist/compiled/next-server/pages.runtime.dev.js:8:20489)
    at eH (/Users/johnliu/code/misc/delete/solana-com/node_modules/next/dist/compiled/next-server/pages.runtime.dev.js:17:1788)
    at eJ (/Users/johnliu/code/misc/delete/solana-com/node_modules/next/dist/compiled/next-server/pages.runtime.dev.js:17:3091)
    at div
    at e9 (/Users/johnliu/code/misc/delete/solana-com/node_modules/next/dist/compiled/next-server/pages.runtime.dev.js:26:761)
Warning: React does not recognize the `builderBlock` prop on a DOM element. If you intentionally want it to appear in the DOM as a custom attribute, spell it as lowercase `builderblock` instead. If you accidentally passed it from a parent component, remove it from the DOM element.
    at a
    at LinkComponent (/Users/johnliu/code/misc/delete/solana-com/node_modules/next/dist/client/link.js:121:19)
    at VideoPopup (/Users/johnliu/code/misc/delete/solana-com/node_modules/@solana-foundation/solana-lib/dist/solana-lib.cjs.development.js:191:3)
    at Button (/Users/johnliu/code/misc/delete/solana-com/node_modules/@solana-foundation/solana-lib/dist/solana-lib.cjs.development.js:291:3)
    at s (/Users/johnliu/code/misc/delete/solana-com/node_modules/next/dist/compiled/next-server/pages.runtime.dev.js:8:2924)
    at div
    at BuilderBlock (/Users/johnliu/code/misc/delete/solana-com/node_modules/@builder.io/react/dist/builder-react.cjs.js:1:13322)
    at div
    at EmotionCssPropInternal
    at t (/Users/johnliu/code/misc/delete/solana-com/node_modules/@builder.io/react/dist/builder-react.cjs.js:1:22284)
    at div
    at EmotionCssPropInternal
    at div
    at EmotionCssPropInternal
    at t (/Users/johnliu/code/misc/delete/solana-com/node_modules/@builder.io/react/dist/builder-react.cjs.js:1:67463)
    at div
    at BuilderBlock (/Users/johnliu/code/misc/delete/solana-com/node_modules/@builder.io/react/dist/builder-react.cjs.js:1:13322)
    at section
    at EmotionCssPropInternal
    at t (/Users/johnliu/code/misc/delete/solana-com/node_modules/@builder.io/react/dist/builder-react.cjs.js:1:95670)
    at div
    at BuilderBlock (/Users/johnliu/code/misc/delete/solana-com/node_modules/@builder.io/react/dist/builder-react.cjs.js:1:13322)
    at div
    at BasicProvider (/Users/johnliu/code/misc/delete/solana-com/node_modules/@emotion/core/dist/emotion-element-c423a2c0.cjs.dev.js:45:32)
    at EmotionCssPropInternal
    at t (/Users/johnliu/code/misc/delete/solana-com/node_modules/@builder.io/react/dist/builder-react.cjs.js:1:22284)
    at div
    at div
    at VariantsProvider (/Users/johnliu/code/misc/delete/solana-com/node_modules/@builder.io/react/dist/builder-react.cjs.js:1:27510)
    at BuilderContent (/Users/johnliu/code/misc/delete/solana-com/node_modules/@builder.io/react/dist/builder-react.cjs.js:1:28637)
    at div
    at t (/Users/johnliu/code/misc/delete/solana-com/node_modules/@builder.io/react/dist/builder-react.cjs.js:1:41463)
    at main
    at Layout (webpack-internal:///./src/components/layout.js:15:19)
    at Page (webpack-internal:///./src/pages/[...slug].js:35:17)
    at Home
    at ThemeProvider (webpack-internal:///./src/themecontext.js:19:26)
    at $29383e587d62412a$export$9f8ac96af4b1b2ae (/Users/johnliu/code/misc/delete/solana-com/node_modules/@react-aria/ssr/dist/main.js:49:43)
    at App (webpack-internal:///./src/pages/_app.js:25:16)
    at I18nextProvider (/Users/johnliu/code/misc/delete/solana-com/node_modules/react-i18next/dist/commonjs/I18nextProvider.js:11:5)
    at AppWithTranslation (/Users/johnliu/code/misc/delete/solana-com/node_modules/next-i18next/dist/commonjs/appWithTranslation.js:73:22)
    at Ge (/Users/johnliu/code/misc/delete/solana-com/node_modules/styled-components/dist/styled-components.cjs.js:1:16567)
    at StyleRegistry (/Users/johnliu/code/misc/delete/solana-com/node_modules/styled-jsx/dist/index/index.js:449:36)
    at eU (/Users/johnliu/code/misc/delete/solana-com/node_modules/next/dist/compiled/next-server/pages.runtime.dev.js:8:20489)
    at eH (/Users/johnliu/code/misc/delete/solana-com/node_modules/next/dist/compiled/next-server/pages.runtime.dev.js:17:1788)
    at eJ (/Users/johnliu/code/misc/delete/solana-com/node_modules/next/dist/compiled/next-server/pages.runtime.dev.js:17:3091)
    at div
    at e9 (/Users/johnliu/code/misc/delete/solana-com/node_modules/next/dist/compiled/next-server/pages.runtime.dev.js:26:761)
Warning: LogotypeFoundationInline: Support for defaultProps will be removed from function components in a future major release. Use JavaScript default parameters instead.
    at LogotypeFoundationInline
    at a
    at LinkComponent (webpack-internal:///./node_modules/next/dist/client/link.js:118:19)
    at Link (webpack-internal:///./src/components/shared/Link.js:22:17)
    at div
    at div
    at div
    at div
    at div
    at Footer (webpack-internal:///./src/components/Footer/index.js:55:79)
    at Layout (webpack-internal:///./src/components/layout.js:15:19)
    at Page (webpack-internal:///./src/pages/[...slug].js:35:17)
    at Home
    at ThemeProvider (webpack-internal:///./src/themecontext.js:19:26)
    at $29383e587d62412a$export$9f8ac96af4b1b2ae (/Users/johnliu/code/misc/delete/solana-com/node_modules/@react-aria/ssr/dist/main.js:49:43)
    at App (webpack-internal:///./src/pages/_app.js:25:16)
    at I18nextProvider (/Users/johnliu/code/misc/delete/solana-com/node_modules/react-i18next/dist/commonjs/I18nextProvider.js:11:5)
    at AppWithTranslation (/Users/johnliu/code/misc/delete/solana-com/node_modules/next-i18next/dist/commonjs/appWithTranslation.js:73:22)
    at Ge (/Users/johnliu/code/misc/delete/solana-com/node_modules/styled-components/dist/styled-components.cjs.js:1:16567)
    at StyleRegistry (/Users/johnliu/code/misc/delete/solana-com/node_modules/styled-jsx/dist/index/index.js:449:36)
    at eU (/Users/johnliu/code/misc/delete/solana-com/node_modules/next/dist/compiled/next-server/pages.runtime.dev.js:8:20489)
    at eH (/Users/johnliu/code/misc/delete/solana-com/node_modules/next/dist/compiled/next-server/pages.runtime.dev.js:17:1788)
    at eJ (/Users/johnliu/code/misc/delete/solana-com/node_modules/next/dist/compiled/next-server/pages.runtime.dev.js:17:3091)
    at div
    at e9 (/Users/johnliu/code/misc/delete/solana-com/node_modules/next/dist/compiled/next-server/pages.runtime.dev.js:26:761)
Warning: YoutubeInline: Support for defaultProps will be removed from function components in a future major release. Use JavaScript default parameters instead.
    at YoutubeInline
    at a
    at InlineLink (webpack-internal:///./src/components/shared/Link.js:63:23)
    at div
    at div
    at div
    at div
    at div
    at Footer (webpack-internal:///./src/components/Footer/index.js:55:79)
    at Layout (webpack-internal:///./src/components/layout.js:15:19)
    at Page (webpack-internal:///./src/pages/[...slug].js:35:17)
    at Home
    at ThemeProvider (webpack-internal:///./src/themecontext.js:19:26)
    at $29383e587d62412a$export$9f8ac96af4b1b2ae (/Users/johnliu/code/misc/delete/solana-com/node_modules/@react-aria/ssr/dist/main.js:49:43)
    at App (webpack-internal:///./src/pages/_app.js:25:16)
    at I18nextProvider (/Users/johnliu/code/misc/delete/solana-com/node_modules/react-i18next/dist/commonjs/I18nextProvider.js:11:5)
    at AppWithTranslation (/Users/johnliu/code/misc/delete/solana-com/node_modules/next-i18next/dist/commonjs/appWithTranslation.js:73:22)
    at Ge (/Users/johnliu/code/misc/delete/solana-com/node_modules/styled-components/dist/styled-components.cjs.js:1:16567)
    at StyleRegistry (/Users/johnliu/code/misc/delete/solana-com/node_modules/styled-jsx/dist/index/index.js:449:36)
    at eU (/Users/johnliu/code/misc/delete/solana-com/node_modules/next/dist/compiled/next-server/pages.runtime.dev.js:8:20489)
    at eH (/Users/johnliu/code/misc/delete/solana-com/node_modules/next/dist/compiled/next-server/pages.runtime.dev.js:17:1788)
    at eJ (/Users/johnliu/code/misc/delete/solana-com/node_modules/next/dist/compiled/next-server/pages.runtime.dev.js:17:3091)
    at div
    at e9 (/Users/johnliu/code/misc/delete/solana-com/node_modules/next/dist/compiled/next-server/pages.runtime.dev.js:26:761)
Warning: TwitterInline: Support for defaultProps will be removed from function components in a future major release. Use JavaScript default parameters instead.
    at TwitterInline
    at a
    at InlineLink (webpack-internal:///./src/components/shared/Link.js:63:23)
    at div
    at div
    at div
    at div
    at div
    at Footer (webpack-internal:///./src/components/Footer/index.js:55:79)
    at Layout (webpack-internal:///./src/components/layout.js:15:19)
    at Page (webpack-internal:///./src/pages/[...slug].js:35:17)
    at Home
    at ThemeProvider (webpack-internal:///./src/themecontext.js:19:26)
    at $29383e587d62412a$export$9f8ac96af4b1b2ae (/Users/johnliu/code/misc/delete/solana-com/node_modules/@react-aria/ssr/dist/main.js:49:43)
    at App (webpack-internal:///./src/pages/_app.js:25:16)
    at I18nextProvider (/Users/johnliu/code/misc/delete/solana-com/node_modules/react-i18next/dist/commonjs/I18nextProvider.js:11:5)
    at AppWithTranslation (/Users/johnliu/code/misc/delete/solana-com/node_modules/next-i18next/dist/commonjs/appWithTranslation.js:73:22)
    at Ge (/Users/johnliu/code/misc/delete/solana-com/node_modules/styled-components/dist/styled-components.cjs.js:1:16567)
    at StyleRegistry (/Users/johnliu/code/misc/delete/solana-com/node_modules/styled-jsx/dist/index/index.js:449:36)
    at eU (/Users/johnliu/code/misc/delete/solana-com/node_modules/next/dist/compiled/next-server/pages.runtime.dev.js:8:20489)
    at eH (/Users/johnliu/code/misc/delete/solana-com/node_modules/next/dist/compiled/next-server/pages.runtime.dev.js:17:1788)
    at eJ (/Users/johnliu/code/misc/delete/solana-com/node_modules/next/dist/compiled/next-server/pages.runtime.dev.js:17:3091)
    at div
    at e9 (/Users/johnliu/code/misc/delete/solana-com/node_modules/next/dist/compiled/next-server/pages.runtime.dev.js:26:761)
Warning: DiscordInline: Support for defaultProps will be removed from function components in a future major release. Use JavaScript default parameters instead.
    at DiscordInline
    at a
    at InlineLink (webpack-internal:///./src/components/shared/Link.js:63:23)
    at div
    at div
    at div
    at div
    at div
    at Footer (webpack-internal:///./src/components/Footer/index.js:55:79)
    at Layout (webpack-internal:///./src/components/layout.js:15:19)
    at Page (webpack-internal:///./src/pages/[...slug].js:35:17)
    at Home
    at ThemeProvider (webpack-internal:///./src/themecontext.js:19:26)
    at $29383e587d62412a$export$9f8ac96af4b1b2ae (/Users/johnliu/code/misc/delete/solana-com/node_modules/@react-aria/ssr/dist/main.js:49:43)
    at App (webpack-internal:///./src/pages/_app.js:25:16)
    at I18nextProvider (/Users/johnliu/code/misc/delete/solana-com/node_modules/react-i18next/dist/commonjs/I18nextProvider.js:11:5)
    at AppWithTranslation (/Users/johnliu/code/misc/delete/solana-com/node_modules/next-i18next/dist/commonjs/appWithTranslation.js:73:22)
    at Ge (/Users/johnliu/code/misc/delete/solana-com/node_modules/styled-components/dist/styled-components.cjs.js:1:16567)
    at StyleRegistry (/Users/johnliu/code/misc/delete/solana-com/node_modules/styled-jsx/dist/index/index.js:449:36)
    at eU (/Users/johnliu/code/misc/delete/solana-com/node_modules/next/dist/compiled/next-server/pages.runtime.dev.js:8:20489)
    at eH (/Users/johnliu/code/misc/delete/solana-com/node_modules/next/dist/compiled/next-server/pages.runtime.dev.js:17:1788)
    at eJ (/Users/johnliu/code/misc/delete/solana-com/node_modules/next/dist/compiled/next-server/pages.runtime.dev.js:17:3091)
    at div
    at e9 (/Users/johnliu/code/misc/delete/solana-com/node_modules/next/dist/compiled/next-server/pages.runtime.dev.js:26:761)
Warning: RedditInline: Support for defaultProps will be removed from function components in a future major release. Use JavaScript default parameters instead.
    at RedditInline
    at a
    at InlineLink (webpack-internal:///./src/components/shared/Link.js:63:23)
    at div
    at div
    at div
    at div
    at div
    at Footer (webpack-internal:///./src/components/Footer/index.js:55:79)
    at Layout (webpack-internal:///./src/components/layout.js:15:19)
    at Page (webpack-internal:///./src/pages/[...slug].js:35:17)
    at Home
    at ThemeProvider (webpack-internal:///./src/themecontext.js:19:26)
    at $29383e587d62412a$export$9f8ac96af4b1b2ae (/Users/johnliu/code/misc/delete/solana-com/node_modules/@react-aria/ssr/dist/main.js:49:43)
    at App (webpack-internal:///./src/pages/_app.js:25:16)
    at I18nextProvider (/Users/johnliu/code/misc/delete/solana-com/node_modules/react-i18next/dist/commonjs/I18nextProvider.js:11:5)
    at AppWithTranslation (/Users/johnliu/code/misc/delete/solana-com/node_modules/next-i18next/dist/commonjs/appWithTranslation.js:73:22)
    at Ge (/Users/johnliu/code/misc/delete/solana-com/node_modules/styled-components/dist/styled-components.cjs.js:1:16567)
    at StyleRegistry (/Users/johnliu/code/misc/delete/solana-com/node_modules/styled-jsx/dist/index/index.js:449:36)
    at eU (/Users/johnliu/code/misc/delete/solana-com/node_modules/next/dist/compiled/next-server/pages.runtime.dev.js:8:20489)
    at eH (/Users/johnliu/code/misc/delete/solana-com/node_modules/next/dist/compiled/next-server/pages.runtime.dev.js:17:1788)
    at eJ (/Users/johnliu/code/misc/delete/solana-com/node_modules/next/dist/compiled/next-server/pages.runtime.dev.js:17:3091)
    at div
    at e9 (/Users/johnliu/code/misc/delete/solana-com/node_modules/next/dist/compiled/next-server/pages.runtime.dev.js:26:761)
Warning: GithubInline: Support for defaultProps will be removed from function components in a future major release. Use JavaScript default parameters instead.
    at GithubInline
    at a
    at InlineLink (webpack-internal:///./src/components/shared/Link.js:63:23)
    at div
    at div
    at div
    at div
    at div
    at Footer (webpack-internal:///./src/components/Footer/index.js:55:79)
    at Layout (webpack-internal:///./src/components/layout.js:15:19)
    at Page (webpack-internal:///./src/pages/[...slug].js:35:17)
    at Home
    at ThemeProvider (webpack-internal:///./src/themecontext.js:19:26)
    at $29383e587d62412a$export$9f8ac96af4b1b2ae (/Users/johnliu/code/misc/delete/solana-com/node_modules/@react-aria/ssr/dist/main.js:49:43)
    at App (webpack-internal:///./src/pages/_app.js:25:16)
    at I18nextProvider (/Users/johnliu/code/misc/delete/solana-com/node_modules/react-i18next/dist/commonjs/I18nextProvider.js:11:5)
    at AppWithTranslation (/Users/johnliu/code/misc/delete/solana-com/node_modules/next-i18next/dist/commonjs/appWithTranslation.js:73:22)
    at Ge (/Users/johnliu/code/misc/delete/solana-com/node_modules/styled-components/dist/styled-components.cjs.js:1:16567)
    at StyleRegistry (/Users/johnliu/code/misc/delete/solana-com/node_modules/styled-jsx/dist/index/index.js:449:36)
    at eU (/Users/johnliu/code/misc/delete/solana-com/node_modules/next/dist/compiled/next-server/pages.runtime.dev.js:8:20489)
    at eH (/Users/johnliu/code/misc/delete/solana-com/node_modules/next/dist/compiled/next-server/pages.runtime.dev.js:17:1788)
    at eJ (/Users/johnliu/code/misc/delete/solana-com/node_modules/next/dist/compiled/next-server/pages.runtime.dev.js:17:3091)
    at div
    at e9 (/Users/johnliu/code/misc/delete/solana-com/node_modules/next/dist/compiled/next-server/pages.runtime.dev.js:26:761)
Warning: TelegramInline: Support for defaultProps will be removed from function components in a future major release. Use JavaScript default parameters instead.
    at TelegramInline
    at a
    at InlineLink (webpack-internal:///./src/components/shared/Link.js:63:23)
    at div
    at div
    at div
    at div
    at div
    at Footer (webpack-internal:///./src/components/Footer/index.js:55:79)
    at Layout (webpack-internal:///./src/components/layout.js:15:19)
    at Page (webpack-internal:///./src/pages/[...slug].js:35:17)
    at Home
    at ThemeProvider (webpack-internal:///./src/themecontext.js:19:26)
    at $29383e587d62412a$export$9f8ac96af4b1b2ae (/Users/johnliu/code/misc/delete/solana-com/node_modules/@react-aria/ssr/dist/main.js:49:43)
    at App (webpack-internal:///./src/pages/_app.js:25:16)
    at I18nextProvider (/Users/johnliu/code/misc/delete/solana-com/node_modules/react-i18next/dist/commonjs/I18nextProvider.js:11:5)
    at AppWithTranslation (/Users/johnliu/code/misc/delete/solana-com/node_modules/next-i18next/dist/commonjs/appWithTranslation.js:73:22)
    at Ge (/Users/johnliu/code/misc/delete/solana-com/node_modules/styled-components/dist/styled-components.cjs.js:1:16567)
    at StyleRegistry (/Users/johnliu/code/misc/delete/solana-com/node_modules/styled-jsx/dist/index/index.js:449:36)
    at eU (/Users/johnliu/code/misc/delete/solana-com/node_modules/next/dist/compiled/next-server/pages.runtime.dev.js:8:20489)
    at eH (/Users/johnliu/code/misc/delete/solana-com/node_modules/next/dist/compiled/next-server/pages.runtime.dev.js:17:1788)
    at eJ (/Users/johnliu/code/misc/delete/solana-com/node_modules/next/dist/compiled/next-server/pages.runtime.dev.js:17:3091)
    at div
    at e9 (/Users/johnliu/code/misc/delete/solana-com/node_modules/next/dist/compiled/next-server/pages.runtime.dev.js:26:761)
Warning: GlobeInline: Support for defaultProps will be removed from function components in a future major release. Use JavaScript default parameters instead.
    at GlobeInline
    at button
    at /Users/johnliu/code/misc/delete/solana-com/node_modules/react-bootstrap/cjs/Button.js:15:3
    at /Users/johnliu/code/misc/delete/solana-com/node_modules/react-bootstrap/cjs/DropdownToggle.js:20:3
    at div
    at Dropdown (/Users/johnliu/code/misc/delete/solana-com/node_modules/@restart/ui/cjs/Dropdown.js:41:3)
    at /Users/johnliu/code/misc/delete/solana-com/node_modules/react-bootstrap/cjs/Dropdown.js:41:43
    at Language (webpack-internal:///./src/components/LanguageSelector.js:23:78)
    at div
    at div
    at div
    at div
    at div
    at div
    at div
    at div
    at Footer (webpack-internal:///./src/components/Footer/index.js:55:79)
    at Layout (webpack-internal:///./src/components/layout.js:15:19)
    at Page (webpack-internal:///./src/pages/[...slug].js:35:17)
    at Home
    at ThemeProvider (webpack-internal:///./src/themecontext.js:19:26)
    at $29383e587d62412a$export$9f8ac96af4b1b2ae (/Users/johnliu/code/misc/delete/solana-com/node_modules/@react-aria/ssr/dist/main.js:49:43)
    at App (webpack-internal:///./src/pages/_app.js:25:16)
    at I18nextProvider (/Users/johnliu/code/misc/delete/solana-com/node_modules/react-i18next/dist/commonjs/I18nextProvider.js:11:5)
    at AppWithTranslation (/Users/johnliu/code/misc/delete/solana-com/node_modules/next-i18next/dist/commonjs/appWithTranslation.js:73:22)
    at Ge (/Users/johnliu/code/misc/delete/solana-com/node_modules/styled-components/dist/styled-components.cjs.js:1:16567)
    at StyleRegistry (/Users/johnliu/code/misc/delete/solana-com/node_modules/styled-jsx/dist/index/index.js:449:36)
    at eU (/Users/johnliu/code/misc/delete/solana-com/node_modules/next/dist/compiled/next-server/pages.runtime.dev.js:8:20489)
    at eH (/Users/johnliu/code/misc/delete/solana-com/node_modules/next/dist/compiled/next-server/pages.runtime.dev.js:17:1788)
    at eJ (/Users/johnliu/code/misc/delete/solana-com/node_modules/next/dist/compiled/next-server/pages.runtime.dev.js:17:3091)
    at div
    at e9 (/Users/johnliu/code/misc/delete/solana-com/node_modules/next/dist/compiled/next-server/pages.runtime.dev.js:26:761)
 GET / 200 in 6909ms
 GET /_next/static/webpack/eb18d2aff2477bc9.webpack.hot-update.json 200 in 6910ms
 ⚠ Fast Refresh had to perform a full reload. Read more: https://nextjs.org/docs/messages/fast-refresh-reload
 GET / 200 in 162ms
Warning: A props object containing a "key" prop is being spread into JSX:
  let props = {key: someKey, builderLocale: ..., page: ..., _nextI18Next: ...};
  <Page {...props} />
React keys must be passed directly to JSX without using spread:
  let props = {builderLocale: ..., page: ..., _nextI18Next: ...};
  <Page key={someKey} {...props} />
    at App (webpack-internal:///./src/pages/_app.js:25:16)
    at I18nextProvider (/Users/johnliu/code/misc/delete/solana-com/node_modules/react-i18next/dist/commonjs/I18nextProvider.js:11:5)
    at AppWithTranslation (/Users/johnliu/code/misc/delete/solana-com/node_modules/next-i18next/dist/commonjs/appWithTranslation.js:73:22)
    at Ge (/Users/johnliu/code/misc/delete/solana-com/node_modules/styled-components/dist/styled-components.cjs.js:1:16567)
    at StyleRegistry (/Users/johnliu/code/misc/delete/solana-com/node_modules/styled-jsx/dist/index/index.js:449:36)
    at eU (/Users/johnliu/code/misc/delete/solana-com/node_modules/next/dist/compiled/next-server/pages.runtime.dev.js:8:20489)
    at eH (/Users/johnliu/code/misc/delete/solana-com/node_modules/next/dist/compiled/next-server/pages.runtime.dev.js:17:1788)
    at eJ (/Users/johnliu/code/misc/delete/solana-com/node_modules/next/dist/compiled/next-server/pages.runtime.dev.js:17:3091)
    at div
    at e9 (/Users/johnliu/code/misc/delete/solana-com/node_modules/next/dist/compiled/next-server/pages.runtime.dev.js:26:761)
 GET /_next/static/webpack/eb18d2aff2477bc9.webpack.hot-update.json 200 in 2846ms
 ⚠ Fast Refresh had to perform a full reload. Read more: https://nextjs.org/docs/messages/fast-refresh-reload
 GET / 200 in 155ms
 GET /dev-sw.js?dev-sw 200 in 129ms

@pomber
Copy link
Author

pomber commented Nov 27, 2024

Progress regarding CSS:

  • removed autoprefixer
  • added purgecss back, but now its wrapped inside a plugin that ignores globals.css, which shouldn't have unused CSS since Tailwind only adds used CSS
  • the css for the pages router should be the same as before
  • tried cssnano and Lightning CSS to remove duplicated CSS but didn't help too much
  • we are still shipping some redundant CSS in the app router, but it shouldn't be too much, comparing the /docs route before (pages router) and after (app router) the CSS goes from 37.1kb to 40.6kb

@pomber
Copy link
Author

pomber commented Dec 2, 2024

progress so far:

  • docs, cookbook, terminology, and rpc are now using the app router (with placeholder content)
  • customized Fumadocs UI and layout
  • migrated one page (docs/intro/quick-start/deploying-programs), that includes images, steps, accordings, callouts, etc.
  • added a page to show how to use the components from fumadocs

still missing:

@ZYJLiu
Copy link
Contributor

ZYJLiu commented Dec 2, 2024

thanks for the update, the migrated page (/intro/quick-start/deploying-programs) looks good

the navigation for pages under docs/rpc doesn't seem to work clicking between pages.
for example, /docs/rpc/http/getaccountinfo page doesnt display the page content when selected in the sidebar from a different page (directly opening a link to the specific page loads the content though)

is the local routing issue a solveable problem?

@catalinred, could you provide your feedback on the solutions regarding CSS and thoughts on the locale routing issue

@pomber
Copy link
Author

pomber commented Dec 2, 2024

is the local routing issue a solveable problem?

Yes, there's a similar use case that works here: https://github.com/amannn/next-intl/tree/main/examples/example-app-router-migration

I'm going to try that, but with react-i18next instead of next-intl. I'll also use rewrites to handle the default locale.

That solution does require adding a [lang] folder to the pages router and moving all existing pages there, though. It shouldn't cause issues, but it will mean extra testing to ensure that nothing breaks.

@pomber
Copy link
Author

pomber commented Dec 2, 2024

the navigation for pages under docs/rpc doesn't seem to work clicking between pages.

yeah, I'm not yet sure what's happening there (it only happens on Vercel, not locally)

@catalinred
Copy link
Collaborator

@pomber fwiw, let me know if upgrading to next 15 would help in this case regarding the locale routing.

For vis there's this branch I want to merge for a while already #71, but I'm waiting for an upcoming next.js release to have the sass warnings silenced (vercel/next.js#71638 (comment)).

@pomber
Copy link
Author

pomber commented Dec 4, 2024

@pomber fwiw, let me know if upgrading to next 15 would help in this case regarding the locale routing.

I think Next 15 still has the same issue with the i18n config.

I’ve found a middleware that does exactly what we need: https://nimpl.tech/docs/router.

I’ve tested it, and it works well with both the Pages Router and the App Router. I still need to refine the implementation before committing the changes.

These are changes to the pages router, so you can let me know if you spot any potential problems:

  • stop using the i18n config in next.config.mjs
  • move everything (except _app.js, _document.js, and _error.js) from the pages/ to pages/[locale]/
  • for each page
    • add/modify getStaticPaths to include the locale param (we can create a helper to make it a one-line change for most pages)
    • modify getStaticProps to read locale from the params (also we can remove the builderLocale logic that every page is using, it can now be handled directly in _app.js )

@catalinred
Copy link
Collaborator

This feels like a bit of a stretch to me - all these to support both pages and app router.

What do you think about going the other way around and transition everything to app router instead? Wouldn't this be more straightforward in this case?

@pomber
Copy link
Author

pomber commented Dec 5, 2024 via email

@pomber
Copy link
Author

pomber commented Jan 13, 2025

The migration is mostly done. ContentAPI and its dependencies are gone.

This week I'll focus on the remaining work:

@ZYJLiu
Copy link
Contributor

ZYJLiu commented Jan 13, 2025

@catalinred, could you take a look at the current state of the docs migration and provide any feedback you may have

@catalinred
Copy link
Collaborator

@pomber @ZYJLiu I think this looks good overall. Happy to have localization addressed and a new app router layout to rely on from this point moving forward.

A couple of notes from my testing so far:

  • From a styling perspective, the new docs will need some more typography adjustments size, line height etc to get close to the current look and feel. Also this container-docs helper can be removed all together and we can rely on container-* Bootstrap defaults.

  • I noticed some color (green vs purple) inconsistencies for the breadcrumb (e.g. Home>Developers>Guides)when switching the theme color.

  • I wasn't able to yarn build this successfully on my local, encountering some prerender errors e.g. Error occurred prerendering page "/en/docs/rpc". Read more: https://nextjs.org/docs/messages/prerender-error. The Vercel build is ok which is good but wondering if you encountered this too.

  • The hreflangs are not rendered in the new app router layouts but I think @pomber already mentioned this work is in progress. Also noticed some localization inconsistencies between e.g. meta name=description and meta property=og:description if you look at /nl/developers for example.

  • Question regarding the new layout from /src/app/[locale]/layout.tsx: assuming this will be the new layout to create app router pages moving forward such as /src/app/[locale]/test/page, do we really need to wrap the whole layout in RootProvider which is imported from fumadocs-ui/provider? Or we could avoid that and move this wrapper to a dedicated inner layout to apply for the docs/rpc & inner developers pages only.

@pomber
Copy link
Author

pomber commented Jan 15, 2025

Migrated all the docs content. Still working on migrating cookbook, courses, and guides.

@catalinred:

From a styling perspective, the new docs will need some more typography adjustments size, line height etc to get close to the current look and feel. Also this container-docs helper can be removed all together and we can rely on container-* Bootstrap defaults.

May I ask why the font size on solana.com/docs is so large (21px)? Most docs websites use between 16px and 18px. But sure, I’ll adjust it if the idea is to make it look as close as possible to the current style.

I noticed some color (green vs purple) inconsistencies for the breadcrumb (e.g. Home>Developers>Guides)when switching the theme color.

Thanks, fixed.

I wasn't able to yarn build this successfully on my local, encountering some prerender errors e.g. Error occurred prerendering page "/en/docs/rpc". Read more: https://nextjs.org/docs/messages/prerender-error. The Vercel build is ok which is good but wondering if you encountered this too.

I’ve seen that one a couple of times, I think it happened randomly depending on the order Next.js compiles the pages. I think it should be fixed now.

The hreflangs are not rendered in the new app router layouts but I think @pomber already mentioned this work is in progress. Also noticed some localization inconsistencies between e.g. meta name=description and meta property=og:description if you look at /nl/developers for example.

I'll take a look.

Question regarding the new layout from /src/app/[locale]/layout.tsx: assuming this will be the new layout to create app router pages moving forward such as /src/app/[locale]/test/page, do we really need to wrap the whole layout in RootProvider which is imported from fumadocs-ui/provider? Or we could avoid that and move this wrapper to a dedicated inner layout to apply for the docs/rpc & inner developers pages only.

Yes, I'll move it to deeper layouts.

@catalinred
Copy link
Collaborator

why the font size on solana.com/docs is so large (21px)? Most docs websites use between 16px and 18px.

@pomber maybe try updating for now the left and right sidebars font sizes and we can figure out the rest later.
wdyt about container-docs? I think we can remove it all together.

@pomber
Copy link
Author

pomber commented Jan 15, 2025

wdyt about container-docs? I think we can remove it all together.

Not sure I understand. That class makes the docs wider for wider screens, if we remove it the max-width will be 1160px. Currently (with .container-docs) max-width is 1640px.

@catalinred
Copy link
Collaborator

That class makes the docs wider for wider screens, if we remove it the max-width will be 1160px. Currently (with .container-docs) max-width is 1640px.

I know what it does. Similar to the RootProvider item, I think this class needs to be moved to deeper/inner docs layouts.

@nickfrosty
Copy link
Collaborator

this is looking really great @pomber! thanks for all the work here. I was going through this today and noticed some minor things. can we get these updates:

  • the text size in the main content body and the sidebars feels small, especially on a larger screen. can you increase the font size some?
  • at the very top of the left sidebars, there is a shadow that overlays the top most nav link, most noticeable on the cookbook root since the page is
  • can we get a "next/previous page" buttons at the bottom of docs and cookbook? it looks like the guides pages already have it
  • on mobile, headings that have a single back tick code block show as a pink color in the top floating "on this page" component. can you fix? - example page and anchor

we are all super excited to get this massive improvement to the solana-com content live!

how does the locale based content work with this update? in the developer-content repo, we are only commit the english files and pull the translated locales from crowdin. does this change?

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

Successfully merging this pull request may close these issues.

4 participants