-
Notifications
You must be signed in to change notification settings - Fork 25
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
base: main
Are you sure you want to change the base?
Add Fumadocs #111
Conversation
@pomber is attempting to deploy a commit to the Solana Foundation Team on Vercel. A member of the Team first needs to authorize it. |
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
There is also currently a bunch of "webpack-internal" warnings when running locally |
There was a problem hiding this 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", |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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", |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
postcss.config.js
Outdated
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
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. |
What are the errors? these? I think those were there from before, I can take a look if you want. I'm guessing they come from |
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.
|
Progress regarding CSS:
|
progress so far:
still missing:
|
thanks for the update, the migrated page ( the navigation for pages under docs/rpc doesn't seem to work clicking between pages. 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 |
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 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. |
yeah, I'm not yet sure what's happening there (it only happens on Vercel, not locally) |
@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 |
I think Next 15 still has the same issue with the 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:
|
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? |
This is a draft PR showing how to use fumadocs as the docs framework.
/docs
path (with placeholder content)TODO
@ts-ignore
annotations that can be removed after the old docs framework is replaced (because of some conflicts between different versions ofmdx/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 likecssnano
to remove any duplicated CSS (like tailwind's preflight styles)