Micro-apps shared by Plone Aurora and Volto: a core package with a driver, and a thin adapter per app
Maintainers usually reply within 2 days
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 1/100
- Issue type
- Feature
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- node.js, react, typescript
Research direction
This PLIP is explicitly restricted to Plone Team or Developers Team members and spans @plone/helpers, @plone/cmsui, @plone/types, @plone/tooling, @plone/controlpanels, @plone/contents, and Volto. Start with docs/conceptual-guides/packages-for-volto-and-aurora.md and the listed prerequisite content types stack (#271 → #369). Done requires the shared contracts, proxy and adapters, both micro-app migrations, enforcement, and documentation deliverables; this is broad design and implementation work.
Written by the indexing model from the issue text.
Description
[!IMPORTANT]
If you are not a member of the Volto Team or Developers Team in the Plone GitHub organization, then do not work on or comment on this issue.
PLIP (Plone Improvement Proposal)
Responsible Persons
Proposer: Victor Fernandez de Alba (@sneridagh)
Seconder:
Abstract
Define one pattern for micro-apps: control panels and other self-contained management UIs, such as @plone/contents, that run unchanged in both Plone Aurora and Volto.
A micro-app is a core package that doesn't depend on either framework. It holds the screens, the domain types, a driver interface with capability flags, a mock driver, a shared plone.restapi driver, its messages and catalogs, its routes as data, and compiled scoped CSS. Each app connects it with a thin adapter for its own host services (routing, translations, notifications, navigation blocking), its transport to plone.restapi, and its route mounting.
The content types control panel (#269, stack #271 → #369, Volto plone/volto#8500) already follows most of this. This PLIP generalizes what is specific to @plone/controlpanels today into shared contracts, so the next micro-app doesn't have to rebuild them, and sets the path for @plone/contents.
Motivation
- Plone Aurora and Volto will coexist for a long time. Writing every management screen twice, once per frontend, doesn't scale, and the two would drift apart.
@plone/controlpanelsproved that a package can run as-is in both apps: no framework imports, app services from a provider, backend data from a driver, translations shaped like react-i18next's, and scoped compiled CSS for Volto. The pattern is written down indocs/conceptual-guides/packages-for-volto-and-aurora.md(#353).- Much of it is still specific to control panels. A second micro-app would need:
- a second provider (
ControlPanelsProvider,translationFromIntl,useNavigationBlocker,ControlPanelsScope), even though nothing in them is about control panels, - a second adapter in each app (
ContentTypesProvidersin cmsui, another in Volto), - in Aurora, two more hand-written files that map each driver method to a URL and back (
auroraDriver.ts, 127 lines, androutes/api/contentTypes.tsx, 139 lines).
- a second provider (
@plone/contentsis the opposite case today. It depends on@plone/cmsui,@plone/layout,@plone/components,@plone/clientandreact-router. Its 12 route modules use React Router actions, and its components calluseFetcherand similar hooks about 20 times. It can't run in Volto.
Assumptions
- plone.restapi is the only backend contract. Micro-apps never call a backend directly.
- Both apps can run React 18+, React Aria Components,
@plone/quantaand@plone/helpers. - Volto compiles TypeScript source packages through its Babel includes and the server bundle's allow list in
razzle.config.js, as it already does for@plone/controlpanelsand@plone/helpers. - One
@plone/registryper app, used as a peer dependency (#352).
Proposal & Implementation
1. The core package
A micro-app package contains:
- Screens: page components that take their route params as props.
- Domain types and a driver interface:
<Domain>Driver, a plain object of async methods, with acapabilitiesobject. Optional methods exist only when their capability is on, andNO_CAPABILITIESis the baseline. The screens hide or disable, with an explanation, what the backend can't do yet, so they work with the released plone.restapi and gain features as new services land. - Drivers:
- a mock driver with fixtures from a real site, for Storybook and unit tests,
createRestApiDriver(request), the shared translation between the domain and plone.restapi,detectRestApi(request), which finds out which services the backend has.
- Paths and a route table: the base path, href builders, and the routes as data, for example
[{ path: '', page: 'list' }, { path: ':type/:tab?', page: 'type' }]. - Messages and catalogs:
t(key, { defaultValue, ...values }),{{x}}placeholders, ids namespaced by package, catalogs inlocales/<lang>/common.json. - Compiled CSS for Volto: every rule scoped with
:where(.<scope>), without cascade layers. - Source, not a build: like the other add-ons.
Allowed dependencies: React, React Aria Components, @plone/quanta, @plone/helpers, @plone/icons, @plone/types, jotai, and @plone/registry as a peer dependency.
2. One shared host contract, in @plone/helpers
Move these from @plone/controlpanels to @plone/helpers, renamed to be generic:
ControlPanelsProvider→HostProvider:navigate,useHref,t,notify,useBlocker, each with a default, so screens also run without an app.useTranslate,useNotify,useNavigate,useNavigationBlocker.translationFromIntl(intl),interpolate,defineMessages.ControlPanelsScope→HostScope, the scope element plus React Aria'sUNSAFE_PortalProvider, so popovers and dialogs get the scoped styles.
@plone/helpers already runs in both apps, so this adds no package. Each app writes its host adapter once (Aurora in cmsui, Volto in core), and every micro-app reuses it. @plone/plate can adopt it later.
3. A shared transport type
RestApiRequest, a function that calls plone.restapi and rejects with { status, data } like @plone/client and Volto's Api, moves to @plone/helpers. Each app implements it once:
- Volto:
voltoRequest(Api), in the browser. - Aurora: on the server, through
@plone/client, with the user's credentials.
4. A generic driver proxy in Aurora
Aurora runs drivers on the server. Instead of one hand-written resource route and one client driver per micro-app:
- One resource route,
/@driver/:app/:method: takes the method's arguments as JSON, runs the server driver with the user's credentials, and returns JSON or an error with its status. - One client,
createProxyDriver<D>(app, capabilities). - Server driver factories registered in the registry, for example
config.registerUtility({ type: 'driverFactory', name: 'content-types', method: (request) => createRestApiDriver(request) }).
Adding a micro-app to Aurora then needs no API code. Trade-offs:
- No REST-style, cacheable GET URLs. That's acceptable for management UIs.
- Methods that send or return a
Blob, such as import and export, need a multipart or binary path.
Volto needs no proxy: it runs createRestApiDriver(voltoRequest(Api)) in the browser.
5. Routes as data
The package exports its route table, and each adapter maps it:
- Aurora: to React Router's
routes.ts. Loaders only detect capabilities on the server (detectRestApi, cached). - Volto: to
routes.js.
Screens load their data through the driver (useDriverData). Server-side rendering of the data can come later as an optional initialData seed from Aurora's loaders.
6. Shared enforcement
dependencies.test.ts and the no-restricted-imports list of @plone/controlpanels become a reusable check in @plone/tooling, so every micro-app gets the same allow list from one place.
7. First adopters
@plone/controlpanelsmoves onto the shared host contract, transport type and proxy, after the content types stack (#271 → #369) is merged, not inside it.@plone/contents:- Define a
ContentsDriver: listing with batching, sorting and index columns; delete, rename, order, copy and paste, workflow, tags, properties and upload; capabilities. - Move the plone.restapi code from the route actions into its
createRestApiDriver. - Switch the components to the driver and the host hooks. Drop the
@plone/cmsui,@plone/layout,@plone/components,@plone/client,react-routerandreact-i18nextdependencies. Toasts go throughnotify, and the clipboard becomes a jotai store inside the package. - Replace the 12 route modules with the generic adapter.
- In Volto, offer it as an opt-in route first. Replacing Volto's Folder Contents is a product decision for a later step.
- Define a
Deliverables
@plone/helpers:HostProvider,HostScope, host hooks,translationFromIntl,RestApiRequest, with tests.@plone/cmsui: the Aurora host adapter,/@driver/:app/:method,createProxyDriver, the driver factory registry.@plone/types: typings for the driver factory utility.@plone/tooling: the shared dependencies check and ESLint rule.@plone/controlpanels: moved onto the shared contracts.@plone/contents: refactored as a micro-app.- Volto (
plone/volto): a host adapter andvoltoRequest(Api)in core, shared by@plone/controlpanelsand later@plone/contents. - Documentation:
docs/conceptual-guides/packages-for-volto-and-aurora.md(#353) extended into the micro-app guide, plus a how-to for creating a micro-app. The root and packageAGENTS.mdfiles updated.
Risks
- Breaking changes for
@plone/controlpanels: the provider exports move to@plone/helpers. It's still an alpha, and Volto (plone/volto#8500) is the only consumer, so the change happens before its first stable release. The old names can stay as deprecated re-exports for one release. - Versions in Volto: Volto must pin
@plone/helpersand every micro-app to compatible versions. A micro-app declares the helpers range it needs as a peer dependency. - Server-side rendering in Aurora: micro-apps load their data in the browser through the driver, so their screens render on the server without data until
initialDataexists. For management UIs this is acceptable. - Generic proxy: without care, it could expose driver methods to users who shouldn't call them. Every call still runs against plone.restapi with the user's own credentials, so plone.restapi's permission checks apply. The proxy only runs registered factories.
@plone/contentsrefactor: this is a large change to a working package. Acceptance tests must pass before and after each step.- Two frontends, one UI: micro-apps look like Quanta in Volto, not Semantic UI. This is already accepted for the content types control panel.
Participants
- Victor Fernandez de Alba (@sneridagh)
Assisted-by: Claude Opus 5.5
- Dominant language
- JavaScript
- Stars
- 10
- Forks
- 9
- Avg merge
- 4d 7h
- Merged PRs (30d)
- 54
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from plone/aurora
-
01 type: bug 41 lvl: easy
Difficulty 1/5 1-3 hours Newbie friendliness 88/100
Maintainers usually reply within 2 days
-
Edit content TabList: selected tab's icon/label are hidden by its own selection indicator - a11yOpen01 type: bug 99 tag: UX Accessibility
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Maintainers usually reply within 2 days
-
01 type: bug 30 needs: triage
Difficulty 1/5 Under an hour Newbie friendliness 90/100
Maintainers usually reply within 2 days
-
01 type: bug 99 tag: UX Accessibility
Difficulty 1/5 Under an hour Newbie friendliness 76/100
Maintainers usually reply within 2 days
-
01 type: bug 30 needs: triage
Difficulty 1/5 Under an hour Newbie friendliness 88/100
Maintainers usually reply within 2 days
Similar issues
-
accessibility bug dark-mode dashboards
Difficulty 1/5 Under an hour Newbie friendliness 84/100
quarto-dev/quarto-cli#15447 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 1/5 Under an hour Newbie friendliness 78/100
521xueweihan/HelloGitHub#4655 ·
-
[19.0] pos_sale: settling an order with a 0 down payment line crashes (reading 'reward_id') and leaves a wrong amount duePossibly taken A pull request linked to this issue is open or already merged. Open
Difficulty 2/5 1-3 hours Newbie friendliness 79/100
Maintainers usually reply within 1 day
-
bug CRIT-3
Difficulty 1/5 Under an hour Newbie friendliness 70/100
NASA-AMMOS/anms#426 ·