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

Added better detection for absolute urls in link component #9994

Merged
merged 2 commits into from Feb 1, 2023

Conversation

lkwr
Copy link
Contributor

@lkwr lkwr commented Jan 27, 2023

This merge request improves the detection of absolute URLs in the <Link to=".." /> component.

Before this merge request:

<Link to="mailto:remix@example.com" /> will not solve to the correct url because its detected as a relative url.

After this merge request:

<Link to="mailto:remix@example.com" /> will solve to the correct url and opens the mail app depending on the browser.

This uses the same regex as in #9829

@changeset-bot
Copy link

changeset-bot bot commented Jan 27, 2023

🦋 Changeset detected

Latest commit: 9400e9a

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 4 packages
Name Type
react-router-dom Patch
react-router Patch
react-router-dom-v5-compat Patch
react-router-native Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@brophdawg11
Copy link
Contributor

Huh, yeah we had switched this to implementation to use the new regex from #9829 in the original PR but then it looks like it got (potentially accidentally) reverted later in the same PR.

@brophdawg11
Copy link
Contributor

@lkwr Do you mind adding a changeset to this PR via yarn changeset?

@lkwr lkwr force-pushed the lkwr/link-absolute-detection branch from 7966cf0 to 9400e9a Compare January 30, 2023 22:01
@brophdawg11 brophdawg11 self-assigned this Jan 31, 2023
@brophdawg11 brophdawg11 merged commit 80832fb into remix-run:dev Feb 1, 2023
@lkwr lkwr deleted the lkwr/link-absolute-detection branch February 1, 2023 16:27
@brophdawg11
Copy link
Contributor

This is fixed in 6.8.1-pre.0 if you want to give that spin to confirm. If all goes well we should have the stable release out tomorrow or early next week.

@lkwr
Copy link
Contributor Author

lkwr commented Feb 3, 2023

I just tested it and it works like a charm.

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

Successfully merging this pull request may close these issues.

None yet

4 participants