The 7.0 release improves on the extensibility framework. I want to prove if we can already build a real PWA extension or where we run in limitation.
This blogpost contains two parts. The first part is about the technical strategies behind the Extensibility Apis. In the second part, we will write a small extension.
The new extensibility Apis allows extending Build pack, Peregrine, and Venia UI library components. The main goal is developers can make changes in storefront projects or standalone extensions without duplicating or maintaining the PWA-Studio code. The PageBuilder is integrated via targets. It is the first Magento Content plugin. Also, it is an excellent example of your plugins.
For replacing or extend already existing ui components, we need a workaround currently. Replacing a part can be dangerous. It is not a compound change, so if two extensions both want to replace the same file, it can lead to errors. Currently, the Core Team doesn't want to support a fallback structure by default.
From my perspective, we need a way how a plugin can register its new components to already existing ui components. PWA Studio packages should declare which of their ui-components are safe to replace and make them replaceable. A reliable replacement strategy will help that vendors can build Standalone Marketplace Extensions.
Venia UI extension points
Currently it is allowed to add new routs or create a new richContentRenderers to create new
blog plugin based on CMS like NEOS. The richContentRenderers are used to integrated the Magento
Page Builder Plugin in PWA Studio.
We can now wrap any individual Peregrine talons
when Peregrine talons are invoked, and/or to modify the behavior and output of those talons.
Like the around plugin concept knowen as interceptor pattern of Magento.
The Webpack has ships NormalModuleReplacementPlugin allows you to replace resources that match resourceRegExp with newResource.
This very helpful for replacing one file. But I want to show you how we can write our Plugin very essay.
From my point of view, this plugin has a better developer experience, because we can overwrite multiple files and don't need to use a regex.
Software Engineer at TechDivision GmbH and Maintainer of the Community Engineering Team at Magento. He has 8 years of professional SoftwareEngineering experience. Lars is passionate about Magento and Open Source.