Summary
Do the same changes done for Prices and Skus: deprecate AvailabilityContainer and make the Availability component standalone, so it can fetch data without requiring a container parent.
Work
- Deprecate
<AvailabilityContainer> (keep backwards-compatible)
- Make
<Availability> standalone — accepts skuCode prop and auto-fetches availability without a container
- Reuse/extend the shared
createBatchStore pattern from @commercelayer/core if batching is needed, or use SWR-based single-item fetching (similar to useSkuList)
- Update
useAvailability hook if needed
- Update docs/stories with standalone usage examples
Reference
Summary
Do the same changes done for
PricesandSkus: deprecateAvailabilityContainerand make theAvailabilitycomponent standalone, so it can fetch data without requiring a container parent.Work
<AvailabilityContainer>(keep backwards-compatible)<Availability>standalone — acceptsskuCodeprop and auto-fetches availability without a containercreateBatchStorepattern from@commercelayer/coreif batching is needed, or use SWR-based single-item fetching (similar touseSkuList)useAvailabilityhook if neededReference
<Sku>standalone (✨ feat(skus): standalone Sku component, deprecate SkusContainer, shared debounce batch store #757)<SkuList>standalone (✨ feat(skus): standalone Sku component, deprecate SkusContainer, shared debounce batch store #757)createBatchStorealready available in@commercelayer/core