v0.140.30

Released May 31st 2019

Upgrade the Command Line Interface (CLI) with

npm install --global @sanity/cli

Upgrade the Content Studio with:

sanity upgrade

✨ Highlights

We had ourselves a "bug week"! Read our blog post.

This release has a bunch of small and less small fixes.

(Slightly) smarter image input/selection

The "select image" dialog no longer shows "Load more" when there are in fact no more images to load. The images are also scaled to fit the current device pixel ratio, resulting in sharper images on mobile devices and high-density displays. Certain images were also downloaded at full size, while they are now scaled down to fit the screen.

Divider allowed in desk structure

A minor (but much requested) feature; You can now use the S.divider() method to add a small divider between list items in the desk tool. In future releases, we will add the ability to group items even further, which will allow "headings", among other features.

Improved error handling

Non-React errors will now be caught and displayed in the browser window, making it easier to debug issues. Opening the browser developer tools will usually give the error with a better stack trace, helping you find the source of the issue more easily.

sanity exec uses same babel config as studio

In certain cases, scripts you would want to execute with sanity exec would include non-standard features like JSX or class properties. While the babel config used for the studio would allow this, sanity exec did not. This is now fixed.

Faster vision plugin

The @sanity/vision GROQ playground is now faster and smarter - we've upgraded a bunch of dependencies, fixing a set of scrolling issues and other odd behavior. (Run sanity install @sanity/vision to try it out.)

More schema validation

We've had a few cases reported where an incorrect schema definition would not be picked up by the schema validation, but instead lead to the studio crashing. Validation rules are now in place to make these situations easier to debug.

Object types no longer listed if no document types found

Previously, if your schema did not contain any document types, the desk tool would instead show object types. This functionality is now removed, and will instead show a descriptive error message.

🐛 Notable bugfixes

  • Fixed a focus-ring bug in the editor for Portable Text if it was empty
  • Fixed bugs with the "invalid type" warning interface inside the editor for Portable Text.
  • Fixed issue where the reference input would not show a "Loading" state on initial load
  • Fixed case where patches with a numeric key selection would incorrectly match a string key with the same value
  • Fixed positioning of the "Publishing" overlay
  • Fixed default layout not being usable without the desk tool installed
  • Fixed desk structure resolving not allowing a plain structure node to be used as a child
  • Fixed "loading" message on desk tool panes being cut off at the top
  • Fixed issue where sanity init would not allow --visiblity flag
  • Fixed sanity documents commands not accepting numeric document IDs
  • Fixed deprecation warning when logging in to the CLI from Node >= 11

📓 Full changelog

AuthorMessageCommit
Espen Hovlandsdalform-builder Display "no images found" text if no images are found (#1306)cdc30a1a8
Espen Hovlandsdalform-builder Don't show 'Load more'-button if reached known end (#1307)077172ae6
Thomas Drevonstructure Throw error when configuring documentTypeListItems with an unknown typebbb7b78f0
Thomas Drevonstructure Rename name --> typeName for consistencydbb7866fe
Espen Hovlandsdalform-builder Use loading state for reference input while loading initial value (#1309)3ee528a7d
Espen Hovlandsdalform-builder Use max-fit and and DPR-aware height (#1308)15d146ee0
Per-Kristian Nordnesvalidation Check for type validating arrays and objects in document (#1327)ebb997afe
Espen Hovlandsdalmutator Use strict equals when comparing equality (#1326)82caf34b4
Espen Hovlandsdalcomponents Fix propType depending on window global (#1321)2eece6fda
Espen Hovlandsdalform-builder Make canvas to blob polyfill node.js-safe (#1320)357b2ad5a
Espen Hovlandsdalcomponents Remove unused canvas-to-blob dependency (#1319)d8b81149e
Kristoffer J. Sivertsendesk-tool Moving overlay out of scroll container (#1312)9d24e103a
Espen Hovlandsdalform-builder Constrain rendered images to a reasonable size (#1330)6d0411309
Kristoffer J. Sivertsenvision Faster result view (#1298)9f61ab58f
Kristoffer J. Sivertsenvision Fix scroll issues (#1295)b8695a799
Kristoffer Sivertsencomponents Remove unused classNames922943a10
Espen Hovlandsdalstructure Add divider builder method (#1331)aa473bab7
Espen Hovlandsdalbase Add global error handler (#1333)71dc9b6f2
Kristoffer J. Sivertsenform-builder Select asset fixes (#1334)a752e74c2
Espen Hovlandsdalbase Fix history import to match new API (#1323)07bc78f7b
Espen Hovlandsdalschema Catch and display errors for falsey/incorrectly imported type defs (#1316)c6cd7287a
Espen Hovlandsdaldefault-layout Make active tool name optionale3dd544d5
Espen Hovlandsdaldefault-layout Prevent crash if no tools are installed60c0637ea
Espen Hovlandsdaldefault-layout Disentangle from data aspects/desk-toolc32591dab
Espen Hovlandsdalschema Fix crash on invalid array of-member declaration (#1314)ec71ed471
Espen Hovlandsdaldesk-tool Fix issue where non-function child would fail to resolve (#1325)54f745c2d
Espen Hovlandsdaldesk-tool Fix loading indicator being cut at top (#1324)3b4c9b90a
Espen Hovlandsdalcli Show reconfigure prompt only if output path flag is not cwdb48c7a728
Espen Hovlandsdalcli Fix inverted visibility allowed check56d8f6fb1
Espen Hovlandsdalstructure Improve error when promise is passed in list items (#1311)456388b92
Espen Hovlandsdalcore Cast document IDs to string (#1317)26e246916
Espen Hovlandsdalcore Make sanity exec use same babel config as studio (#1322)3130fefec
Espen Hovlandsdalcli Use v8 compile cache (#1259)414a03a89
Espen Hovlandsdalbase Don't catch errors without an Error instance (#1339)4a4115fa3
Per-Kristian Nordnesblock-tools Rename blockContentTypeOptions to blockContentTypeFeatures (#1328)570df06ae
Marius Lundgårdblock-tools Add info about running sanity scripts (#1293)4a133acc9
Per-Kristian Nordnesform-builder Block editor: Fix bug where focus was not set properly on editor when first opening the document7b3a30e19
Per-Kristian Nordnesform-builder Block editor: fix bugs related to removing unknown types interface inside the editor7b3a30e19
Per-Kristian Nordnesform-builder Block editor: Support removing invalid annotation types7b3a30e19
Per-Kristian Nordnesform-builder Remove unsued function in BlockObject/InlineObject7b3a30e19
Per-Kristian Nordnesform-builder Block editor: fix invalid conditional, and make dragging of inline object nodes smoother7b3a30e19
Espen Hovlandsdalcli Generate and use initialization vector for token exchange (#1341)2e6b1e2bf
Thomas Drevondesk-tool Display EmptyListPane in case of no document types in schema5fe84efa5
Thomas Drevondata-aspects Don't pass schema when calling class function getDocumentTypesf9cc638fe
Thomas Drevonstructure Resolve documentTypeList using defined docs instead of inferred types496316478
Bjørge Næssclean-studio Add clean-studioa7469afd6
Thomas Drevondesk-tool Rename empty list message component and refrain from using any Pane2340e3a87
Thomas Drevondesk-tool Make link actionable11d5a38fd
Knut Melværblock-tools Fix variable name in example (#1337)cdb23e31d
Thomas Drevonstructure Update data aspects mock8bd38b432
Espen Hovlandsdalbase Use pre-wrap to constrain width when displaying uncaught errors (#1343)10f9130eb