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

fix: Incorporate basePath correctly in useRouter functions #906

Merged
merged 5 commits into from
Mar 5, 2024

Conversation

Oberwaditzer
Copy link
Contributor

@Oberwaditzer Oberwaditzer commented Mar 2, 2024

Fixes #905
Fixes #910

Copy link

vercel bot commented Mar 2, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
next-intl-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 5, 2024 8:28am
next-intl-example-app-router ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 5, 2024 8:28am

Copy link

vercel bot commented Mar 2, 2024

@Oberwaditzer is attempting to deploy a commit to the next-intl Team on Vercel.

A member of the Team first needs to authorize it.

@Oberwaditzer Oberwaditzer force-pushed the fix/905-router-push-with-basepath branch from 89b8705 to e943940 Compare March 2, 2024 13:37
@Oberwaditzer Oberwaditzer changed the title Added pathname from NextJS to useBaseRouter for basePath support fix: added pathname from NextJS to useBaseRouter for basePath support Mar 2, 2024
Copy link
Owner

@amannn amannn left a comment

Choose a reason for hiding this comment

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

Hey, thanks for proposing this PR! Can you add a regression test that demonstrates the previously broken behavior?

@Oberwaditzer
Copy link
Contributor Author

Hey @amannn,
I added some tests. If something is missing, please let me know :)

 - Share logic for extracting base path
 - Fix mocked location to streamline implementation
 - Clear mocks in test for regression test to work reliably
 - Bump sizes
@amannn
Copy link
Owner

amannn commented Mar 5, 2024

Thanks for adding the tests! I had another look and found a few things to clean up along the way: Oberwaditzer#1. Mind merging this into your branch?

@Oberwaditzer
Copy link
Contributor Author

Thanks for adding the tests! I had another look and found a few things to clean up along the way: Oberwaditzer#1. Mind merging this into your branch?

@amannn Done :)

@amannn amannn changed the title fix: added pathname from NextJS to useBaseRouter for basePath support fix: Incorporate basePath correctly in useRouter functions Mar 5, 2024
Copy link
Owner

@amannn amannn left a comment

Choose a reason for hiding this comment

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

Thank you so much @Oberwaditzer! 🙌

@amannn amannn merged commit 4abcbeb into amannn:main Mar 5, 2024
6 checks passed
@amannn
Copy link
Owner

amannn commented Mar 5, 2024

@Oberwaditzer Oh no way, you're from Vorarlberg too? So cool, keep up the good work! 🙌

@Oberwaditzer
Copy link
Contributor Author

@amannn The world is small.. 😅 But very cool to see that someone from little Vorarlberg has created such a library! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants