-
Notifications
You must be signed in to change notification settings - Fork 529
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
Update the nextjs default middleware matcher #1275
Conversation
Hey, here’s your docs preview: https://clerk.com/docs/pr/1275 |
2ac32e5
to
0cb0444
Compare
Hey, here’s your docs preview: https://clerk.com/docs/pr/1275 |
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.
Just a couple small things
'/((?!_next|[^?]*\\.(?:html?|css|js(?!on)|jpe?g|webp|png|gif|svg|ttf|woff2?|ico|csv|docx?|xlsx?|zip|webmanifest)).*)', | ||
// Always run for API routes | ||
'/(api|trpc)(.*)', | ||
], |
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.
Do we want to replace with the commented version everywhere? At the moment, we have a commented version explaining the regex in the main docs, but in other places that it's referenced in code examples, we leave out the comments
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.
The quickstart guide didn't have comments before and I guess this is where most people learn about the matcher, that's why I included the comments there. Why woudln't we want the comments everywhere? People would probably just copy and paste the matcher when they find it I guess
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 say let's be consistent and keep the comments everywhere - we never know where exactly in the docs someone might be copying and pasting code from and comments don't hurt
'/((?!_next|[^?]*\\.(?:html?|css|js(?!on)|jpe?g|webp|png|gif|svg|ttf|woff2?|ico|csv|docx?|xlsx?|zip|webmanifest)).*)', | ||
// Always run for API routes | ||
'/(api|trpc)(.*)', | ||
], |
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 say let's be consistent and keep the comments everywhere - we never know where exactly in the docs someone might be copying and pasting code from and comments don't hurt
Explanation:
For more context, please refer to clerk/javascript#3741
This PR: