Improvements
Adds two free-function helpers to @bloomreach/spa-sdk that collapse manual, multi-step reference resolution into a single call:
getImage(page, reference, variant?)— resolves an image reference straight to a concreteImage, instead ofpage.getContent<ImageSet>(ref)followed by a separate.getVariant()/.getOriginal()call.
Before
const imageSet = imageRef && page.getContent<ImageSet>(imageRef);
const image = imageSet && (imageVariant ? imageSet.getVariant(imageVariant) : imageSet.getOriginal());After
const image = getImage(page, imageRef, imageVariant);getDocuments(page, references)— resolves an array of references (e.g. pagination items) to documents in one call, filtering out anything unresolvable instead of requiring a manual.map()with a force-cast.
Before
{pageable.items.map((reference, key) => (
<NewsListItem key={key} item={page.getContent<Document>(reference) as Document} page={page} />
))}After
{getDocuments(page, pageable.items).map((item, key) => (
<NewsListItem key={key} item={item} page={page} />
))}Bug Fixes
- SPA SDK does not handle the endpoint URL correctly when it contains an explicit default port (:443/:80). The slash between the host and path is removed, producing an invalid URL.
- #54: When editing a component document in Channel Manager preview, the page reloads and Experience Manager attempts to restore scroll position to the edited component. With many asynchronous components (50+), restoration is inconsistent: the page can scroll to the wrong component.
Important
This fix only works with CMS version 17.2.0 and later.
Full Changelog: spa-sdk-28.0.0...spa-sdk-28.1.0