Skip to content

Conversation

@jimchamp
Copy link
Collaborator

@jimchamp jimchamp commented Jul 19, 2025

Closes #11040
Closes #10984

Replaces the buildPartialsUrl path parameter with component. Makes params optional, for partials requests that require no query parameters (aside from _component).

Technical

Testing

Screenshot

Stakeholders

@codecov-commenter
Copy link

Codecov Report

Attention: Patch coverage is 0% with 12 lines in your changes missing coverage. Please review.

Project coverage is 17.02%. Comparing base (e027195) to head (83df071).
Report is 290 commits behind head on master.

Files with missing lines Patch % Lines
openlibrary/plugins/openlibrary/js/utils.js 0.00% 3 Missing ⚠️
...nlibrary/plugins/openlibrary/js/book-page-lists.js 0.00% 2 Missing ⚠️
...nlibrary/plugins/openlibrary/js/affiliate-links.js 0.00% 1 Missing ⚠️
...ibrary/plugins/openlibrary/js/carousel/Carousel.js 0.00% 1 Missing ⚠️
...nlibrary/plugins/openlibrary/js/check-ins/index.js 0.00% 1 Missing ⚠️
...ugins/openlibrary/js/fulltext-search-suggestion.js 0.00% 1 Missing ⚠️
...penlibrary/plugins/openlibrary/js/lazy-carousel.js 0.00% 1 Missing ⚠️
...ibrary/plugins/openlibrary/js/lists/ListService.js 0.00% 1 Missing ⚠️
openlibrary/plugins/openlibrary/js/search.js 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master   #11042      +/-   ##
==========================================
- Coverage   17.14%   17.02%   -0.13%     
==========================================
  Files          91       92       +1     
  Lines        4981     5022      +41     
  Branches      867      875       +8     
==========================================
+ Hits          854      855       +1     
- Misses       3588     3622      +34     
- Partials      539      545       +6     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions github-actions bot added the Needs: Response Issues which require feedback from lead label Jul 19, 2025
@cdrini cdrini requested a review from Copilot July 22, 2025 15:31
Copy link
Contributor

Copilot AI left a 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 buildPartialsUrl API 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

Copy link
Collaborator

@cdrini cdrini left a 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

@cdrini cdrini merged commit 1d55b73 into internetarchive:master Jul 22, 2025
3 checks passed
@jimchamp jimchamp deleted the 11040/refactor/buildPartialsUrl branch July 23, 2025 21:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Needs: Response Issues which require feedback from lead

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Update buildPartialsUrlfor single /partials.json endpoint Consolidate /partials endpoints

3 participants