-
-
Notifications
You must be signed in to change notification settings - Fork 32.2k
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
[docs] Rename the /api/ folder #16752
Conversation
20625ed
to
55a3a79
Compare
Details of bundle changes.Comparing: d4c7c05...55a3a79
|
Do we care about these pages? They are all the same. Should we ignore them? |
@@ -40,6 +40,8 @@ https://material-ui.dev/* https://material-ui.com/:splat 301! | |||
/lab/* /components/:splat 301 | |||
/css-in-js/* /styles/:splat 301 | |||
/premium-themes* https://themes.material-ui.com/ 301 | |||
/api/* /components-api/:splat 301 |
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.
Since this redirects all /api
paths, how would one use the new feature(add an API page)? Would it just be to use some other path manually added to server.js
?
I tried to add an API page yesterday but kept on getting errors, now I see why.
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 haven't thought about it. What would be the use case for us? Maybe we would host it on a different domain?
What does that mean? They rank right behind Have you any information if they consider making the name of the api routes configurable? I get their paradigm but every new feature imposes a new convention that's a breaking change making it hard and harder to use. Especially the generic |
Until we've heard back from |
@eps1lon I have opened an issue on Next.js side: vercel/next.js#8123. We will get a public answer there. I have had a closer look at the SEO situation of Ahrefs stats:/components/ prefix /api/ prefix GA stats for the landing pages Top api keywords:Keywords cannibalization issueFollowing https://www.semrush.com/blog/keyword-cannibalization-harming-on-site-seo/, we might have had a keyword cannibalization issue. Google seems to progressively recognize that the components pages are what people are most of the time looking for. We have some trace of this issue, it might never be completely solved:
Hopefully, as more user clicks on links, Google gets more information and will solve 100% of the cases. Out of this data, I get the following conclusions:
I propose the following short term plan of action:
cc @mbrookes In the long term, we need to find a way to leverage the api backlinks, very important! |
I'm mostly concerned about potential negative impact on renaming so many routes. If this isn't an issue then we can proceed with this approach rather than reverting. I'm still concerned about merging the API into the demo page. It's seemingly nice to have everything in one place as a introduction but for extended usage I wouldn't want to clutter API with examples. Especially since I can't reproduce these search term issues. Normal google, incognito google as well as duckduckgo give me for "material-ui grid" the demo page before the API page. I wouldn't be too concerned with generic search terms such as "grid". In duckduckgo "react grid" gives the components page on the first page. "material paper" gives the component page as well (which is quite impressive tbh, usually "material" is not associated with our library). |
Let's revert to Next v8, there is no need to rush it. the API pages generate 1/4 of our traffic. Might not risk it. |
My fear n°1 is that Google will have to relearn the difference between /components and /components-api if we rename the pages. |
The problem
Next.js v9 introduces the concepts of API pages: https://nextjs.org/blog/next-9#api-routes. The implication is that we can no longer use this
/api/
subfolder name to host our components API. You can see the implication in https://master--material-ui.netlify.com/api/app-bar/: the client-side bundle is missing. While it partially works today, it might not work at all tomorrow; It seems that the server-side part works by luck, the Next.js team didn't design it 🍀.The solution
I have considered 3 options:
After talking with Tim, he would like to avoid option n°3. Option n°2 shouldn't be motivated first by such constraint, so I went with option n°1.