Changelog
@nacelle/storefront-sdk
2.0.3
Patch Changes
- 6f2e5f1: Updated the default request retry logic to retry in response to all network errors. To customize request retry logic, you can provide your own configured instance of
@urql/exchange-retryto the Storefront SDK'sexchangesparameter.
2.0.2
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-sdkpackage code. This issue both increased the package size and caused issues in Nuxt 2 projects.
2.0.1
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-persistedwithpatch-package. - f3a05ca: Adds an
x-nacelle-sdk-versionheader to all requests. This improves tracing and observability in the event of a support request.
2.0.0
Major Changes
-
650c0ac: The Storefront SDK accepts a new
fetchClientintialization 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, norsubscriptionSpaceIdin the client initialization parameters. These properties are also no longer included in the return value of thegetConfigmethod. -
650c0ac: Adds an
exchangesproperty 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. ThesetConfigparameter no longer allows APQ functionality to be changed on-the-fly. APQ can only be disabled by explicitly excluding thepersistedFetchExchangein the exchanges array provided to theexchangesinitialization parameter. -
650c0ac: Generate TypeScript types from the Nacelle Storefront GraphQL schema.
-
650c0ac: BREAKING: Storefront SDK methods other than
.query,.after,.getConfigand.setConfigare no longer included in@nacelle/storefront-sdk. Other methods from@nacelle/[email protected]such as.products,.contentetc. will be provided by a Storefront SDK plugin. -
650c0ac: Breaking change:
advancedOptionsandenableAPQare 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-persistedexchange which enables APQ. Seeurqldocumentation for more information about the persisted query exchange: https://formidable.com/open-source/urql/docs/advanced/persistence-and-uploads/ -
650c0ac: Improves the
.querymethod.- Adds support for tagged template literals via the
gqlhelper function - Adds support for
TypedDocumentNodesfor strongly typed queries/responses. More info onTypedDocumentNodesand 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 anaftermethod 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
getrequests 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
getConfigmethod of the sdk. - 650c0ac: The
.aftermethod offers callback deletion and an improved TypeScript experience. Callbacks can now be registered with acallbackId. To delete a callback, providenullas the callback value, along with thecallbackIdof the callback you'd like to delete. In TypeScript projects, the.aftermethod'smethodargument provides autocomplete with all of the possible values. After specifying themethod, the.aftermethod'scallbackargument is aware of the type signature that's specific to themethodof interest. - 650c0ac: Adds a trace id to the
errorkey in the response. This trace id should be included in any support requests.
Patch Changes
- 650c0ac: Updated the
querymethod to always send variables to the Storefront GraphQL API as objects, even if they are supplied to thequerymethod 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
Storefrontfunction that initialized the Storefront SDK. Instead, the SDK is initialized by creating a new instance of theStorefrontClientclass. - 650c0ac: Updated the README to advertise features and link to the Nacelle docs
- 650c0ac: Refactored the
aftermethod 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/coremajor version 4. This removes the dependency on thegraphqlpackage. - 74bbbaf: Patches the internals of
@urql/exchange-persistedto prevent issues with large queries.
2.0.0-beta.10
Patch Changes
- 6388dbf: Updated the README to advertise features and link to the Nacelle docs
- 092c20f: Upgraded the package internals to use
@urql/coremajor version 4. This removes the dependency on thegraphqlpackage.
2.0.0-beta.9
Major Changes
- 3dc75b3: Adds an
exchangesproperty 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 ThesetConfigparameter no longer allows APQ functionality to be changed on-the-fly. APQ can only be disabled by explicitly excluding thepersistedFetchExchangein the exchanges array provided to theexchangesinitialization parameter. - a5347d7 BREAKING:
advancedOptionsandenableAPQare 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-persistedexchange which enables APQ. Seeurqldocumentation for more information about the persisted query exchange: https://formidable.com/open-source/urql/docs/advanced/persistence-and-uploads/
2.0.0-beta.8
Patch Changes
- e4f1944: Fixed an issue with header names that was preventing the Storefront SDK from entering preview mode.
2.0.0-beta.7
Patch Changes
- 8e4273f: Fixed an issue that prevented the Storefront SDK from entering preview mode when initializing the client with a
previewToken.
2.0.0-beta.6
Patch Changes
- 526702d: Refactored the
aftermethod to make it agnostic to the return types of methods defined by Storefront SDK plugins.
2.0.0-beta.5
Patch Changes
- e62c21a: Updated the
querymethod to always send variables to the Storefront GraphQL API as objects, even if they are supplied to thequerymethod as a stringified object. This change circumvents issues related to using a combination of APQ and stringified variables in Nacelle's Storefront GraphQL.
2.0.0-beta.4
Patch Changes
- b166f21: Fixed a TypeScript issue that was creating an undesirable coupling between the Storefront SDK and Commerce Queries plugin.
2.0.0-beta.3
Patch Changes
- 7338444: Removed the
Storefrontfunction that initialized the Storefront SDK. Instead, the SDK is initialized by creating a new instance of theStorefrontClientclass.
2.0.0-beta.2
Minor Changes
- 5ae2891: Adds a trace id to the
errorkey in the response. This trace id should be included in any support requests.
2.0.0-beta.1
Major Changes
-
f2f221b: The Storefront SDK accepts a new
fetchClientintialization 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 acceptstoken,currencyCode,connector,debugMode,onDataError,subscriptionEndpoint,subscriptionToken, norsubscriptionSpaceIdin the client initialization parameters. These properties are also no longer included in the return value of thegetConfigmethod. -
dd081ef: BREAKING: Storefront SDK methods other than
.query,.after,.getConfigand.setConfigare no longer included in@nacelle/storefront-sdk. Other methods from@nacelle/[email protected]such as.products,.contentetc. will be provided by a Storefront SDK plugin. -
a8b3a65: Improves the
.querymethod.- Adds support for tagged template literals via the
gqlhelper function - Adds support for
TypedDocumentNodesfor strongly typed queries/responses. More info onTypedDocumentNodesand 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 anaftermethod 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
-
81e498b: Adds persisted query support for all queries. This sends all requests as hashed
getrequests to take advantage of server-side caching in Nacelle's v2 infrastructure.
Minor Changes
- 02f15db: Exposes new withConfig type that plugin authors can take advantage of to get access to the
getConfigmethod of the sdk. - 53dd06c: The
.aftermethod offers callback deletion and an improved TypeScript experience. Callbacks can now be registered with acallbackId. To delete a callback, providenullas the callback value, along with thecallbackIdof the callback you'd like to delete. In TypeScript projects, the.aftermethod'smethodargument provides autocomplete with all of the possible values. After specifying themethod, the.aftermethod'scallbackargument is aware of the type signature that's specific to themethodof interest.
Patch Changes
- dd081ef: Fixes Storefront SDK type definition resolution in native ESM projects
2.0.0-beta.0
Major Changes
- c0e3aee: Generate TypeScript types from the Nacelle Storefront GraphQL schema.
Updated about 2 years ago
