Skip to content

refactor: Move frontend build classes to flow-build-tools#23161

Merged
Artur- merged 21 commits into
mainfrom
reverse-build-tool-deps
Jan 12, 2026
Merged

refactor: Move frontend build classes to flow-build-tools#23161
Artur- merged 21 commits into
mainfrom
reverse-build-tool-deps

Conversation

@Artur-
Copy link
Copy Markdown
Member

@Artur- Artur- commented Jan 9, 2026

The idea with flow-build-tools is that it contains classes only used by vaadin-dev-server and the plugins. It is ok for flow-build-tools to depend on flow-server but not the other way around

Fixes #22238
Fixes #22778

@Artur- Artur- changed the title refactor: Fix reversed internal dependency refactor: Move frontend build classes to flow-build-tools Jan 9, 2026
Artur- added 2 commits January 9, 2026 14:42
The idea with flow-build-tools is that it contains classes only used by vaadin-dev-server and the plugins. It is ok for flow-build-tools to depend on flow-server but not the other way around
@Artur- Artur- force-pushed the reverse-build-tool-deps branch from 60451ca to 7b10f2a Compare January 9, 2026 12:42
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jan 9, 2026

Test Results

1 311 files  ± 0  1 311 suites  ±0   1h 14m 43s ⏱️ -59s
9 298 tests ± 0  9 230 ✅ ± 0  68 💤 ±0  0 ❌ ±0 
9 743 runs   - 15  9 667 ✅  - 16  76 💤 +1  0 ❌ ±0 

Results for commit 98b9d3f. ± Comparison against base commit 13427a0.

♻️ This comment has been updated with latest results.

@Artur- Artur- marked this pull request as ready for review January 9, 2026 16:45
Comment thread flow-plugins/flow-maven-plugin/src/it/classfinder-lookup/pom.xml
Comment thread flow-plugins/flow-maven-plugin/src/it/frontend-scanner-tuning-project/pom.xml Outdated
Comment thread flow-polymer2lit/pom.xml
@mcollovati
Copy link
Copy Markdown
Collaborator

I don't remember if it has already been discussed, but should flow-build-tools added to the Flow BOM?

… plugin ITs

Make flow-build-tools dependency provided and optional in integration tests
to prevent it from being picked up by ClassFinder as a project dependency.
This better simulates real application projects which don't typically depend
on build tools directly.

Changes:
- Add provided+optional scope to 6 ITs that implement TypeScriptBootstrapModifier:
  - classfinder-lookup
  - resources-from-project
  - deps-with-classifier-dups-project
  - plugin-pinned-deps-project
  - commercial-banner-build
  - ignore-maven-deps-from-project
- Remove flow-build-tools dependency entirely from frontend-scanner-tuning-project
  (doesn't implement TypeScriptBootstrapModifier and doesn't need the dependency)

All ITs pass successfully with these changes.
@Artur-
Copy link
Copy Markdown
Member Author

Artur- commented Jan 12, 2026

I don't remember if it has already been discussed, but should flow-build-tools added to the Flow BOM?

Done in #23167

Remove TypeScriptBootstrapModifier implementations and flow-build-tools
dependencies from integration tests that don't actually test or verify
the modifier functionality. This makes the ITs better simulate real
application projects that don't implement build-time interfaces.

Changes to 5 ITs (resources-from-project, deps-with-classifier-dups-project,
plugin-pinned-deps-project, commercial-banner-build, ignore-maven-deps-from-project):
- Remove ProjectFlowExtension.java implementations
- Remove flow-build-tools dependency entirely

Changes to classfinder-lookup IT:
- Remove project-level ProjectFlowExtension.java
- Remove flow-build-tools dependency
- Update verify.bsh to test only addon-level TypeScriptBootstrapModifier
- Update description to clarify it tests addon modifier discovery
- Now simulates a pure application project that only consumes modifiers from addons

This completes the Phase 2 cleanup, making all ITs realistic simulations
of either application projects (no TypeScriptBootstrapModifier) or the
addon discovery mechanism (flow-addon provides the modifier).
@Artur-
Copy link
Copy Markdown
Member Author

Artur- commented Jan 12, 2026

I think this is good enough as a starter. There are still files in flow-server that belong in flow-build-tools, like Vite configurations but the main purpose of this PR is just to get the dependency graph corrected.

@sonarqubecloud
Copy link
Copy Markdown

@Artur- Artur- merged commit 1532023 into main Jan 12, 2026
31 checks passed
@Artur- Artur- deleted the reverse-build-tool-deps branch January 12, 2026 14:24
ZheSun88 added a commit that referenced this pull request May 8, 2026
… (CP: 25.0) (#24296)

Cherry-pick of #24288 (commit d9290f8) from main to 25.0.

## Summary

Same fix as #24288: switches pnpm install to hoisted (flat npm-style)
layout so transitive npm deps (`@babel/types`, `@lit/reactive-element`,
`cookie`, `set-cookie-parser`, `@preact/signals-react/runtime`) are
always reachable from project root, eliminating the `vite-basics` IT
hang and similar symptoms.

## Adjustments for 25.0

This branch is pre-`flow-build-tools` refactor (#23161), so all the
Java files the original commit touches (`FrontendTools.java`,
`FrontendToolsTest.java`, `NodeUpdaterTest.java`,
`TaskRunPnpmInstallTest.java`) live under `flow-server/` here. The
edits are otherwise identical.

Two version adjustments to match this branch's dep graph:

1. **`@babel/types` pinned to `7.28.5`** (matching `@babel/preset-react`
   already in `vite/package.json`) instead of main's `7.29.0`. 25.0
   does not declare `@babel/core`, so version coherence is anchored to
   `preset-react`.

2. **Skipped `@babel/core` and
`@babel/plugin-transform-react-jsx-development`**
   declarations from the main commit — not declared as direct deps on
   25.0, and the React function location plugin only imports
   `@babel/types`.

Everything else is identical:
- `flow-server/.../npmrc`: adds `node-linker=hoisted`.
- `FrontendTools.java`: replaces `--shamefully-hoist=true` CLI flag
  with `--config.node-linker=hoisted`.
- All three test files updated to match the new assertions.

## Test plan

- [ ] CI on this PR passes (specifically `it-tests (1)` and `it-tests
(2)`).
- [ ] `mvn -pl flow-server test
-Dtest=NodeUpdaterTest,TaskRunPnpmInstallTest,FrontendToolsTest` passes.
- [ ] After install in any vite-using IT module, `node_modules/.pnpm/`
does not exist (or is empty); `node_modules/@babel/types/` and
`node_modules/@lit/reactive-element/` exist as real directories at the
project root.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Zhe Sun <zhe@vaadin.com>
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
ZheSun88 added a commit that referenced this pull request May 8, 2026
… (CP: 24.10) (#24297)

Cherry-pick of #24288 (commit d9290f8) from main to 24.10.

## Summary

Same fix as #24288: switches pnpm install to hoisted (flat npm-style)
layout so transitive npm deps (`@babel/types`, `@lit/reactive-element`,
`cookie`, `set-cookie-parser`, `@preact/signals-react/runtime`) are
always reachable from project root, eliminating the `vite-basics` IT
hang and similar symptoms.

## Adjustments for 24.10

24.10 is pre-`flow-build-tools` refactor (#23161), so all the Java
files the original commit touches (`FrontendTools.java`,
`FrontendToolsTest.java`, `NodeUpdaterTest.java`,
`TaskRunPnpmInstallTest.java`) live under `flow-server/` here. The
edits are otherwise identical.

Two version adjustments to match this branch's dep graph:

1. **`@babel/types` pinned to `7.28.5`** (matching
`@babel/preset-react`)
   instead of main's `7.29.0`. 24.10 does not declare `@babel/core`,
   so version coherence is anchored to `preset-react`.

2. **Skipped `@babel/core` and
`@babel/plugin-transform-react-jsx-development`**
   declarations from the main commit — not declared as direct deps on
   24.10, and the React function location plugin only imports
   `@babel/types`.

## Supersedes #24289

This PR replaces #24289 (the narrower @babel/types-only fix). Once
this lands, #24289 should be closed.

## Test plan

- [ ] CI on this PR passes (specifically `it-tests (1)` and `it-tests
(2)`).
- [ ] `mvn -pl flow-server test
-Dtest=NodeUpdaterTest,TaskRunPnpmInstallTest,FrontendToolsTest` passes.
- [ ] After install in any vite-using IT module, `node_modules/.pnpm/`
does not exist (or is empty); `node_modules/@babel/types/` and
`node_modules/@lit/reactive-element/` exist as real directories at the
project root.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Zhe Sun <zhe@vaadin.com>
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
ZheSun88 added a commit that referenced this pull request May 8, 2026
… (CP: 24.9) (#24298)

Cherry-pick of #24288 (commit d9290f8) from main to 24.9.

## Summary

Same fix as #24288: switches pnpm install to hoisted (flat npm-style)
layout so transitive npm deps (`@babel/types`, `@lit/reactive-element`,
`cookie`, `set-cookie-parser`, `@preact/signals-react/runtime`) are
always reachable from project root, eliminating the `vite-basics` IT
hang and similar symptoms.

## Adjustments for 24.9

24.9 is pre-`flow-build-tools` refactor (#23161), so all the Java
files the original commit touches (`FrontendTools.java`,
`FrontendToolsTest.java`, `NodeUpdaterTest.java`,
`TaskRunPnpmInstallTest.java`) live under `flow-server/` here. The
edits are otherwise identical.

Two version adjustments to match this branch's dep graph:

1. **`@babel/types` pinned to `7.27.1`** (matching
`@babel/preset-react`)
   instead of main's `7.29.0`. 24.9 does not declare `@babel/core`,
   so version coherence is anchored to `preset-react` — which on 24.9
   is on the older `7.27.x` line.

2. **Skipped `@babel/core` and
`@babel/plugin-transform-react-jsx-development`**
   declarations from the main commit — not declared as direct deps on
   24.9, and the React function location plugin only imports
   `@babel/types`.

## Test plan

- [ ] CI on this PR passes (specifically `it-tests (1)` and `it-tests
(2)`).
- [ ] `mvn -pl flow-server test
-Dtest=NodeUpdaterTest,TaskRunPnpmInstallTest,FrontendToolsTest` passes.
- [ ] After install in any vite-using IT module, `node_modules/.pnpm/`
does not exist (or is empty); `node_modules/@babel/types/` and
`node_modules/@lit/reactive-element/` exist as real directories at the
project root.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Zhe Sun <zhe@vaadin.com>
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.

flow-server contains a ton of code only needed during development/compilation Remove com.vaadin.flow.server.frontend.scanner from flow-server

3 participants