a195284c7b
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
1.2 KiB
1.2 KiB
@backstage/core-plugin-api
| @backstage/core-plugin-api |
|---|
| minor |
BREAKING CHANGE The StorageApi has received several updates that fills in gaps for some use-cases and makes it easier to avoid mistakes:
- The
StorageValueChangetype has been renamed toStorageValueSnapshot, thenewValueproperty has been renamed tovalue, the stored value type has been narrowed toJsonValue, and it has received a newpresenceproperty that is'unknown','absent', or'present'. - The
getmethod has been deprecated in favor of a newsnapshotmethod, which returns aStorageValueSnapshot. - The
observe$method has had its contract changed. It should now emit values when thepresenceof a key changes, this may for example happen when remotely stored values are requested on page load and the presence switches from'unknown'to either'absent'or'present'.
The above changes have been made with deprecations in place to maintain much of the backwards compatibility for consumers of the StorageApi. The only breaking change is the narrowing of the stored value type, which may in some cases require the addition of an explicit type parameter to the get and observe$ methods.