v0.126.0

Released Mar 6th 2018

Upgrade with:

sanity upgrade

And install the latest Command Line Interface (CLI) with:

npm install --global @sanity/cli

✨ Highlights

✅ Validation (experimental :microscope:)

The first building blocks of the long-awaited validation infrastructure is here. Each document field can specify validation rules that generate either errors (prevent the document from being published) or warnings (allow publishing, but notify the user about the warning).

For a full overview of the validation feature, see the documentation. We're looking for feedback on this feature and how you like the developer and user experience - drop us a line if you'd like to help!

🐌 Improved and simplified slug input

The slug input has been significantly simplified and is now easier to customize. A slugify option can now be provided in order to customize how slugs are generated, which also introduces the ability to generate the slug in an asyncronous manner (just return a promise!).

The uniqueness check now more correctly considers draft/published status, and also ensures that the uniqueness check is run per document type. The check to determine whether a slug is unique or not can now be customized by passing an isUnique function in the field options. More information can be found in the documentation.

🗜️ Import/export tarballs

sanity dataset export now generates a tarball (.tar.gz) containing both the documents in NDJSON form as well as assets (files and images). This provides a simple way to transfer data between different projects or datasets.

If you want to remove assets from the export, you can use the --no-assets flag, or if you just want the raw documents, use the --raw flag.

🛰️ Better indication of network status

The studio is now more responsive in the case of network errors, indicating the reconnect status and locking the local document to prevent data from being lost.

🤖 CLI: Unattended "new project"

The command line tool is now able to create and bootstrap a new project and dataset by using the --yes and --create-project flags (see sanity help init for more information).

👀 Faster previews

All documents that are previewed on screen now share the same in-memory representation. This should lead to a faster and more responsive UI.

🐛 Notable bugfixes

  • Publishing documents now include a revision lock to prevent race conditions or incorrect local states.
  • The @sanity/cli package did not notify on new releases. Now is a good time to run npm install -g @sanity/cli to ensure you stay up to date with new releases!
  • Listeners would in certain cases stop reconnecting. @sanity/client will now always try to reconnect if disconnected, until unsubscribe() is called.
  • Read-only fields are now more clearly presented as... read-only!

📓 Full changelog

AuthorMessageCommit
Kristoffer J. Sivertsenform-builder Show paste enable on uploadplaceholder (#583)9ebff0678
Espen Hovlandsdalchore Disable browser env for non-browser modules7c98296ee
Espen Hovlandsdalexport Add new export module for exporting a dataset and downloading associated assetsee9aa4c05
Espen Hovlandsdalcore Use new @sanity/export module for exporting datasetsb14a433c2
Espen Hovlandsdalimport Refactored to alllow importing from tarballs36bf52a57
Espen Hovlandsdalcore Add more help text for import/export commands0d15beaa6
Espen Hovlandsdalexport Don't filter or touch asset documents or references in raw modedbc0bba9b
Espen Hovlandsdalexport Add support for filtering on drafts and types1d452dd1e
Espen Hovlandsdalcore Document drafts, types and overwrite flags for export commandc26fc06d3
Espen Hovlandsdalcli Replace update-notifier with custom, non-lazy-loaded versionc7d4ecfc8
Espen Hovlandsdalcli Remove unnecessary rewriting of lazy loader in update notifier166f06162
Espen Hovlandsdalchore Normalize engines and author fields7e3ceb1a0
Espen Hovlandsdalchore Upgrade and normalize dependencies1957c00e7
Bjørge Næssform-builder Minor flowtype fix4442fccdb
Bjørge Næsspreview Optimize preview fetchingc1e0ca303
Espen Hovlandsdalclient Always reconnect listeners, even when auto-reconnect fails292ed3bc6
Kristoffer J. Sivertsenall Adding support for and styling readOnly fields. #440 (#574)c716c93f6
Espen Hovlandsdalvalidation Initial validation implementation22807f869
Bjørge Næssform-builder Consistent naming of input components/folders (#603)dd2cd2800
Espen Hovlandsdalcli Replace progrescii + thenify dependenciesf4d3b0eb5
Bjørge Næsspreview Fix issue with accumulated queries + default pagination limit (#610)e167b3ee1
Espen Hovlandsdalbase Provide size ordering + size subtitles for assetsad772ced2
Bjørge Næssexport Set publishConfig.access = 'public'c4063d30f
Bjørge Næsscomponents Remove react-text-ellipsis due to perf issues (#606)f5201382c
Kristoffer J. Sivertsencomponents Avoid repaint on scroll (#615)ca81321fc
Kristoffer J. Sivertsencomponents Click to scroll for block editor #76 (#578)c28dbff90
Bjørge Næsspreview Cache and share preview snapshots between all subscribers (#612)0b3498813
Kristoffer J. Sivertsencomponents Proof of new slug concept (#585)03b7d9376
Espen Hovlandsdalschema Deprecate slugifyFn (now called slugify)1c857ac60
Kristoffer J. Sivertsenbase Not using height on text input (#619)0f0be2f13
Bjørge Næsstest-studio Add species type39324749a
Bjørge Næsschore Remove outdated changelogf32b2ff75
Espen Hovlandsdaldesk-tool Lock to last-known local revision when publishing50bc679cf
Espen Hovlandsdalschema Change slug uniqueness function name to isUnique130c97893
Kristoffer J. Sivertsendefault-layout Removing padding from secondary navigation823769ecf
Bjørge Næsseslint-config-sanity Import eslint config package (#625)d803394c4
Bjørge Næssform-builder Handle readOnly on unknown fields (#627)2e874ef2f
Espen Hovlandsdalcli Allow creating new projects in unattended modefebffa69c
Bjørge Næsscli Add react-icons as dev dependency (#630)0a8032ba5
Kristoffer J. Sivertsencomponents Scrollcontainer has default style. Override for mobile in defaultpane (#631)e4801da1f
Espen Hovlandsdalclient Allow specifying ID of transactions4e73a0884
Espen Hovlandsdalcli Skip dataset validation on CI-environment2d4a1f00a
Bjørge Næssinfrastructure Improve how we handle connection failures/reconnects (#632)582a5ee45
Bjørge Næsspreview Emit null as snapshot for missing documents (#634)fd6578350
Kristoffer J. Sivertsenimagetool Min width on canvas (#636)a7abf4b4f
Espen Hovlandsdalvalidation Allow disabling validation for field and document typesb22e0cc5d
Espen Hovlandsdalvalidation Infer value from title/value list options3929d4a70
Bjørge Næssform-builder Support readOnly on block editor (#640)118417c14
Bjørge Næssform-builder Hide delete button from dialog when array is read only (#641)e230a931a
Thomas Drevoncli Fix slug field options in movies template schema (#642)60e4802d4
Espen Hovlandsdalimport Fix importing of unreferenced assets720c909f4
Espen Hovlandsdalcli Update URL for moviedb datasetfedbd5179