vaadin / hilla

Build better business applications, faster. No more juggling REST endpoints or deciphering GraphQL queries. Hilla seamlessly connects Spring Boot and React to accelerate application development.
https://hilla.dev
Apache License 2.0
921 stars 58 forks source link

Feature flags for experimental features are ignored for maven goal vaadin:build-frontend #2637

Closed sahrmann closed 2 months ago

sahrmann commented 3 months ago

Describe the bug

I have a file vaadin-featureflags.properties which contains com.vaadin.experimental.hillaI18n=true. In my local environment, the i18n-instance can be used without problems. However, in my production build, the frontend crashes with the error The Hilla I18n API is currently considered experimental and may change in the future. To use it you need to explicitly enable it in Copilot or by adding com.vaadin.experimental.hillaI18n=true to vaadin-featureflags.properties.

I investigated the issue and while prepare-frontend creates a correct vaadin-featureflags.js, using the goal vaadin:build-frontend creates the file with all features set to false.

Expected-behavior

No response

Reproduction

Create a vaadin-featureflags.properties which contains com.vaadin.experimental.hillaI18n=true and run mvn vaadin:build-frontend. The generated src/main/frontend/generated/vaadin-featureflags.js contains window.Vaadin.featureFlags.hillaI18n = false;.

System Info

Windows/Linux, Vaadin 24.4.4

platosha commented 2 months ago

Does reproduce for me, also when running mvn package -Pproduction. Investigating for the cause.

vaadin-bot commented 2 months ago

This ticket/PR has been released with Vaadin 24.5.0.alpha10 and is also targeting the upcoming stable 24.5.0 version.

vaadin-bot commented 2 months ago

This ticket/PR has been released with Vaadin 24.4.11.

jcgueriaud1 commented 1 month ago

I still have the issue in Vaadin 24.4.12 on this project: https://github.com/jcgueriaud1/spring-petclinic-vaadin-flow/tree/hilla

After a clean/clean-frontend,... the vaadin-featureflags.js is still wrong:

// @ts-nocheck
window.Vaadin = window.Vaadin || {};
window.Vaadin.featureFlags = window.Vaadin.featureFlags || {};
window.Vaadin.featureFlags.exampleFeatureFlag = false;
window.Vaadin.featureFlags.collaborationEngineBackend = false;
window.Vaadin.featureFlags.webPush = false;
window.Vaadin.featureFlags.formFillerAddon = false;
window.Vaadin.featureFlags.hillaI18n = false;
window.Vaadin.featureFlags.copilotFlow = false;
window.Vaadin.featureFlags.copilotI18n = false;
window.Vaadin.featureFlags.copilotExperimentalFeatures = false;
export {};