plone / volto

React-based frontend for the Plone Content Management System
https://demo.plone.org/
MIT License
429 stars 571 forks source link

Add `pnpm` support for projects/add-ons #5634

Open sneridagh opened 4 months ago

sneridagh commented 4 months ago

PLIP (Plone Improvement Proposal)

Responsible Persons

Proposer: Víctor Fernández de Alba (@sneridagh)

Seconder:

Abstract

We are in the middle of the transition to pnpm as package manager. We need to complete the transition and start using it in projects.

Motivation

The motivation behind the proposal of this move is mainly technological. npm has been behind yarn in so many aspects over the years, although npm eventually endup improving a lot too, but the differences are still noticeable (in performance above all). Over the years, other package managers have been popping up, the most noticeable one being pnpm. The approach that pnpm uses makes very much sense. The most important one, it uses a symlinked node_modules structure as opposed to their counterparts that use a flat node_modules. It does not only boost the installation speed, and the disk space required, but gets rid of problems with hoisted packages. See https://pnpm.io/motivation for more information.

Assumptions

No assumptions.

Proposal & Implementation

pnpm forces to have all the dependencies declared in the project. Right now, we rely on hoisting to "lift up" all the packages required to run a Volto project, placing the deps (dev deps and direct deps) in Volto itself as direct deps.

We need to sanitize Volto dependencies, declare direct dependencies and dev dependencies in the right way. However, undergoing that way will force us to build tooling around to migrate to the new state and add the right set of dependencies to all the existing Volto projects. This tooling should also allow the "upgrade" to a KGS of versions that it should use, matching the versions defined in an existing Volto version.

Deliverables

The @plone/updater package, with the scripts/tooling that we explained above. Updated documentation on how to install projects from now on.

Risks

Ideally, yarn should still be able to work with the projects. Other than that, if the tooling works well, it should be safe.

Participants

stevepiercy commented 4 months ago

Please add documentation of relevant commands for the installation of Volto for either development of Volto core or as a project, as needed, as a deliverable.