Automatically check for incompatible scopes for Vaadin components
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 186
- Forks
- 98
- PR merge metrics
- No merged PRs in 30d
Description
A bean that is also a Vaadin Component will typically not work with any other scopes than prototype, view or UI. In any other case, the component will either be unexpectedly destroyed (e.g. request scope) or accidentally attached to multiple UIs (e.g. session or singleton). Especially singleton is quite often used by accident since it's the default scope.
To help users from debugging the relatively cryptic error messages you get when attaching a component to multiple UIs, we could instead implement e.g. a BeanFactoryPostProcessor that checks through all registered beans and fails with a clear error message if there are incompatible beans. We might also want to provide an annotation that can be used in the theoretical cases when such beans should still be permitted.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by examining how Spring registers beans and where a BeanFactoryPostProcessor could inspect their scopes. Define how Vaadin Components are identified, which scopes are compatible, and how an opt-out annotation would work. Done means incompatible component scopes fail with a clear error while explicitly permitted cases remain supported.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, spring, spring-boot
- Domain
- backend
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100