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

fix: compute client-side feature flag values at runtime #21066

Merged
merged 1 commit into from
Mar 5, 2025

Conversation

mcollovati
Copy link
Collaborator

@mcollovati mcollovati commented Feb 28, 2025

Activating a feature flag in the project does not work when a default bundle is used because the values of the flags sent to the client are hard-coded at bundle build time. Additionally, if a feature flag is active during bundle creation, it remains active on the client side even if the project does not activate it in the vaadin-featureflags.properties file.

This change ensures that feature flags in the frontend bundle are always disabled initially and are activated on page load based on the current project settings.

Fixes #20991

@mcollovati mcollovati force-pushed the issues/20992-feature_flag_not_in_bundle branch from 06b51a8 to e499842 Compare February 28, 2025 14:04
Copy link

github-actions bot commented Feb 28, 2025

Test Results

1 169 files  ± 0  1 169 suites  ±0   1h 15m 56s ⏱️ - 1m 44s
7 778 tests + 2  7 721 ✅ + 2  57 💤 ±0  0 ❌ ±0 
8 129 runs   - 17  8 063 ✅  - 17  66 💤 ±0  0 ❌ ±0 

Results for commit 91ff0db. ± Comparison against base commit 9b2dad4.

This pull request removes 1 and adds 3 tests. Note that renamed tests count towards both.
com.vaadin.flow.server.frontend.TaskGenerateFeatureFlagsTest ‑ should_defineCorrectEnabledValue
com.vaadin.flow.server.communication.IndexHtmlRequestHandlerTest ‑ serveIndexHtml_featureFlagsSetter_isPresent
com.vaadin.flow.server.frontend.TaskGenerateFeatureFlagsTest ‑ should_callFeatureFlagsUpdaterFunction
com.vaadin.flow.server.frontend.TaskGenerateWebComponentBootstrapTest ‑ should_importFeatureFlagTS

♻️ This comment has been updated with latest results.

@mshabarov mshabarov requested a review from caalador March 3, 2025 12:33
Activating a feature flag in the project does not work when a default bundle
is used because the values of the flags sent to the client are hard-coded at
bundle build time. Additionally, if a feature flag is active during bundle
creation, it remains active on the client side even if the project does not
activate it in the `vaadin-featureflags.properties` file.

This change ensures that feature flags in the frontend bundle are always
disabled initially and are activated on page load based on the current
project settings.

Fixes #20991
@mcollovati mcollovati force-pushed the issues/20992-feature_flag_not_in_bundle branch from e499842 to 91ff0db Compare March 3, 2025 12:44
@vaadin-bot vaadin-bot added +1.0.0 and removed +0.0.1 labels Mar 3, 2025
@vaadin-bot vaadin-bot added +0.0.1 and removed +1.0.0 labels Mar 3, 2025
@mshabarov mshabarov merged commit bc40f5c into main Mar 5, 2025
26 checks passed
@mshabarov mshabarov deleted the issues/20992-feature_flag_not_in_bundle branch March 5, 2025 07:10
@vaadin-bot
Copy link
Collaborator

Hi @mcollovati and @mshabarov, when i performed cherry-pick to this commit to 24.7, i have encountered the following issue. Can you take a look and pick it manually?
Error Message:
Error: Command failed: git cherry-pick bc40f5c
error: could not apply bc40f5c... fix: compute client-side feature flag values at runtime (#21066)
hint: After resolving the conflicts, mark them with
hint: "git add/rm ", then run
hint: "git cherry-pick --continue".
hint: You can instead skip this commit with "git cherry-pick --skip".
hint: To abort and get back to the state before "git cherry-pick",
hint: run "git cherry-pick --abort".

mcollovati added a commit that referenced this pull request Mar 5, 2025
Activating a feature flag in the project does not work when a default bundle
is used because the values of the flags sent to the client are hard-coded at
bundle build time. Additionally, if a feature flag is active during bundle
creation, it remains active on the client side even if the project does not
activate it in the `vaadin-featureflags.properties` file.

This change ensures that feature flags in the frontend bundle are always
disabled initially and are activated on page load based on the current
project settings.

Fixes #20991
mcollovati added a commit that referenced this pull request Mar 5, 2025
)

Activating a feature flag in the project does not work when a default bundle
is used because the values of the flags sent to the client are hard-coded at
bundle build time. Additionally, if a feature flag is active during bundle
creation, it remains active on the client side even if the project does not
activate it in the `vaadin-featureflags.properties` file.

This change ensures that feature flags in the frontend bundle are always
disabled initially and are activated on page load based on the current
project settings.

Fixes #20991
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature flag changes are ignored on client side when default bundle is used
4 participants