David Ichim: What's new in Plone 6 frontend for developers
Talk by David Ichim at the online Plone Conference 2021.
Distilled from the latest work done in Volto, we're showcasing some patterns, features, or enhancements that have landed in Volto from the last year to the present. We will also have a glimpse of what is ahead in the future of Volto with the new features roadmap.
In the past year we had four major releases, 40 minor releases, 36 alpha releases, 25 patch releases, for a total of 105 releases. Plus some new tooling and tool releases, like plone i18n and plone generator.
New Volto config, dubbed as Volto's Configuration Registry, introduced to fix circular import dependency problems. Hot Module Reloader was fixed. Read the upgrade guide.
New i18n (internationalisation) infrastructure. This is now a separate package. Same is used for generation of i18n in add-ons.Read the upgrade guide.
Forms as schema. Forms should be constructed from schemas instead of by hand. InlineForm allows us to create forms for blocks from a schema. Blocks can have variations, or we can extend it. Read the edit component documentation.
New widgets:
- Object List Widget. Similar to the original DataGridField. Used in core by the Search Block facets.
- Object Browser Widget is now a separate widget, instead of part of a block, and now allows the addition of external content.
- Querystring Widget. Behaves like its counterpart from plone.app.querystring. Allows to create search criteria, used by the search block.
- URL Widget. Used on text inputs, it knows to validate their value as a url, both internal and external.
- Vocabulary Terms Widget for a JSONField, acts as a source for a SimpleVocabulary or Choice field. Play with it in the storybook.
New core blocks:
- Search block
- Teaser block (ongoing work).
Pluggable framework, similar to React's Portal component. See the talk by Tiberiu and see the Pluggables development recipe.
Storybook provides a sandbox to build and test visual components in isolation. Currently it is only setup to be used by Volto core. We need help with work to have storybook setup with adding. See the Storybook talk held by Victor, and see the storybook itself.
Critical CSS: inline the critical CSS for improved performance. Run critical-cli to output critical.css. This is then inlined in the headers, while regular CSS is moved to the bottom of the body. See the deployment documentation.
Lazy Loading utilities. Introduced injectLazyLibs HOC wrapper to inject lazy-loaded libraries as properties to your components. These components are only loaded once all your main libs are loaded.
Express.js middleware. Volto uses this for SSR and static resources serving. You can now write custom middleware and add it to settings.expressMiddleware
.
API expanders allow the expansion of different API endpoints from Volto with calls from your custom endpoints. Avoid adding too many expanders if they are not critical to the initial page.
External routes: useful when another application is published under the same top domain as Volto. If Volto would fetch the content for that path, it will break. You can disable this path in config.settings.externalRoutes
. You can also use regular expressions.
Seamless mode, introduced in Volto 13, enhanced in Volto 14, which has already seen a lot of alpha releases. Originally, we tried to unify both frontend and backend servers under the same path, but this was tricky, causing various problems. We settled on a new ++api++
traversal for getting information from the backend. Also, to come closer to zero config, you can now pass environment variables at runtime instead of build time. This means you can generate one build, and use this in all environments (testing, production). Read the deployment documentation.
Context navigation component. This is a navigation portlet component, similar to Classic Plone. The view is there, but you need to enable it. See the development recipe.
There is some work in progress:
- Slots are Volto's answer to portlets, see the Volto Slots talk by Tiberiu Ichim for more details.
- Image proxy: image scale generation done by a middleware instead of plone.scale.
- Authentication from backend.
- Replace Draft.js editor with Volto Slate. What is missing is a migration tool from one to the other. But work has started on a block conversion tool.
- Async blocks that work with SSR.
- Defaults in blocks form.
Future work:
- Defaults in all widgets
- Enable blocks enhancers in all blocks
- Storybook in add-ons
- Use newest react-intl package
- Refactor the folder contents component
- Form editing text enhancements, making it easier to modify text inputs.
- A "group block" included with Volto
- Quanta toolbar
I did nothing, I just brag about what others have done. So thank you Volto early adopter community!