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

[examples] Swap Next.js examples between App Router and Pages Router; update naming convention #38204

Merged
merged 7 commits into from
Aug 4, 2023

Conversation

samuelsycamore
Copy link
Member

@samuelsycamore samuelsycamore commented Jul 28, 2023

Closes #38073; part of #34905.

Screenshot 2023-07-31 at 23 02 44

Going forward, users will expect that new Next.js projects follow the App Router pattern. This PR updates the names of the Next.js examples for all Core libs to make the App Router examples the defaults. We should keep the Pages Router examples for the foreseeable future, but flag them instead.

So

  • material-next becomes material-ui-nextjs-pages-router
  • material-next-app-router becomes material-ui-nextjs

Preview: https://github.com/mui/material-ui/tree/39f8250b298537f8aa87a3ec525920b1ddb2fcf7/examples

https://deploy-preview-38204--material-ui.netlify.app/material-ui/getting-started/example-projects/

@samuelsycamore samuelsycamore added docs Improvements or additions to the documentation examples Relating to /examples labels Jul 28, 2023
@samuelsycamore samuelsycamore mentioned this pull request Jul 28, 2023
22 tasks
@github-actions github-actions bot added the PR: out-of-date The pull request has merge conflicts and can't be merged label Jul 29, 2023
@oliviertassinari oliviertassinari changed the title [examples] Change Next.js example names to make App Router the default [examples] Swap Next.js example between App Router and Pages Router Jul 29, 2023
@github-actions github-actions bot removed the PR: out-of-date The pull request has merge conflicts and can't be merged label Jul 31, 2023
@oliviertassinari
Copy link
Member

oliviertassinari commented Jul 31, 2023

I pushed a change who renames more examples, while we are at it:

  • material -> material-ui to be clear, and teach the product names.
  • next -> nextjs to disambiguate between the next tag vs. Next.js.

@github-actions github-actions bot added the PR: out-of-date The pull request has merge conflicts and can't be merged label Aug 1, 2023
@github-actions github-actions bot removed the PR: out-of-date The pull request has merge conflicts and can't be merged label Aug 1, 2023
@samuelsycamore
Copy link
Member Author

Good call @oliviertassinari ! I just added notes to the pages-router examples recommending the App Router re: @mnajdova 's suggestion.

@samuelsycamore samuelsycamore changed the title [examples] Swap Next.js example between App Router and Pages Router [examples] Swap Next.js examples between App Router and Pages Router; update naming convention Aug 1, 2023
@github-actions github-actions bot added the PR: out-of-date The pull request has merge conflicts and can't be merged label Aug 1, 2023
Signed-off-by: Olivier Tassinari <olivier.tassinari@gmail.com>
@github-actions github-actions bot removed the PR: out-of-date The pull request has merge conflicts and can't be merged label Aug 1, 2023
@oliviertassinari
Copy link
Member

We will need to cherry-pick this to production as soon as merged, otherwise, all the links will be broken.

@DiegoAndai
Copy link
Member

@samuelsycamore @oliviertassinari I just released v5.14.3. Let me know how we should proceed about this regarding merging this PR and cherry-picking it to production.

@github-actions github-actions bot added the PR: out-of-date The pull request has merge conflicts and can't be merged label Aug 3, 2023
@samuelsycamore
Copy link
Member Author

@samuelsycamore @oliviertassinari I just released v5.14.3. Let me know how we should proceed about this regarding merging this PR and cherry-picking it to production.

I think we'll have to rely on @oliviertassinari - I'm not sure how to pull this off myself. 😅

@github-actions github-actions bot removed the PR: out-of-date The pull request has merge conflicts and can't be merged label Aug 3, 2023
@oliviertassinari
Copy link
Member

oliviertassinari commented Aug 3, 2023

@DiegoAndai I think that you can merge and follow https://github.com/mui/material-ui/blob/master/scripts/README.md#deploy-documentation-without-a-release, it's up to date.

@oliviertassinari
Copy link
Member

oliviertassinari commented Aug 3, 2023

@samuelsycamore After merging, I think that we could:

  1. Document both, and make it clear both are covered:
Screenshot 2023-08-04 at 00 05 03
  1. Add analytics on the clicks to the different examples, using the data-ga-event-
  2. Reorder the examples based on measured click popularity, for example I would expect Vite before CRA https://npm-stat.com/charts.html?package=%40vitejs%2Fplugin-react&package=react-scripts&from=2022-08-03&to=2023-08-03.

@samuelsycamore
Copy link
Member Author

Alright, I'll go ahead and merge this while it's still up to date and follow the instructions to deploy without a release, then follow up with further improvements to the Examples page in a new PR.

@samuelsycamore samuelsycamore merged commit d18ed7d into mui:master Aug 4, 2023
21 checks passed
richbustos pushed a commit that referenced this pull request Aug 7, 2023
… update naming convention (#38204)

Signed-off-by: Olivier Tassinari <olivier.tassinari@gmail.com>
Co-authored-by: Olivier Tassinari <olivier.tassinari@gmail.com>
@samuelsycamore samuelsycamore deleted the rename-next-examples branch April 3, 2024 17:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Improvements or additions to the documentation examples Relating to /examples nextjs
Projects
None yet
5 participants