vaadin / flow

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

Test and confirm react.enable flag usage and documentation #19955

Closed tepi closed 1 month ago

tepi commented 2 months ago

Description of the bug

Currently it is possibly not clear how to use the react.enable flag properly. We need to test which is the correct way of usage and make sure the documentation is up-to-date with that.

tltv commented 2 months ago

At the moment, the property is needed in maven/gradle configuration and as a runtime property depending on how application is build and run.

It's required in maven/gradle configuration when building:

In runtime in development mode, it depends how application is run. Maven/gradle configuration works when run with maven. Maven/gradle configuration is ignored when running directly with java command, or via IDE's Run option in UI.

When running in production mode, default value is based on the production bundle which was build with build-frontend goal. Overriding it with runtime property should not be recommended because then app could be build with/without react, but some runtime feature could think otherwise.

To avoid issues, we should probably recommend adding it in both places and keeping them always same value in both places.

Property is mentioned at least in following pages:

caalador commented 1 month ago

One possibility to document is to have in pom.xml <properties><reactEnable>true</reactEnable></properties> and have in the default application.properties vaadin.react.enable=@reactEnable@ This would sync the pom.xml and application.properties values for the flag.

see https://docs.spring.io/spring-boot/docs/2.0.0.M7/reference/html/howto-properties-and-configuration.html#howto-automatic-expansion-maven