vaadin / flow

Vaadin Flow is a Java framework binding Vaadin web components to Java. This is part of Vaadin 10+.
Apache License 2.0
589 stars 164 forks source link

PiT 24.0: when upgrading a flow project using only vaadin components, it should use express bundle #15910

Closed manolo closed 1 year ago

manolo commented 1 year ago

Description of the bug

If I have an 23.3 application that has no component customisations, it should not run npm install nor generate a new dev-bundle but use the one shipped in the platform.

Seems similar to https://github.com/vaadin/flow/issues/15907

Workaround

Removing package.json or package-lock.json it works

Expected behavior

Don't generate any bundle

Minimal reproducible example

curl -s -f 'https://start.vaadin.com/dl?&preset=default&projectName=default' -o default.zip
unzip default.zip
cd default
- Remove proKey license
- Changing vaadin.version from 23.3.6 to 24.0.0.beta2
- Change spring-boot-starter-parent to 3.0.2
- Change java.version to 17
mvn 

This is the output in console

 : Dependency @polymer/iron-icon is missing from the bundle
 : Dependency @polymer/iron-iconset-svg is missing from the bundle
 : Dependency @polymer/iron-list is missing from the bundle
 : Dependency @polymer/iron-meta is missing from the bundle
 : Dependency @polymer/iron-resizable-behavior is missing from the bundle
 : Dependency @vaadin/vaadin-accordion is missing from the bundle
 : Dependency @vaadin/vaadin-app-layout is missing from the bundle
 : Dependency @vaadin/vaadin-avatar is missing from the bundle
 : Dependency @vaadin/vaadin-board is missing from the bundle
 : Dependency @vaadin/vaadin-button is missing from the bundle
 : Dependency @vaadin/vaadin-charts is missing from the bundle
 : Dependency @vaadin/vaadin-checkbox is missing from the bundle
 : Dependency @vaadin/vaadin-combo-box is missing from the bundle
 : Dependency @vaadin/vaadin-confirm-dialog is missing from the bundle
 : Dependency @vaadin/vaadin-context-menu is missing from the bundle
 : Dependency @vaadin/vaadin-cookie-consent is missing from the bundle
 : Dependency @vaadin/vaadin-crud is missing from the bundle
 : Dependency @vaadin/vaadin-custom-field is missing from the bundle
 : Dependency @vaadin/vaadin-date-picker is missing from the bundle
 : Dependency @vaadin/vaadin-date-time-picker is missing from the bundle
 : Dependency @vaadin/vaadin-details is missing from the bundle
 : Dependency @vaadin/vaadin-dialog is missing from the bundle
 : Dependency @vaadin/vaadin-form-layout is missing from the bundle
 : Dependency @vaadin/vaadin-grid is missing from the bundle
 : Dependency @vaadin/vaadin-grid-pro is missing from the bundle
 : Dependency @vaadin/vaadin-icon is missing from the bundle
 : Dependency @vaadin/vaadin-icons is missing from the bundle
 : Dependency @vaadin/vaadin-item is missing from the bundle
 : Dependency @vaadin/vaadin-list-box is missing from the bundle
 : Dependency @vaadin/vaadin-list-mixin is missing from the bundle
 : Dependency @vaadin/vaadin-login is missing from the bundle
 : Dependency @vaadin/vaadin-menu-bar is missing from the bundle
 : Dependency @vaadin/vaadin-messages is missing from the bundle
 : Dependency @vaadin/vaadin-notification is missing from the bundle
 : Dependency @vaadin/vaadin-ordered-layout is missing from the bundle
 : Dependency @vaadin/vaadin-overlay is missing from the bundle
 : Dependency @vaadin/vaadin-progress-bar is missing from the bundle
 : Dependency @vaadin/vaadin-radio-button is missing from the bundle
 : Dependency @vaadin/vaadin-rich-text-editor is missing from the bundle
 : Dependency @vaadin/vaadin-select is missing from the bundle
 : Dependency @vaadin/vaadin-split-layout is missing from the bundle
 : Dependency @vaadin/vaadin-tabs is missing from the bundle
 : Dependency @vaadin/vaadin-template-renderer is missing from the bundle
 : Dependency @vaadin/vaadin-text-field is missing from the bundle
 : Dependency @vaadin/vaadin-time-picker is missing from the bundle
 : Dependency @vaadin/vaadin-upload is missing from the bundle
 : Dependency @vaadin/vaadin-virtual-list is missing from the bundle
 : An express mode bundle build is needed

Versions

mshabarov commented 1 year ago

Still reproduces with the latest Flow 24.0-SNAPSHOT.

mshabarov commented 1 year ago

Polymer dependencies were used in V23.3 for IronList and have been removed in V24 in https://github.com/vaadin/platform/pull/3430 . Web components don't have a vaadin- prefix anymore in V24, thus Flow thinks that they are new components.

But this shouldn't affect, because Flow calculates dependencies in memory for package.json taking into account specified platform version.

manolo commented 1 year ago

Then probably we need some kind of white list for these components, so as it's safe still to use the bundle

mshabarov commented 1 year ago

The solution seems more simple: we can exclude all the entries from dependencies that have same package name and version as in dependencies inside vaadin block. So everything that is not defined by developer but by Vaadin will be removed and then re-added back but with the actually used platform version.