Test your website performance for free
Test your website performance

Scrivito JS SDK 1.30.0 RC 4 Released – Featuring Layout Components

BETA

Introducing layout components, optionally with editable content

You can now implement page-type-specific layout components and optionally have them render attributes for editor-defined content. If such layouts are present for a page that is part of the page hierarchy, the layout components of the ancestor pages are rendered as well, meaning that you can have nested layouts.

The layout components can be defined using the new Scrivito.provideLayoutComponent API method. They are rendered by Scrivito.CurrentPage in a top-down manner starting at the homepage, enabling you to include elements like navigations that take account of the type or hierarchy level of the current page. For example, if you have a homepage, a news overview page and news article pages (/news/article*) and have defined layout components for all of these page types, displaying an article page via Scrivito.CurrentPage would cause the layout component of the homepage (top-level navigation), of the news overview page (article navigation), and of the article page itself to be rendered, plus, finally, the article’s content.

This new API is in beta and may be renamed or adjusted, should this become necessary.

React 18 compatibility

The Scrivito SDK now supports React 17 and React 18. As a result, the latest SDK version that supports React 16 is 1.29.0.

If your Scrivito app currently uses React 17, upgrading to React 18 is optional and straightforward. React 18 is fully compatible with React 17, and the new features can be used when needed.

If you are still on React 16, we recommend upgrading to React 17 first. This makes it easier to identify dependencies that are no longer maintained and need to be replaced with alternative packages. Also, some libraries are still working on React 18 support.

The new Scrivito.Extensions component integrates extensions with React’s new root API.

Without Scrivito.Extensions, developers will see a “ReactDOM.render is no longer supported” warning message when a custom component or dialog is shown.

Further improvements and other changes

  • Finding changed content more easily

    For conveniently finding pieces of content that have been changed in a working copy, the changes dialog now features a search, similar to the corresponding sidebar.

  • Improved editing interface performance with search-based validations

    While content is being edited, validations can have a great impact on the performance of the editing interface, especially if they are based on searches. To speed things up, the results of search-based validations are now cached, causing the editing interface to retain its responsiveness.

  • APIs for checking if a page is the current page or one of its ancestors

    When working with navigation elements, inspecting search results, etc., two new API methods may come in handy, Scrivito.isCurrentPage and Scrivito.isOnCurrentPath. Both methods expect a page object to be passed in.

  • Dropped support for Microsoft Internet Explorer 11 and JavaScript ES5

    From version 1.30.0, the Scrivito SDK no longer supports Microsoft IE 11 and JavaScript ES5.

  • Fixed bugs

    • With multi-site setups, searches on the changes sidebar panel are now applied to all sites, not just to the current site.
    • It is now possible again to publish a working copy in which a permalink was moved to a different page.
    • The context menu of the hierarchy elements and the changes at the bottom of the sidebar are now easily and fully accessible.
    • A glitch in the sidebar, which caused some buttons to overlap on small screens, has been fixed.
    • The TypeScript definition for Scrivito.ImageTag now correctly reflects the option to use a widget for the content prop.

Thank you for using Scrivito!

More great blog posts from Andreas Viebke