@sanity/client 3.3.0 → 3.3.3-esm.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  [![npm version](https://img.shields.io/npm/v/@sanity/client.svg?style=flat-square)](https://www.npmjs.com/package/@sanity/client)
4
4
 
5
- Javascript client for Sanity. Works in node.js and modern browsers (older browsers needs a [Promise polyfill](https://www.sanity.io/help/js-client-promise-polyfill)).
5
+ Javascript client for Sanity. Works in node.js and modern browsers (older browsers need a [Promise polyfill](https://www.sanity.io/help/js-client-promise-polyfill)).
6
6
 
7
7
  ## Requirements
8
8
 
@@ -37,7 +37,7 @@ Initializes a new Sanity Client. Required options are `projectId`, `dataset`, an
37
37
 
38
38
  Sanity uses ISO dates (YYYY-MM-DD) in UTC timezone for versioning. The explanation for this can be found [in the documentation](http://sanity.io/docs/api-versioning)
39
39
 
40
- In general, unless you know what API version you want to use, you'll want to set it to today's UTC date. By doing this, you'll get all the latest bugfixes and features, while locking the API to prevent breaking changes.
40
+ In general, unless you know what API version you want to use, you'll want to statically set it to today's UTC date when starting a new project. By doing this, you'll get all the latest bugfixes and features, while locking the API to prevent breaking changes.
41
41
 
42
42
  **Note**: Do not be tempted to use a dynamic value for the `apiVersion`. The reason for setting a static value is to prevent unexpected, breaking changes.
43
43
 
@@ -260,13 +260,11 @@ client
260
260
  The operations of appending and prepending to an array are so common that they have been given their own methods for better readability:
261
261
 
262
262
  ```js
263
- const {nanoid} = require('nanoid')
264
-
265
263
  client
266
264
  .patch('bike-123')
267
265
  .setIfMissing({reviews: []})
268
- .append('reviews', [{_key: nanoid(), title: 'Great bike!', stars: 5}])
269
- .commit()
266
+ .append('reviews', [{title: 'Great bike!', stars: 5}])
267
+ .commit({autoGenerateArrayKeys: true})
270
268
  ```
271
269
 
272
270
  ### Deleting an element from an array