React4XP 6 Release notes

Contents

The most significant changes since version 5 are:

Build system / Dev mode

Types New react components Static assets more?

Single React app

Each page now defaults to a single React app (aka entry), vs one React app/entry per component in version 5. This allows for a cleaner React development approach, and more flexibility.

New region handling

The <Region> component (part of @enonic/react-components) has changed, and now handles rendering of it’s sub-components directly. V5 was based on site engine’s placeholder and iterative rendering technique.

This is a breaking change.

Detached front-end

Previous versions were directly based on XP’s site engine, where rendering was defined with each CMS component.

V6 severs the tie beween CMS component definitions and the rendering. This means you may implement the front-end (R4XP rendering) code separately from the CMS model definition, including the ability to deploy front-end and back-end/model in two or more separate applications.

Component registry

React4XP uses a Hierarchical MVC pattern, where data is first collected into a model (in the form of props), which are then passed to the view (React templates). This first (normally) happens on the server, then the process may repeat on the client - where the props are normally re-used.

The process is handled via the Component registry, where you register server-side controllers that fetches relevant content, and then passes it to the respective component(s).

Response processing

React4XP runs on top of the site engine, which means multiple XP apps can contribute to the request processing via page contributions and response processors. For instance the SEO Metafields applications will inject custom tags to the HTML response - without interfering with the React4XP front-end. Applications that deliver standalone HTML may also be used - but will naturally need their own mapping.

Remember, you may still bundle both CMS model and front-end in the same app.

Upgrading

To migrate a legacy React4XP application we have written detailed upgrade notes.


Contents

Contents

AI-powered search

Juke AI