Releases: getnacelle/nacelle-js
@nacelle/[email protected]
Patch Changes
- c661342: Added
__typename
to fragments - Updated dependencies [6f2e5f1]
- @nacelle/[email protected]
@nacelle/[email protected]
Patch Changes
- 254f5b0: Fixes an internal issue with
@nacelle/storefront-sdk
's build process, which was causing some external package code to be inadvertently bundled in the@nacelle/storefront-sdk
package code. This issue both increased the package size and caused issues in Nuxt 2 projects.
@nacelle/[email protected]
Patch Changes
- 9cdc2e2: Updates the Storefront SDK internals to rely on the most recent version of
@urql/exchange-persisted
. This should speed up the time it takes to install@nacelle/storefront-sdk
, because we no longer have to patch@urql/exchange-persisted
withpatch-package
. - f3a05ca: Adds an
x-nacelle-sdk-version
header to all requests. This improves tracing and observability in the event of a support request.
@nacelle/[email protected]
Major Changes
-
650c0ac: The Storefront SDK accepts a new
fetchClient
intialization parameter. You can use this to pass a custom fetch client to the Storefront SDK; it will be used in all Nacelle Storefront GraphQL requests.BREAKING: The Storefront SDK no longer accepts
token
,currencyCode
,connector
,debugMode
,onDataError
,subscriptionEndpoint
,subscriptionToken
, norsubscriptionSpaceId
in the client initialization parameters. These properties are also no longer included in the return value of thegetConfig
method. -
650c0ac: Adds an
exchanges
property to the Storefront SDK's initialization parameters. This new parameter allows Storefront SDK users to explicitly specify custom urql exchanges. All exchanges used by the Storefront SDK's urql client are now exported individually and as a pre-configured array ofdefaultExchanges
. ThesetConfig
parameter no longer allows APQ functionality to be changed on-the-fly. APQ can only be disabled by explicitly excluding thepersistedFetchExchange
in the exchanges array provided to theexchanges
initialization parameter. -
650c0ac: Generate TypeScript types from the Nacelle Storefront GraphQL schema.
-
650c0ac: BREAKING: Storefront SDK methods other than
.query
,.after
,.getConfig
and.setConfig
are no longer included in@nacelle/storefront-sdk
. Other methods from@nacelle/[email protected]
such as.products
,.content
etc. will be provided by a Storefront SDK plugin. -
650c0ac: Breaking change:
advancedOptions
andenableAPQ
are removed from theStorefrontClientParams
, and will be replaced with the ability for the SDK users to pass their own exchanges as params instead, including the@urql/exchange-persisted
exchange which enables APQ. Seeurql
documentation for more information about the persisted query exchange: https://formidable.com/open-source/urql/docs/advanced/persistence-and-uploads/ -
650c0ac: Improves the
.query
method.- Adds support for tagged template literals via the
gql
helper function - Adds support for
TypedDocumentNodes
for strongly typed queries/responses. More info onTypedDocumentNodes
and how to use them. - Returns
{data,error}
so errors can be handled in code instead of throwing on errors. For users wanting to get the data directly and throw on response errors, can use anafter
method like this:
sdkClient.after('query', (response) => { if (response.error) { throw new Error(response); } else { return response.data; } });
- Adds support for tagged template literals via the
-
650c0ac: Adds persisted query support for all queries. This sends all requests as hashed
get
requests to take advantage of server-side caching in Nacelle's v2 infrastructure.
Minor Changes
- 650c0ac: Exposes new withConfig type that plugin authors can take advantage of to get access to the
getConfig
method of the sdk. - 650c0ac: The
.after
method offers callback deletion and an improved TypeScript experience. Callbacks can now be registered with acallbackId
. To delete a callback, providenull
as the callback value, along with thecallbackId
of the callback you'd like to delete. In TypeScript projects, the.after
method'smethod
argument provides autocomplete with all of the possible values. After specifying themethod
, the.after
method'scallback
argument is aware of the type signature that's specific to themethod
of interest. - 650c0ac: Adds a trace id to the
error
key in the response. This trace id should be included in any support requests.
Patch Changes
- 650c0ac: Updated the
query
method to always send variables to the Storefront GraphQL API as objects, even if they are supplied to thequery
method as a stringified object. This change circumvents issues related to using a combination of APQ and stringified variables in Nacelle's Storefront GraphQL. - 650c0ac: Removed the
Storefront
function that initialized the Storefront SDK. Instead, the SDK is initialized by creating a new instance of theStorefrontClient
class. - 650c0ac: Updated the README to advertise features and link to the Nacelle docs
- 650c0ac: Refactored the
after
method to make it agnostic to the return types of methods defined by Storefront SDK plugins. - 650c0ac: Fixes Storefront SDK type definition resolution in native ESM projects
- 650c0ac: Fixed an issue that prevented the Storefront SDK from entering preview mode when initializing the client with a
previewToken
. - 650c0ac: Fixed a TypeScript issue that was creating an undesirable coupling between the Storefront SDK and Commerce Queries plugin.
- 650c0ac: Fixed an issue with header names that was preventing the Storefront SDK from entering preview mode.
- 650c0ac: Upgraded the package internals to use
@urql/core
major version 4. This removes the dependency on thegraphql
package. - 74bbbaf: Patches the internals of
@urql/exchange-persisted
to prevent issues with large queries.
@nacelle/[email protected]
Minor Changes
- 650c0ac: Adds a
content
method to fetch theallContent
data. Unlike thecontent
method in the@nacelle/[email protected]
, this returns a result object with the signature{ error, data }
similar to how thequery
method works in@nacelle/[email protected]
to allow users more control over error handling. - 650c0ac: Adds the products method to fetch products from your Nacelle index
- 650c0ac: Added the
productCollections
method, which fetches data from a Nacelle space's collections index. - 650c0ac: Exports the generated types from the Storefront GraphQL for use in Typescript projects
Patch Changes
- 650c0ac: Added the
productCollectionEntries
method, which fetches product entries from a Nacelle space's collection. - 650c0ac: Updated the README to advertise features and link to the Nacelle docs
- 650c0ac: In TypeScript projects, the
.content
,.products
,.productCollections
, and.productCollectionEntries
methods no longer require type assertions on their return values. The type will be inferred based on the value ofparams.edgesToNodes
. - 650c0ac: Adds error handling to commerce queries & makes commerce queries return data directly instead of
{ data, error }
- 650c0ac: Updates types to avoid TypeScript errors during the build process
- 650c0ac: Updated the name of the plugin (named export) from
commerceQueriesPlugin
toCommerceQueries
. - 650c0ac: Fixed a TypeScript issue that was creating an undesirable coupling between the Storefront SDK and Commerce Queries plugin.
- 650c0ac: Add
navigation
method to fetch navigation data from a Nacelle space. - 650c0ac: Add
spaceProperties
method to fetch space properties from a Nacelle space. - 650c0ac: Removes
graphql
as an explicit peer dependency. - Updated dependencies [650c0ac]
- Updated dependencies [650c0ac]
- Updated dependencies [650c0ac]
- Updated dependencies [650c0ac]
- Updated dependencies [650c0ac]
- Updated dependencies [650c0ac]
- Updated dependencies [650c0ac]
- Updated dependencies [650c0ac]
- Updated dependencies [650c0ac]
- Updated dependencies [650c0ac]
- Updated dependencies [650c0ac]
- Updated dependencies [650c0ac]
- Updated dependencies [650c0ac]
- Updated dependencies [650c0ac]
- Updated dependencies [650c0ac]
- Updated dependencies [650c0ac]
- Updated dependencies [650c0ac]
- Updated dependencies [74bbbaf]
- Updated dependencies [650c0ac]
- Updated dependencies [650c0ac]
- @nacelle/[email protected]
@nacelle/[email protected]
@nacelle/[email protected]
Patch Changes
- 9ee3670: Updates types to avoid TypeScript errors during the build process
@nacelle/[email protected]
Major Changes
- 3dc75b3: Adds an
exchanges
property to the Storefront SDK's initialization parameters. This new parameter allows Storefront SDK users to explicitly specify custom urql exchanges. All exchanges used by the Storefront SDK's urql client are now exported individually and as a pre-configured array ofdefaultExchanges
. BREAKING ThesetConfig
parameter no longer allows APQ functionality to be changed on-the-fly. APQ can only be disabled by explicitly excluding thepersistedFetchExchange
in the exchanges array provided to theexchanges
initialization parameter. - a5347d7 BREAKING:
advancedOptions
andenableAPQ
are removed from theStorefrontClientParams
, and will be replaced with the ability for the SDK users to pass their own exchanges as params instead, including the@urql/exchange-persisted
exchange which enables APQ. Seeurql
documentation for more information about the persisted query exchange: https://formidable.com/open-source/urql/docs/advanced/persistence-and-uploads/
@nacelle/[email protected]
Patch Changes
- Updated dependencies [3dc75b3]
- Updated dependencies [a5347d7]
- @nacelle/[email protected]
@nacelle/[email protected]
Patch Changes
- 3ed07d8: Updated peer dependencies to reduce conflicts with React versions in Sanity Studio v2 projects.