-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Update buildPartialsUrl for single /partials.json endpoint
#11042
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 buildPartialsUrl for single /partials.json endpoint
#11042
Conversation
for more information, see https://pre-commit.ci
Codecov ReportAttention: Patch coverage is
Additional details and impacted files☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
Pull Request Overview
This PR refactors the buildPartialsUrl function to standardize on a single /partials.json endpoint by replacing the path parameter with a component parameter and making params optional. The function now automatically sets the _component query parameter instead of requiring callers to include it manually.
- Simplified
buildPartialsUrlAPI by replacing path parameter with component parameter - Made params parameter optional with default empty object
- Updated all call sites to use the new API signature
Reviewed Changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| openlibrary/plugins/openlibrary/js/utils.js | Modified buildPartialsUrl function signature and implementation |
| openlibrary/plugins/openlibrary/js/search.js | Updated function call to use new API |
| openlibrary/plugins/openlibrary/js/lists/ListService.js | Updated function call to use new API |
| openlibrary/plugins/openlibrary/js/lazy-carousel.js | Updated function call to use new API |
| openlibrary/plugins/openlibrary/js/fulltext-search-suggestion.js | Updated function call to use new API |
| openlibrary/plugins/openlibrary/js/check-ins/index.js | Updated function call to use new API |
| openlibrary/plugins/openlibrary/js/carousel/Carousel.js | Updated function call to use new API |
| openlibrary/plugins/openlibrary/js/book-page-lists.js | Updated function call to use new API |
| openlibrary/plugins/openlibrary/js/affiliate-links.js | Updated function call to use new API |
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.
Lgtm, great cleanup! Tested:
- facets on search page load
- lazy carousels load
- lists load
- prices section loads
- search inside card loads
Closes #11040
Closes #10984
Replaces the
buildPartialsUrlpathparameter withcomponent. Makesparamsoptional, for partials requests that require no query parameters (aside from_component).Technical
Testing
Screenshot
Stakeholders