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

Move getStablePath method into the "url" package #35799

Closed
3 tasks
anton-vlasenko opened this issue Oct 20, 2021 · 0 comments · Fixed by #35992
Closed
3 tasks

Move getStablePath method into the "url" package #35799

anton-vlasenko opened this issue Oct 20, 2021 · 0 comments · Fixed by #35992
Labels
Good First Issue An issue that's suitable for someone looking to contribute for the first time [Package] API fetch /packages/api-fetch [Package] Url /packages/url [Type] Enhancement A suggestion for improvement.

Comments

@anton-vlasenko
Copy link
Contributor

anton-vlasenko commented Oct 20, 2021

What problem does this address?

Both createPreloadingMiddleware and createMenuPreloadingMiddleware functions need to be able to call the getStablePath method.
As of now, we have some duplicate code (2 getStablePath methods defined).
See this and that for reference.
More context can be found here: https://github.com/WordPress/gutenberg/pull/35402/files#r728631767

What is your proposed solution?

  • Move getStablePath into the url package (and possible rename it to normalizeQueryString).
  • Import normalizeQueryString function from the url package and use it for createPreloadingMiddleware and createMenuPreloadingMiddleware instead of getStablePath
  • Delete getStablePath method (check if it used elsewhere in the project first).
@anton-vlasenko anton-vlasenko added Good First Issue An issue that's suitable for someone looking to contribute for the first time [Type] Enhancement A suggestion for improvement. labels Oct 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Good First Issue An issue that's suitable for someone looking to contribute for the first time [Package] API fetch /packages/api-fetch [Package] Url /packages/url [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant