vaadin / vaadin-gradle-plugin

Gradle plugin for Vaadin 14 applications. Takes care of front-end build, helps to configure repositories and to create various project and file templates.
Apache License 2.0
31 stars 9 forks source link

Devmode gizmo broken for Vaadin 14.4 / Vaadin 14.5 #109

Closed enver-haase closed 3 years ago

enver-haase commented 3 years ago

Desktop (please complete the following information):

Ubuntu, but also seen on Windows. Vaadin plugin 0.14.3.7

Describe the bug https://github.com/vaadin/base-starter-spring-gradle/issues/7

With Vaadin 14.4 and Vaadin 14.5 the devmod gizmo (bottom right Vaadin V) does not show up.

This has consequences e.g. when the notification about @PreserveOnRefresh for example cannot be shown any more, Instead a JavaScript error is shown in that case.

To Reproduce Steps to reproduce the behavior: https://github.com/vaadin/base-starter-spring-gradle/issues/7 Consider adding @PreserveOnRefresh to the default @Route("") .

Starting with Vaadin 14.4 the devmode gizmo is packaged into a separate webpack bundle.

Error does not occur on Vaadin 14.3

Also consider testing: With a fixed version for Vaadin 14.4/14.5 does the HotSwap live reload still work (see the gizmo to report on that!) https://github.com/vaadin/base-starter-spring-gradle/issues/5

mvysny commented 3 years ago

Reproduced also with https://github.com/mvysny/karibu10-helloworld-application . The problem here is that the current plugin code is a copy+modification of Maven's code. There are multiple options:

  1. We copy&modify Maven's code. Not a viable strategy long-term
  2. We do exactly what we did for Vaadin 20 - we extract common plugin code into plugin-base and use that one. @mstahv thoughts?
mstahv commented 3 years ago

As we discussed in the planning a while ago, it is probably a rather expensive task to do the refactoring in V14 series. Backporting from master isn't not cherry pick. Also, I don't expect that much big changes to V14 series anymore.

I'd just bite the bullet and check the changes from Maven plugin. I don't think the changes are big so diffing latest changes might allow use to pick the changes manually.

Any opinions @pleku @caalador @taefi ?

caalador commented 3 years ago

It seems that the maven plugin has no changes between 2.3 and 2.5 even in 2.6 there is just a change for webcomponentmodulesexporter. I guess the problem is that there should just be a build and release that uses the correct flow version? At least the maven plugin needs to always be built against the correct flow version else it initializes wrong as it depends on the wrong flow version.

caalador commented 3 years ago

So checking https://plugins.gradle.org/m2/com/vaadin/vaadin-gradle-plugin/0.14.3.7/ the pom contains the Flow dependency version 2.3.6 that will not work with changes to 2.4+ so there should be versions 0.14.{4+}.0 with the correct flow dependencies.

Or is the plugin dependency overridable in some way?

mvysny commented 3 years ago

In such case the fix could simply be to version-bump flow-migration dependency version which is a really small and quick change. @caalador I can test this quickly, but which flow version do you recommend?

EDIT: Vaadin 14.5.1 uses flow 2.5.1, so perhaps that's the correct version to use.

caalador commented 3 years ago

I would probably go with the 2.5.1 for a 0.14.5.1 release 2.4 should perhaps also have its own release if updating the version fixes this (as I would expect it does) as 2.4 doesn't have lit, but 2.5 does
EDIT: Actually lit support shouldn't matter for the devModeGizmo

mvysny commented 3 years ago

Sounds good, let me try it out.

mvysny commented 3 years ago

I've verified that v-bump of flow to 2.5.1 brings the devModeGizmo back. I've pushed a commit in this regard.

mvysny commented 3 years ago

Fixed in Gradle plugin 0.14.5.1