docs: note the Vaadin 26 hierarchy format default change - #6032
Open
totally-not-ai[bot] wants to merge 1 commit into
Open
totally-not-ai[bot] wants to merge 1 commit into
totally-not-ai[bot] wants to merge 1 commit into
Conversation
Vaadin 25.3 deprecates the setItems and setTreeData shorthands and the single-argument TreeDataProvider constructor, because the hierarchy format they default to changes from NESTED to FLATTENED in Vaadin 26. The Tree Grid data binding page documented neither the deprecation nor the coming change, so a reader following it hits a deprecation warning with no explanation. Both places now say what changes, that it affects methods like scrollToIndex, and how to keep the current behavior by passing the format explicitly.
Contributor
Preview DeploymentThis PR has been deployed for preview. URL: https://docs-preview-pr-6032.fly.dev Changed pagesAdded content is highlighted in green; removed content is marked in red on each page.
Built from 29b716e |
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.
Summary
Vaadin 25.3 deprecates three Tree Grid data-binding entry points because the hierarchy format they pick for you changes in Vaadin 26:
vaadin/flow#24908—TreeDataProvider(TreeData)defaults toHierarchyFormat.NESTEDtoday,FLATTENEDfrom Vaadin 26.vaadin/flow#24940—setItems(...)andsetTreeData(...)create that provider under the hood, so they change the same way.The Tree Grid Binding Data page teaches both
setItems()and the provider, so a reader following it now gets a deprecation warning with nothing explaining it.What changed
Two notes in
articles/components/tree-grid/data-binding.adoc:setItems()/setTreeData()shorthands are deprecated; they create aNESTEDprovider today and aFLATTENEDone from Vaadin 26, which affects methods whose behavior depends on the format, such asscrollToIndex(). To keep today's behavior, build theTreeDataProviderexplicitly and pass it tosetDataProvider().FLATTENED: the single-argument constructor is deprecated for the same reason, so pass the format explicitly.The
HierarchyFormat.NESTED (default)heading further down is left alone on purpose:NESTEDremains the default ofHierarchicalDataProvider.getHierarchyFormat()for custom providers; only whatTreeDataProviderand the shorthands choose is changing.How to test
Documentation only, no code examples added, so nothing to compile. The wording matches the
@deprecatedjavadoc ofTreeDataProviderandHasHierarchicalDataProviderin 25.3.