Partials: can't be combined with section_id, and the import map is only injected when the page renders a partial

Short description of issue

We’re evaluating partials to replace the Section Rendering API in our theme (variant changes, quick views, upsells). Two limitations block that: requests can’t combine section_id and partials (they return 400), and the @shopify/partial-rendering import map is only injected on pages whose initial render contains a {% partial %}, so content loaded later via AJAX can’t use the package.

Reproduction steps

Issue 1: section_id + partials

  1. Wrap a block of a product section in {% partial 'product-variant-selector' %}.
  2. ?partials=product-variant-selector → 200 (one <template>, 4.1 KB)
  3. ?section_id=<section-id> → 200 (full section, 18.5 KB)
  4. ?section_id=<section-id>&partials=product-variant-selector → 400, empty body
  5. Same with a section outside the template (?section_id=product-modal&partials=…) → 400

Issue 2: import map injection

  1. Open a collection page with no {% partial %} in its initial render.
  2. document.querySelector('script[type="importmap"]') → null
  3. Insert content with partials via AJAX (e.g. a quick view), then import('@shopify/partial-rendering') → fails (specifier can’t be resolved)
  4. On a page that renders a {% partial %}, the import map is present and it works.

Additional info

Why it matters: quick views, upsells and drawers are often rendered via section_id because those sections aren’t in the product template, so they can’t use partials today.

Workarounds:
1. section_id:
An alternate template with {% layout none %}, requested with ?view=modal&partials=… (works, but merchants can see and assign it in the admin).
2. Import map:
An empty {% partial %} in the layout so it’s injected on every page.

Questions:

  • Is section_id + partials planned? If not, could the docs say so and the 400 include an error message?
  • Could the import map be injected on every page, or the docs mention it for dynamically loaded content?

Related (Firefox ignores the import map): @shopify/partial-rendering fails to load in Firefox: import map is output after module scripts in content_for_header

What type of topic is this

Feature request

Hey @MaxX, both of these are current limitations. I can see why the workarounds are awkward for quick views and upsells, especially having to create an extra template that merchants can see and assign.

I’ve submitted both feature requests and linked your full report, which also includes your suggestions for documenting the restrictions and returning a useful error message with the 400 response.

I don’t have a confirmed plan or timeline to share for either change.

Thanks @Yoni-Shopify, much appreciated!

One more thing that would fit the same request: supporting partials wherever the Section Rendering API is supported today, not only with section_id on pages:

  • Cart AJAX API: partials and partials_url parameters, mirroring sections and sections_url, on /cart/add.js, /cart/change.js, /cart/update.js and /cart/clear.js. Bundled section rendering returns the updated HTML in the mutation response (1 request); with partials we’d currently need a second request, so we keep using sections for the cart. partials_url matters even more than sections_url, since a partial is a fragment of a specific page render (e.g. cart lines from /cart, an upsell from the product page).
  • Predictive Search API: partials on /search/suggest, as section_id is today.

This would let themes drop the “technical” sections that only exist to be fetched via AJAX (cart drawer, predictive search results, upsells…) and render fragments of the real templates instead.

Hey @MaxX, I’ve passed on your requests for partials support in Cart AJAX and Predictive Search too.