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

feat(routing): replace getLocation with getCurrentURL #6477

Merged
merged 1 commit into from
Dec 20, 2024

Conversation

Haroenv
Copy link
Contributor

@Haroenv Haroenv commented Dec 17, 2024

getCurrentURL is the alternative of getLocation in the history router. This is changed as it's possible to create a URL out of a string, but not a location. We also don't use any properties of the location that aren't also present in a URL.

FX-3193

BREAKING CHANGE: change from getLocation to getCurrentURL, and return a URL object.
BREAKING CHANGE: createURL createURL now receives currentURL instead of location
BREAKING CHANGE: parseURL createURL now receives currentURL instead of location

getCurrentURL is the alternative of getLocation in the history router. This is changed as it's possible to create a URL out of a string, but not a location. We also don't use any properties of the location that aren't also present in a URL.

[FX-3191]

BREAKING CHANGE: change from `getLocation` to `getCurrentURL`, and return a URL object.
BREAKING CHANGE: createURL createURL now receives `currentURL` instead of `location`
BREAKING CHANGE: parseURL createURL now receives `currentURL` instead of `location`
@Haroenv Haroenv added this to the instantsearch.js v5 milestone Dec 17, 2024
Copy link

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 0b6ac5a:

Sandbox Source
example-instantsearch-getting-started Configuration
example-react-instantsearch-getting-started Configuration
example-react-instantsearch-next-app-dir-example Configuration
example-react-instantsearch-next-routing-example Configuration
example-vue-instantsearch-getting-started Configuration

@Haroenv Haroenv requested review from dhayab and sarahdayan December 18, 2024 09:15
Copy link
Member

@dhayab dhayab left a comment

Choose a reason for hiding this comment

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

So much simpler, thanks!

@Haroenv
Copy link
Contributor Author

Haroenv commented Dec 20, 2024

I believe this also makes the ecom routing example possible to be simpler but I didn't want to untangle it in this pr yet

@Haroenv Haroenv merged commit d4895c8 into next Dec 20, 2024
11 checks passed
@Haroenv Haroenv deleted the feat/routing-get-current-url branch December 20, 2024 08:07
Haroenv added a commit that referenced this pull request Dec 26, 2024
getCurrentURL is the alternative of getLocation in the history router. This is changed as it's possible to create a URL out of a string, but not a location. We also don't use any properties of the location that aren't also present in a URL.

[FX-3191]

BREAKING CHANGE: change from `getLocation` to `getCurrentURL`, and return a URL object.
BREAKING CHANGE: createURL createURL now receives `currentURL` instead of `location`
BREAKING CHANGE: parseURL createURL now receives `currentURL` instead of `location`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants