use npm as the default client-side package manager
See original GitHub issueWhen using Vaadin I expect that by default it makes a reasonable choice of the front-end package manager. Since Vaadin 14.2 and Vaadin 15 the default has been pnpm because in late 2019 it was determined to be significantly faster than npm for repeated builds (see #6150). In early 2021 the situation has changed: both npm and pnpm have improved build times and the speed benefit of using pnpm became negligible (see https://github.com/vaadin/flow/issues/9835).
~Therefore, starting from Vaadin 20 (ETA June 2021) I expect Vaadin to use npm by default and to deprecate the pnpm support. Starting from Vaadin 21 (ETA September 2021) I expect pnpm support to be dropped completely.~
UPD: no timeline on this. As of early 2021 npm 7.x does not have a way to force / override transitive dependencies, which makes it ill-suited for use ‘as-is’ in Vaadin projects regardless of the performance (details).
DoD:
- all new projects generated by start.vaadin.com use npm
- if the client-side package manager is not explicitly specified by the
vaadin.pnpm.enable
property, a new Vaadin project uses npm to install client-side dependencies - if pnpm is explicitly selected as the client-side package manager (by the
vaadin.pnpm.enable
property) the project keeps using pnpm but prints a deprecation warning in the build log - projects using the default package manager in V19 ‘just keep working’ after an upgrade, i.e. the Vaadin maven plugin automatically converts the project from pnpm to npm (i.e. removes
.npmrc
(if created just for the--shamefully-hoist
option), pnpm files and the pnpm-specificnode_modules
structure) - there is a reliable way to lock versions of client-side Vaadin platform dependencies (investigation, more context, related PR)
- the relevant docs are updated:
more context in the feature design document
Issue Analytics
- State:
- Created 3 years ago
- Reactions:4
- Comments:5 (4 by maintainers)
From a Flow developers perspective I can only see benefits with pnpm support continuing until npm catches up also in other areas then just build speed. It is easy to configure and it just works. Pnpm uses a local cache instead of downloading everything for all new projects. Pnpm also uses symlinks/junctions and thus will not take up more space then what is in the local cache. This is not the case for NPM. Please consider not removing this since pnpm support brings great benefits. Here is the Discord discussion between @marcushellberg and me about the issue.
https://vaadin.slack.com/archives/C6X43FE8M/p1640045208209400 (Vaadin Staff only)