Ripple Framework


Nuxt layers are used to encapsulate Ripple functionality to share and reuse

Nuxt 3 provides a way to encapsulate part of a Nuxt project into what they call a Layer.

Nuxt layers are a powerful feature that you can use to share and reuse partial Nuxt applications within a monorepo, or from a git repository or npm package. The layers structure is almost identical to a standard Nuxt application, which makes them easy to author and maintain.

In Ripple 2, we utilise Nuxt Layers extensively to share isolated features between SDP sites. A good example is a content type. Using a Nuxt Layer we are able to add the components, API endpoints, composables, etc needed to implement the feature, without having the overhead of a Nuxt Module.

A great feature of Nuxt Layers is that you can reference them from any public or private Git repo in addition to publishing via an NPM module.

Below is a diagram showing how Ripple 2 features are distributed through Nuxt layers and used within projects.

Ripple layers architecture diagram. Shows how modules can be shared between projects

Propose a change to this page on GitHub.