Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: explicitly mark MainView as a CDI bean #512

Merged
merged 1 commit into from
Feb 6, 2023

Conversation

mcollovati
Copy link
Contributor

Description

Adding the @CdiComponent annotation to MainView allows it to be correctly detected as a CDI bean, so that lifecycle hooks are invoked. This is required because starting with Jakarta 10 bean-discovery-mode default value is 'annotated'. Another solution may have been to modify beans.xml to set bean-discovery-mode to 'all', but this is not the recommended way.

Relates to vaadin/flow#15625

Type of change

  • Bugfix
  • Feature

Checklist

  • I have read the contribution guide: https://vaadin.com/docs/latest/guide/contributing/overview/
  • I have added a description following the guideline.
  • The issue is created in the corresponding repository and I have referenced it.
  • I have added tests to ensure my change is effective and works as intended.
  • New and existing tests are passing locally with my change.
  • I have performed self-review and corrected misspellings.

Additional for Feature type of change

  • Enhancement / new feature was discussed in a corresponding GitHub issue and Acceptance Criteria were created.

Adding the `@CdiComponent` annotation to MainView allows it to be correctly
detected as a CDI bean, so that lifecycle hooks are invoked.
This is required because starting with Jakarta 10 bean-discovery-mode default
value is 'annotated'. Another solution may have been to modify beans.xml to set
bean-discovery-mode to 'all', but this is not the recommended way.
@mshabarov mshabarov merged commit a13d082 into v24 Feb 6, 2023
@mshabarov mshabarov deleted the fix/mainview_as_cdi_bean branch February 6, 2023 11:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants