npm @sanity/default-layout 0.126.0
v0.126.0

latest releases: 2.36.2, 2.36.2-weighted-search.16, 2.36.2-weighted-search.10...
6 years ago

Upgrade with:

sanity upgrade

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

npm install --global @sanity/cli

✨ Highlights

✅ Validation (experimental 🔬)

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

Author Message Commit
Kristoffer J. Sivertsen [form-builder] Show paste enable on uploadplaceholder (#583) 9ebff06
Espen Hovlandsdal [chore] Disable browser env for non-browser modules 7c98296
Espen Hovlandsdal [export] Add new export module for exporting a dataset and downloading associated assets ee9aa4c
Espen Hovlandsdal [core] Use new @sanity/export module for exporting datasets b14a433
Espen Hovlandsdal [import] Refactored to alllow importing from tarballs 36bf52a
Espen Hovlandsdal [core] Add more help text for import/export commands 0d15bea
Espen Hovlandsdal [export] Don't filter or touch asset documents or references in raw mode dbc0bba
Espen Hovlandsdal [export] Add support for filtering on drafts and types 1d452dd
Espen Hovlandsdal [core] Document drafts, types and overwrite flags for export command c26fc06
Espen Hovlandsdal [cli] Replace update-notifier with custom, non-lazy-loaded version c7d4ecf
Espen Hovlandsdal [cli] Remove unnecessary rewriting of lazy loader in update notifier 166f061
Espen Hovlandsdal [chore] Normalize engines and author fields 7e3ceb1
Espen Hovlandsdal [chore] Upgrade and normalize dependencies 1957c00
Bjørge Næss [form-builder] Minor flowtype fix 4442fcc
Bjørge Næss [preview] Optimize preview fetching c1e0ca3
Espen Hovlandsdal [client] Always reconnect listeners, even when auto-reconnect fails 292ed3b
Kristoffer J. Sivertsen [all] Adding support for and styling readOnly fields. #440 (#574) c716c93
Espen Hovlandsdal [validation] Initial validation implementation 22807f8
Bjørge Næss [form-builder] Consistent naming of input components/folders (#603) dd2cd28
Espen Hovlandsdal [cli] Replace progrescii + thenify dependencies f4d3b0e
Bjørge Næss [preview] Fix issue with accumulated queries + default pagination limit (#610) e167b3e
Espen Hovlandsdal [base] Provide size ordering + size subtitles for assets ad772ce
Bjørge Næss [export] Set publishConfig.access = 'public' c4063d3
Bjørge Næss [components] Remove react-text-ellipsis due to perf issues (#606) f520138
Kristoffer J. Sivertsen [components] Avoid repaint on scroll (#615) ca81321
Kristoffer J. Sivertsen [components] Click to scroll for block editor #76 (#578) c28dbff
Bjørge Næss [preview] Cache and share preview snapshots between all subscribers (#612) 0b34988
Kristoffer J. Sivertsen [components] Proof of new slug concept (#585) 03b7d93
Espen Hovlandsdal [schema] Deprecate slugifyFn (now called slugify) 1c857ac
Kristoffer J. Sivertsen [base] Not using height on text input (#619) 0f0be2f
Bjørge Næss [test-studio] Add species type 3932474
Bjørge Næss [chore] Remove outdated changelog f32b2ff
Espen Hovlandsdal [desk-tool] Lock to last-known local revision when publishing 50bc679
Espen Hovlandsdal [schema] Change slug uniqueness function name to isUnique 130c978
Kristoffer J. Sivertsen [default-layout] Removing padding from secondary navigation 823769e
Bjørge Næss [eslint-config-sanity] Import eslint config package (#625) d803394
Bjørge Næss [form-builder] Handle readOnly on unknown fields (#627) 2e874ef
Espen Hovlandsdal [cli] Allow creating new projects in unattended mode febffa6
Bjørge Næss [cli] Add react-icons as dev dependency (#630) 0a8032b
Kristoffer J. Sivertsen [components] Scrollcontainer has default style. Override for mobile in defaultpane (#631) e4801da
Espen Hovlandsdal [client] Allow specifying ID of transactions 4e73a08
Espen Hovlandsdal [cli] Skip dataset validation on CI-environment 2d4a1f0
Bjørge Næss [infrastructure] Improve how we handle connection failures/reconnects (#632) 582a5ee
Bjørge Næss [preview] Emit null as snapshot for missing documents (#634) fd65783
Kristoffer J. Sivertsen [imagetool] Min width on canvas (#636) a7abf4b
Espen Hovlandsdal [validation] Allow disabling validation for field and document types b22e0cc
Espen Hovlandsdal [validation] Infer value from title/value list options 3929d4a
Bjørge Næss [form-builder] Support readOnly on block editor (#640) 118417c
Bjørge Næss [form-builder] Hide delete button from dialog when array is read only (#641) e230a93
Thomas Drevon [cli] Fix slug field options in movies template schema (#642) 60e4802
Espen Hovlandsdal [import] Fix importing of unreferenced assets 720c909
Espen Hovlandsdal [cli] Update URL for moviedb dataset fedbd51

Don't miss a new default-layout release

NewReleases is sending notifications on new releases.