refactor: Move frontend build classes to flow-build-tools#23161
Merged
Conversation
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
60451ca to
7b10f2a
Compare
mcollovati
requested changes
Jan 12, 2026
Collaborator
|
I don't remember if it has already been discussed, but should |
… 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.
Member
Author
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).
Member
Author
|
I think this is good enough as a starter. There are still files in |
|
mcollovati
approved these changes
Jan 12, 2026
9 tasks
This was referenced May 8, 2026
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



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