v0.140.0

Released Jan 16th 2019

Upgrade the Command Line Interface (CLI) with

npm install --global @sanity/cli

Upgrade the Content Studio with:

sanity upgrade

✨ Highlights

🎰 Reconfiguring studios

You can now easily reconfigure an existing Sanity studio project to use a different project ID and dataset, by running sanity init in an existing studio folder. This will take you through a reconfiguration process and update the sanity.json file.

You can also ship a "template" for a studio by leaving out the projectId and dataset configuration options in sanity.json - when a user runs sanity init or sanity start in a studio without these options set, it will take them through the creation or selection of a project and dataset.

⚖️ Improved studio search and experimental search config

This release introduces a way to define specific weights on fields/paths for document types.

Since the API is not stable yet, and likely subject to change, it's confgurable on the __experimental_search property for schema document types. Here's an example:

  type: 'document',
  name: 'author',
  fields: [
    {name: 'name', type: 'string'},
    // ...
  ],
  __experimental_search: [
    {weight: 1.2, path: 'name'}
  ]
  // ...

A few things to note:

  • The weight is a global multiplier across all document types, so if name on type customer has a weight of 2, and name on type author has a weight of 4, documents of type author will be ranked higher than documents of type customer, even if their name fields equally matches what the user searched for.
  • If no search config is specified on a document type, it gets derived from the preview config (which again is derived by default through schema introspection).
  • We have also united the reference search with the global search, so that they both follow the same ranking/weighting rules.

📓 Full changelog

AuthorMessageCommit
Espen Hovlandsdalschema Add missing fields to span type (#1154)5dd5371b9
Kristoffer J. Sivertsenlanguage-filter Reference element outside of poppable (#1158)cd08bf7b2
Kristoffer J. Sivertsencomponents Add truncate prop to validationlist and item (#1132)287fdc1df
Kristoffer J. Sivertsencomponents Auto-collapse animation smoothness (#1150)6284fa139
Espen Hovlandsdalcore Improve dataset name validation (#1162)1c3aef474
Espen Hovlandsdalcli Allow reconfiguring studio projects (#1163)26d5913bc
Kristoffer J. Sivertsendefault-layout Show first letter in name as fallback (#1167)124a4fe61
Bjørge Næssdefault-layout Give the search hit container a max height of 80vh in order to fit more items (#1166)7dbc0ebc5
Bjørge Næssbase Experimental search config with weights (#1168)a6f3caf05