docs: cover common Vaadin 8 to 25 migration pitfalls - #5997
Merged
Conversation
Based on feedback from a production Vaadin 8 to 25 migration, where each of these cost real debugging time. Charts: document that a series is linked to a Configuration only by addSeries()/setSeries(), so getConfiguration() returns null before that and setyAxis(YAxis) throws. Not a V25 change, but a frequent source of NullPointerException when migrating chart code. Security: warn against configuring form login with Spring Security's formLogin() instead of the configurer's loginView(), which leaves Vaadin's internal requests subject to the authentication entry point and produces a redirect loop. Add a section on the ROLE_ prefix convention, including GrantedAuthorityDefaults, which was not documented at all. Show AuthenticationContext for programmatic role checks, since migrated applications tend to reach for a static utility class that would miss the prefix handling. Upgrading: quote the layout access-denied message so it is searchable and explain how to pick the annotation; note that an AppShellConfigurator without @Stylesheet loads no theme at all; add guidance on keeping the upgrade scoped to what the breaking changes require. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Preview DeploymentThis PR has been deployed for preview. URL: https://docs-preview-pr-5997.fly.dev Changed pagesAdded content is highlighted in green; removed content is marked in red on each page.
Built from 88c4aed |
peholmst
added a commit
that referenced
this pull request
Sep 10, 2026
….2) (#5998) Co-authored-by: Petter Holmström <petter@vaadin.com> Co-authored-by: Claude Opus 5 <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.
Based on feedback from a production Vaadin 8 → 25 migration. Each item below caused real debugging time and was either missing from the docs or hard to find from the symptom.
Charts —
series.getConfiguration()returnsnullNew Series and Configuration section. A series is linked to a
Configurationonly byaddSeries()/setSeries(), so readinggetConfiguration()before that throwsNullPointerException, andsetyAxis(YAxis)throwsIllegalStateException.The feedback reported this as a V25 breaking change. It isn't —
AbstractSeriesbehaves identically in 24.9.7 and 25.0.0 — so it's documented as a Charts pitfall rather than in the Upgrading Guide. It still bites when migrating V8 chart code that configures series before adding them.Security — form login
Warning against configuring form login with Spring Security's
formLogin()instead of the configurer'sloginView(), with the symptom (ERR_TOO_MANY_REDIRECTS/ "Connection lost"), plus a short pointer from theVaadinWebSecuritymigration steps in the Upgrading Guide.Security — the
ROLE_prefixNew "Roles & the Role Prefix" section: why
@RolesAllowed("ADMIN")matchesROLE_ADMIN, whyUser.roles()works butauthorities()doesn't, a warning that a missing prefix fails silently, andGrantedAuthorityDefaultsfor changing it.GrantedAuthorityDefaultshad no mentions in the docs before this.Security — programmatic role checks
The feedback proposed documenting a static
SecurityUtilshelper.AuthenticationContextalready does that job and, unlike a static helper, strips the configured prefix instead of hardcodingROLE_. Extended the Security Utilities section with the conditional-nav-item example instead, plus a note that hiding a nav item isn't a security measure.Upgrading — layout access denied
Quoted the actual message so it's searchable, and explained how to choose the annotation. Correcting the premise slightly: the framework message already suggests the annotations (verified in
AnnotatedViewAccessCheckerfor both 25.0.0 and 25.3.0-beta3), so this is about findability. Also, the feedback's advice to always use@PermitAllis too narrow — the layout must be at least as permissive as the views it hosts.Upgrading — no default theme
Two accuracy adjustments to the reported symptom: the app renders with minimal base styles, not raw HTML, and an app with no
AppShellConfiguratorstill falls back to Aura. The trap is specifically having one without a@StyleSheet, which is the upgraded-app case.Upgrading — keeping the upgrade scoped
Short subsection in the Overview on changing only what the breaking changes require, including a note that this is worth stating explicitly to AI coding assistants.
One feedback item is not addressed here: the primer returned by
get_vaadin_primershowsVaadinSecurityConfigurer.apply(http), which does not exist —vaadin()is the only factory method. That is already fixed in the MCP server release currently in QA, and the endpoint URL isn't changing, so no docs change is needed.Vale is clean on all three files (remaining alerts are pre-existing) and Asciidoctor reports no new structural warnings.
🤖 Generated with Claude Code