Skip to content

Conversation

@mstahv
Copy link
Member

@mstahv mstahv commented Nov 17, 2025

Description

Moves stuff that really never should have been in vaadin-server module to a separate module and tries to keep minimal amount of that code in vaadin-server.

Also removes commons-io and commons-compress dependencies from vaadin-server (and this way from production mode Vaadin apps) as those are now either not needed or can be replaced with trivial code from newer JDKs.

Current state: early prototype, tested in local projects to work at least to some extent.

Type of change

  • Bugfix
  • Feature

Checklist

  • I have read the contribution guide: https://vaadin.com/docs/latest/guide/contributing/overview/
  • I have added a description following the guideline.
  • The issue is created in the corresponding repository and I have referenced it.
  • I have added tests to ensure my change is effective and works as intended.
  • New and existing tests are passing locally with my change.
  • I have performed self-review and corrected misspellings.

Additional for Feature type of change

  • Enhancement / new feature was discussed in a corresponding GitHub issue and Acceptance Criteria were created.

And from vaadin-spring where it leaked into via dev-server.
…ow-server

Most of this should be in vaadin-dev 🤔
…rom flow-server

Claude initiated, not finished yet, not even the tests compile...
Now basic usage seems to work again after refactoring.
(after rebase)
@vaadin vaadin deleted a comment from github-actions bot Nov 17, 2025
@sonarqubecloud
Copy link

@github-actions
Copy link

Test Results

1 172 files   -   119  1 172 suites   - 119   1h 9m 44s ⏱️ - 6m 28s
7 839 tests  - 1 171  7 785 ✅  - 1 158  49 💤  - 18  3 ❌ +3  2 🔥 +2 
8 263 runs   - 1 202  8 198 ✅  - 1 189  60 💤  - 18  3 ❌ +3  2 🔥 +2 

For more details on these failures and errors, see this check.

Results for commit 4dc58c4. ± Comparison against base commit ada6b1a.

This pull request removes 1171 tests.
com.vaadin.flow.AddQueryParamIT(production) ‑ validateReactInUse[any_Chrome_]
com.vaadin.flow.NavigationIT(production) ‑ testReactNavigationBrowserHistoryBack_serverNavigation[any_Chrome_]
com.vaadin.flow.NavigationIT(production) ‑ testReactNavigation_flowContentCleaned[any_Chrome_]
com.vaadin.flow.NavigationIT(production) ‑ testreactNavigationBrowserHistoryBack_anchor[any_Chrome_]
com.vaadin.flow.StateIT(production) ‑ validateReactInUse[any_Chrome_]
com.vaadin.flow.component.littemplate.BundleLitParserTest ‑ parseTemplate
com.vaadin.flow.component.littemplate.BundleLitParserTest ‑ parseTemplateWithComments_commentsProperlyIgnored
com.vaadin.flow.component.littemplate.BundleLitParserTest ‑ parseTemplate_codeInRenderBeforeHtml_templateProperlyParsed
com.vaadin.flow.component.littemplate.BundleLitParserTest ‑ parseTemplate_codeWithHtmlAfterRender_templateProperlyParsed
com.vaadin.flow.component.littemplate.BundleLitParserTest ‑ parseTemplate_codeWithHtmlBeforeRender_templateProperlyParsed
…

private boolean dependencyHasTagName(Dependency dependency, String tag) {
String url = FilenameUtils.removeExtension(dependency.getUrl())
.toLowerCase(Locale.ENGLISH);
String url = dependency.getUrl();
Copy link
Member

Choose a reason for hiding this comment

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

We should not do it like this. If we want to have our own utils instead of using one util method from a dependency, then let's add a util method and let's not add the implementation inline in various places

<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.vaadin</groupId>
Copy link
Member

Choose a reason for hiding this comment

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

This sounds wrong. If the frontend tools module exists, it should only be used from the dev server and from the Maven/Gradle plugins

Copy link
Member Author

Choose a reason for hiding this comment

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

What is flow-polymer2lit module really doing 🤔 Probably pulled in elsewhere as well. Need to check.

try {
FileUtils.write(featureFlagFile, properties.toString(),
StandardCharsets.UTF_8);
java.nio.file.Files.writeString(featureFlagFile.toPath(),
Copy link
Member

Choose a reason for hiding this comment

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

To make things easier, this and similar fixes should be made as a separate PR. That PR is trivial to review and merge - contrary to this one

Copy link
Member Author

Choose a reason for hiding this comment

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

This is a draft PR to explore the viability, as discussed elsewhere and started from totally different angle. In hindsight everybody would do it in batches (order really doesn't matter) 🧸

@mshabarov mshabarov added the Contribution PRs coming from the community or external to the team label Nov 17, 2025
@mshabarov mshabarov requested a review from mcollovati November 17, 2025 12:34
mcollovati pushed a commit that referenced this pull request Nov 19, 2025
…dencies (#22758)

commons-compress dependency is only used to download front-end build tooling. Due to non-optimal modularisation this code is in flow-server and it leaks into production deployments (see #22778). This change does not properly fix that large issue, but can be considered as a start to work towards fixing it.

Took this alternative approach as cleanin up the whole development/compilation time code from vaadin-server appears to be too large piece to tackle at once (see to gigantic #22748 ). This only moves parts that use commons-compress to a separate module (provided scope), users must bring it to classpath (plugins/dev-mode).

Removing commons-io from flow-server ought to be rather straightforward after this change, but a lot of code would still be in wrong place and e.g. #22238 would still be on the tasklist. But, these are all marked "internal classes", so we should be able to do cleanup even during 25 without event changing dependencies.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Contribution PRs coming from the community or external to the team +1.0.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants