Releases: Automattic/fresh-data
Pre-release of underlying refactor
This is a pre-release of a pretty major refactor. Instead of tracking component requirements through their lifecycle, this release depends on the re-render of connected components to update requirements regularly. See #203 for details.
v0.5.0 pre-release - @wordpress/data compatibility
This release adds compatibility for @wordpress/data in the form of functions on the ApiClient class:
getSelectors( componentReqirements )
clearCompoentRequirements( component )
setCompoentRequirements( component, componentRequirements )
These functions allow roughly the same behavior as setComponentData
before, but better integrates with the flow of @wordpress/data
's select
functionality.
0.4.0 release - Simplified api spec
This release simplifies the API spec given to fresh-data.
It removes the methods in favor of just pre-loading operations with the methods needed.
Additionally, this version changes the license from GPL v2.0+ to MIT for broader application usage.
0.2.0 Release - API updates
Changes affecting apis using fresh-data
:
-
Instead of
( getData, requireData )
, selectors are now given
( getResource, requireResource )
. Both of these functions return the
state of the resource by its given key.
a.getResource( resourceName )
returns resource state in the format
of{ data, error, lastReceived, lastRequested, lastError }
. All
properties of that state are optional and may not be present, but
getResource
will always return an object, even if it's empty.
b.requireResource( requirement, resourceName )
sets a component
requirement for the given resource, and then returns resource state in
the same manner asgetResource
. -
mutations now return proper promises, which can be used to handle
success and failure callbacks via a Promiseresolve/reject
, or by
usingasync/await
. -
Within the client class,
methods
,operations
,mutations
, and
selectors
are no longer static members, but members of the object
instance. This provides greater flexibility in API implementation by
allowing things such as passingmethods
in via a constructor.
Initial release
This is the initial release of the Fresh Data framework!