Skip to content

refactor: Move HasOrderedComponents methods to HasComponents and deprecate HasOrderedComponents#23773

Merged
mshabarov merged 7 commits intomainfrom
fix23687
Mar 10, 2026
Merged

refactor: Move HasOrderedComponents methods to HasComponents and deprecate HasOrderedComponents#23773
mshabarov merged 7 commits intomainfrom
fix23687

Conversation

@TatuLund
Copy link
Copy Markdown
Contributor

@TatuLund TatuLund commented Mar 6, 2026

fixes #23687

TatuLund added 2 commits March 6, 2026 09:00
The interface HasOrderedComponents is marked as deprecated and its methods have been moved to HasComponents for backward compatibility. The replace, indexOf, getComponentCount, getComponentAt, and getChildren methods have been removed.
@Artur-
Copy link
Copy Markdown
Member

Artur- commented Mar 6, 2026

Why should this be done?

@github-actions github-actions Bot added the +1.0.0 label Mar 6, 2026
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Mar 6, 2026

Test Results

 1 381 files  ±0   1 381 suites  ±0   1h 25m 49s ⏱️ - 1m 53s
 9 845 tests ±0   9 774 ✅ ±0  71 💤 ±0  0 ❌ ±0 
10 318 runs  ±0  10 238 ✅ ±0  80 💤 ±0  0 ❌ ±0 

Results for commit 546d6d5. ± Comparison against base commit 7807b66.

♻️ This comment has been updated with latest results.

@TatuLund
Copy link
Copy Markdown
Contributor Author

TatuLund commented Mar 6, 2026

Why should this be done?

Consider building e.g. framework or set of generic utilities on top of Vaadin. It would be clearer if we have just HasComponents, which offer the necessary methods, e.g. to replace a component. The division of these interfaces is I think inherited from Vaadin 8, but in Flow the implementation is done via Element API anyway, which already offers the needed mechanisms, so the division is purely arbitrary.

Quote from the customer: "And for our specific issue:
We need to replace Components. But not every HasComponents contains this method and only very few Components contain the Interface HasOrderedComponents. This is the main Issue here."

TatuLund added 5 commits March 6, 2026 10:07
Added a method to retrieve child components from a parent component, ensuring proper handling of wrapped components.
Refactor getChildren method to check if instance is Component.
Removed unused import for Stream.Builder.
Removed unnecessary Javadoc reference to Id.
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented Mar 6, 2026

@mshabarov mshabarov added the v26 label Mar 9, 2026
@mshabarov mshabarov removed the v26 label Mar 10, 2026
@mshabarov mshabarov merged commit 2513118 into main Mar 10, 2026
32 checks passed
@mshabarov mshabarov deleted the fix23687 branch March 10, 2026 12:03
vaadin-bot pushed a commit that referenced this pull request Mar 10, 2026
…ecate HasOrderedComponents (#23773)

* refactor: Move HasOrderedComponents methods to HasComponents and  derprecate HasOrderedComponents

* Deprecate HasOrderedComponents interface and remove methods

The interface HasOrderedComponents is marked as deprecated and its methods have been moved to HasComponents for backward compatibility. The replace, indexOf, getComponentCount, getComponentAt, and getChildren methods have been removed.

* Implement getChildren method for Component

Added a method to retrieve child components from a parent component, ensuring proper handling of wrapped components.

* Refactor getChildren method to use ComponentUtil

* Refactor getChildren method in HasComponents

Refactor getChildren method to check if instance is Component.

* Remove unused import for Stream.Builder

Removed unused import for Stream.Builder.

* Remove Javadoc reference to Id in getChildren method

Removed unnecessary Javadoc reference to Id.
@vaadin-bot
Copy link
Copy Markdown
Collaborator

Hi @TatuLund and @mshabarov, when i performed cherry-pick to this commit to 24.10, i have encountered the following issue. Can you take a look and pick it manually?
Error Message:
Error: Command failed: git cherry-pick 2513118
error: could not apply 2513118... refactor: Move HasOrderedComponents methods to HasComponents and deprecate HasOrderedComponents (#23773)
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".

mshabarov pushed a commit that referenced this pull request Mar 10, 2026
…ecate HasOrderedComponents (#23773) (#23823)

* refactor: Move HasOrderedComponents methods to HasComponents and  derprecate HasOrderedComponents

* Deprecate HasOrderedComponents interface and remove methods

The interface HasOrderedComponents is marked as deprecated and its methods have been moved to HasComponents for backward compatibility. The replace, indexOf, getComponentCount, getComponentAt, and getChildren methods have been removed.

* Implement getChildren method for Component

Added a method to retrieve child components from a parent component, ensuring proper handling of wrapped components.

* Refactor getChildren method to use ComponentUtil

* Refactor getChildren method in HasComponents

Refactor getChildren method to check if instance is Component.

* Remove unused import for Stream.Builder

Removed unused import for Stream.Builder.

* Remove Javadoc reference to Id in getChildren method

Removed unnecessary Javadoc reference to Id.

Co-authored-by: Tatu Lund <tatu@vaadin.com>
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.

HasOrderedComponents's Methods should be available in HasComponents

5 participants