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

Moving middleware file #36009

Merged
merged 8 commits into from Apr 11, 2022
Merged

Moving middleware file #36009

merged 8 commits into from Apr 11, 2022

Conversation

timeyoutakeit
Copy link
Contributor

@timeyoutakeit timeyoutakeit commented Apr 8, 2022

This PR fixes a request from @rauchg that we specify more clearly that Middleware is Beta and organize it properly within the navigation.

Bug

  • Related issues linked using fixes #number
  • Integration tests added
  • Errors have helpful link attached, see contributing.md

Feature

  • Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
  • Related issues linked using fixes #number
  • Integration tests added
  • Documentation added
  • Telemetry added. In case of a feature if it's used or not.
  • Errors have helpful link attached, see contributing.md

Documentation / Examples

  • Make sure the linting passes by running yarn lint

docs/manifest.json Outdated Show resolved Hide resolved
Co-authored-by: JJ Kasper <jj@jjsweb.site>
@timeyoutakeit timeyoutakeit added the created-by: Next.js docs team PRs by the Next.js docs team label Apr 8, 2022
@@ -142,10 +142,6 @@
}
]
},
{
"title": "Middleware",
"path": "/docs/middleware.md"
Copy link
Member

Choose a reason for hiding this comment

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

Looks like we want to keep this entry and update the path to /docs/advanced-features/middleware.md to go along with the redirect. This should resolve the failing check here https://github.com/vercel/next.js/runs/5888873149?check_suite_focus=true#step:4:5

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@ijjk Ahh, thank you! I was getting a little confused around how redirects work for these docs. So I understand for the future when we want to move something:

  • Keep the location but update the path to where we want it? (Will this make it confusing for someone coming to the file in the future if this file doesn't mimic the site nav?)
  • The path and redirect path should be the same, but that path uses the .md file type?

Copy link
Member

Choose a reason for hiding this comment

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

So for non-redirect paths it should have the .md extension and points to a file in the docs folder, this is what the lint step is mainly checking for to ensure we don't forget to add manifest entries or have typos.

For redirect paths it doesn't need to have .md as it's matching the path directly without checking the filesystem and the lint step doesn't check these. The destination for the redirect can be any url so if we need to move docs to another site we can e.g. https://vercel.com/docs/some/path but in this case it can just be /docs/advanced-features/middleware since it's the same site.

Seems like it would be good to add this to our contributing, I'll create a PR with notes on this and request your review.

Copy link
Member

Choose a reason for hiding this comment

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

Opened PR with the above info here #36020

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@ijjk Thank you so much for taking the time to explain this. The added example in the contributing doc was super helpful!

@kodiakhq kodiakhq bot merged commit 9a7d175 into vercel:canary Apr 11, 2022
@timeyoutakeit timeyoutakeit deleted the middleware-updates branch April 11, 2022 14:31
@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 12, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
created-by: Next.js docs team PRs by the Next.js docs team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants