Skip to content

chore: Remove redundant JS in index.html when no feature flags are enabled#24212

Open
Codex wants to merge 4 commits intomainfrom
codex/remove-redundant-js-index-html
Open

chore: Remove redundant JS in index.html when no feature flags are enabled#24212
Codex wants to merge 4 commits intomainfrom
codex/remove-redundant-js-index-html

Conversation

@Codex
Copy link
Copy Markdown

@Codex Codex AI commented Apr 28, 2026

Thanks for asking me to work on this. I will get started on it and keep this PR's description up to date as I form a plan and make progress.


This section details on the original issue you should resolve

<issue_title>Redundant JS in index.html when no feature flags are enabled</issue_title>
<issue_description>### Description of the bug

Even if no feature flags are enabled, there's still some related JavaScript in the production index HTML document that doesn't really seem to serve any purpose:

window.Vaadin = window.Vaadin || {};
window.Vaadin.featureFlagsUpdaters = window.Vaadin.featureFlagsUpdaters || [];
window.Vaadin.featureFlagsUpdaters.push((activator) => {
});

Expected behavior

Expected to not have anything about features flags in the HTML if no feature flags are enabled.

Minimal reproducible example

  1. Run your favorite app without feature flags enabled in production mode
  2. Check the index HTML payload

Versions

  • Vaadin / Flow version: 25.1.3</issue_description>

Comments on the Issue (you are @codex[agent] in this section)

@cla-assistant
Copy link
Copy Markdown

cla-assistant Bot commented Apr 28, 2026

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
0 out of 2 committers have signed the CLA.

❌ codex
❌ Codex


codex seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

@Codex Codex AI requested a review from mshabarov April 28, 2026 10:15
@mshabarov mshabarov marked this pull request as ready for review April 28, 2026 11:13
Copy link
Copy Markdown
Contributor

@mshabarov mshabarov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. The failing test

WebComponentProviderTest.webComponentGenerator_responseGetsResult:212 Response should have Feature Flags updater function ==> expected: but was:

should expect no feature flag codes if feature flags are not enabled.

  1. Format the code with "mvn spotless:apply".

Co-authored-by: mshabarov <61410877+mshabarov@users.noreply.github.com>
@Codex
Copy link
Copy Markdown
Author

Codex AI commented Apr 28, 2026

  1. The failing test

WebComponentProviderTest.webComponentGenerator_responseGetsResult:212 Response should have Feature Flags updater function ==> expected: but was:

...

Updated WebComponentProviderTest.webComponentGenerator_responseGetsResult to expect no feature-flag updater when no flags are enabled. Commit: c881ae3

@Codex Codex AI requested a review from mshabarov April 28, 2026 11:24
@mshabarov
Copy link
Copy Markdown
Contributor

@codex[agent] run mvn spotless:apply and commit.

Agent-Logs-Url: https://github.com/vaadin/flow/sessions/183c1031-d51d-43b9-b0d2-fcb6a0480e65

Co-authored-by: mshabarov <61410877+mshabarov@users.noreply.github.com>
@Codex
Copy link
Copy Markdown
Author

Codex AI commented Apr 28, 2026

Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • maven.vaadin.com
    • Triggering command: /usr/lib/jvm/temurin-17-jdk-amd64/bin/java /usr/lib/jvm/temurin-17-jdk-amd64/bin/java --enable-native-access=ALL-UNNAMED -classpath /usr/share/apache-maven-3.9.14/boot/plexus-classworlds-2.9.0.jar -Dclassworlds.conf=/usr/share/apache-maven-3.9.14/bin/m2.conf -Dmaven.home=/usr/share/apache-maven-3.9.14 -Dlibrary.jansi.path=/usr/share/apache-maven-3.9.14/lib/jansi-native -Dmaven.multiModuleProjectDirectory=/home/REDACTED/work/flow/flow org.codehaus.plexus.classworlds.launcher.Launcher -q spotless:apply (dns block)
    • Triggering command: /usr/lib/jvm/temurin-17-jdk-amd64/bin/java /usr/lib/jvm/temurin-17-jdk-amd64/bin/java --enable-native-access=ALL-UNNAMED -classpath /usr/share/apache-maven-3.9.14/boot/plexus-classworlds-2.9.0.jar -Dclassworlds.conf=/usr/share/apache-maven-3.9.14/bin/m2.conf -Dmaven.home=/usr/share/apache-maven-3.9.14 -Dlibrary.jansi.path=/usr/share/apache-maven-3.9.14/lib/jansi-native -Dmaven.multiModuleProjectDirectory=/home/REDACTED/work/flow/flow org.codehaus.plexus.classworlds.launcher.Launcher -q -pl flow-server -am spotless:apply -DspotlessFiles=flow-server/src/main/java/com/vaadin/flow/server/communication/IndexHtmlRequestHandler.java,flow-server/src/test/java/com/vaadin/flow/server/communication/IndexHtmlRequestHandlerTest.java,flow-server/src/test/java/com/vaadin/flow/server/co ndor/bin/git (dns block)
    • Triggering command: /usr/lib/jvm/temurin-17-jdk-amd64/bin/java /usr/lib/jvm/temurin-17-jdk-amd64/bin/java --enable-native-access=ALL-UNNAMED -classpath /usr/share/apache-maven-3.9.14/boot/plexus-classworlds-2.9.0.jar -Dclassworlds.conf=/usr/share/apache-maven-3.9.14/bin/m2.conf -Dmaven.home=/usr/share/apache-maven-3.9.14 -Dlibrary.jansi.path=/usr/share/apache-maven-3.9.14/lib/jansi-native -Dmaven.multiModuleProjectDirectory=/home/REDACTED/work/flow/flow org.codehaus.plexus.classworlds.launcher.Launcher -q -pl flow-server spotless:apply (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

@sonarqubecloud
Copy link
Copy Markdown

@github-actions
Copy link
Copy Markdown

Test Results

 1 394 files  ±0   1 394 suites  ±0   1h 12m 35s ⏱️ - 2m 49s
10 065 tests ±0   9 995 ✅ ±0  70 💤 ±0  0 ❌ ±0 
10 540 runs  ±0  10 461 ✅ ±0  79 💤 ±0  0 ❌ ±0 

Results for commit d41000d. ± Comparison against base commit 53fedf9.

@mshabarov mshabarov changed the title [WIP] Remove redundant JS in index.html when no feature flags are enabled chore: Remove redundant JS in index.html when no feature flags are enabled Apr 29, 2026
@mshabarov mshabarov enabled auto-merge April 29, 2026 10:29
@mshabarov
Copy link
Copy Markdown
Contributor

Needs someone's else review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Redundant JS in index.html when no feature flags are enabled

2 participants