Skip to content

docs: cover common Vaadin 8 to 25 migration pitfalls - #5997

Merged
peholmst merged 1 commit into
mainfrom
claude/vaadin-migration-docs-2aa714
Sep 10, 2026
Merged

docs: cover common Vaadin 8 to 25 migration pitfalls#5997
peholmst merged 1 commit into
mainfrom
claude/vaadin-migration-docs-2aa714

Conversation

@peholmst

Copy link
Copy Markdown
Member

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() returns null

New Series and Configuration section. A series is linked to a Configuration only by addSeries()/setSeries(), so reading getConfiguration() before that throws NullPointerException, and setyAxis(YAxis) throws IllegalStateException.

The feedback reported this as a V25 breaking change. It isn't — AbstractSeries behaves 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's loginView(), with the symptom (ERR_TOO_MANY_REDIRECTS / "Connection lost"), plus a short pointer from the VaadinWebSecurity migration steps in the Upgrading Guide.

Security — the ROLE_ prefix

New "Roles & the Role Prefix" section: why @RolesAllowed("ADMIN") matches ROLE_ADMIN, why User.roles() works but authorities() doesn't, a warning that a missing prefix fails silently, and GrantedAuthorityDefaults for changing it. GrantedAuthorityDefaults had no mentions in the docs before this.

Security — programmatic role checks

The feedback proposed documenting a static SecurityUtils helper. AuthenticationContext already does that job and, unlike a static helper, strips the configured prefix instead of hardcoding ROLE_. 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 AnnotatedViewAccessChecker for both 25.0.0 and 25.3.0-beta3), so this is about findability. Also, the feedback's advice to always use @PermitAll is 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 AppShellConfigurator still 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_primer shows VaadinSecurityConfigurer.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

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>
@github-actions

Copy link
Copy Markdown

Preview Deployment

This PR has been deployed for preview.

URL: https://docs-preview-pr-5997.fly.dev

Changed pages

Added content is highlighted in green; removed content is marked in red on each page.

Built from 88c4aed

@peholmst peholmst added the target/v25.2 Automatically cherry-pick to the v25.2 branch label Sep 10, 2026
@peholmst
peholmst merged commit 231dfdc into main Sep 10, 2026
9 checks passed
@peholmst
peholmst deleted the claude/vaadin-migration-docs-2aa714 branch September 10, 2026 11:14
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cherry-picked-v25.2 target/v25.2 Automatically cherry-pick to the v25.2 branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants