Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use pnpm instead of npm for frontend resources #6966

Closed
5 tasks done
pleku opened this issue Nov 18, 2019 · 2 comments
Closed
5 tasks done

Use pnpm instead of npm for frontend resources #6966

pleku opened this issue Nov 18, 2019 · 2 comments

Comments

@pleku
Copy link
Contributor

pleku commented Nov 18, 2019

As based on #6150, we will add support for pnpm for Vaadin 14.x / Flow 2.x and then bring it as

  • The default mode for new v14 projects
  • Keep existing projects working 14 projects working
  • Add a turn-key way to go from a 14 npm project to a 14 pnpm project. This might not be initially available, but will be added at some point
  • There will be only one package.json that is managed fully by the framework when you are using pnpm mode

Parts:

@pleku pleku created this issue from a note in Vaadin Flow enhancements backlog (Vaadin 10+) (Work In Progress) Nov 18, 2019
@Legioth
Copy link
Member

Legioth commented Nov 18, 2019

The part about using only one package.json may need some additional consideration to take into account hybrid use cases where some dependencies are managed "manually" (e.g. running npm install) and some are managed through @NpmPackage annotations on the classpath. The tricky part there is how to know what to do in situations when an @NpmPackage annotation is removed or if its version number is updated.

This is not so much of an issue for Vaadin 14.x where this kind of hybrid approach isn't really encouraged, but it will be problematic in Vaadin 15.

@manolo
Copy link
Member

manolo commented Nov 19, 2019

This use case should work out-of-the-box with whatever solution proposed:

  • Developer annotates their java class with @NpmPackage(value="@vaadn/grid", version="latest") (notice the typo)
  • An errored entry is added to the package.json failing npm install.
"@vaadin/vaadn-grid": "latest",
  • The the user fixes the typo in java, then the wrong entry should be removed and the correct one added.
"@vaadin/vaadin-grid": "latest",

Otherwise, the project would never build, and the user needs to know what file and what to remove to fix the project. Note that mvn clean would not help here

@pleku pleku added this to the V14.X milestone Nov 20, 2019
@pleku pleku modified the milestones: V14.X, 2.2 Dec 9, 2019
@pleku pleku moved this from Product backlog to In progress in OLD Vaadin Flow ongoing work (Vaadin 10+) Dec 9, 2019
@pleku pleku closed this as completed Dec 12, 2019
OLD Vaadin Flow ongoing work (Vaadin 10+) automation moved this from In progress to Done - pending release Dec 12, 2019
Vaadin Flow enhancements backlog (Vaadin 10+) automation moved this from Work In Progress to Done / Pending Release Dec 12, 2019
@pleku pleku added the v14.2 label Dec 12, 2019
vlukashov pushed a commit to vaadin/flow-and-components-documentation that referenced this issue Dec 27, 2019
This is needed after `pnpm` became the default front-end package manager in Vaadin apps (see vaadin/flow#6966)
vlukashov pushed a commit to vaadin/flow-and-components-documentation that referenced this issue Dec 27, 2019
This is needed after `pnpm` became the default front-end package manager in Vaadin apps (see vaadin/flow#6966)
platosha pushed a commit to vaadin/flow-and-components-documentation that referenced this issue Dec 27, 2019
* fix: mention Vaadin Maven plugin in the 'upgrading from Vaadin 14' guide

Explicitly mention that the plugin version needs to be changed as well, so that the project uses matching versions of the Vaadin platform and the Vaadin Maven plugin.

This addresses one of the comments from DX tests.

* fix: replace npm with pnpm in docs

This is needed after `pnpm` became the default front-end package manager in Vaadin apps (see vaadin/flow#6966)

* fix: clarify where to run the `pnpm install` command

* fix: avoid TS compilation errors in quick start snippets

 - the `route.action` property does not allow returning a promise of a particular ES module, thus `action: () => import('./views/help/app-help')` does not pass the type check
 - the `click()` method in the snippet overrides the `HTMLElement`'s `click` property, which is not intended
 - add an import for the `vaadin-button` custom element used in the snippet

* fix: add a tip that JS is supported as well as TS

 - into the 'upgrading from V14' guide

* fix: how to move existing Java views into TS page layout

* formatting fix

* fix a typo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
OLD Vaadin Flow ongoing work (Vaadin ...
  
Done - pending release
Vaadin Flow enhancements backlog (Vaa...
  
Done / Pending Release
Development

No branches or pull requests

3 participants