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

Qute: support synthetic named CDI beans injected in templates #42220

Merged
merged 1 commit into from
Jul 30, 2024

Conversation

mkouba
Copy link
Contributor

@mkouba mkouba commented Jul 30, 2024

  • this requires an additional late initialization of the QuteContext bean

- this requires an additional late initialization of the QuteContext
bean
@mkouba mkouba requested review from gastaldi and ia3andy July 30, 2024 11:21
@quarkus-bot quarkus-bot bot added the area/qute The template engine label Jul 30, 2024
@quarkus-bot
Copy link

quarkus-bot bot commented Jul 30, 2024

Status for workflow Quarkus CI

This is the status report for running Quarkus CI on commit 31848b8.

✅ The latest workflow run for the pull request has completed successfully.

It should be safe to merge provided you have a look at the other checks in the summary.

You can consult the Develocity build scans.

Copy link
Contributor

@ia3andy ia3andy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this @mkouba, I am testing it now.

It would be nice if we could have a new kind of Supplier for synthetic beans, let's call them InitSupplier (InitializableSupplier) which takes two types as generic type <InitType, SuppliedType> which extends Supplier<SuppliedType> but with an extra setter for InitType. This would allow:

  1. To hide the setter from the user api
  2. To have a common buildtime check buildstep to make sure the data is initialized by the extension

I also had a case with a similar Cycle issue due to synthetic beans and had to provide a similar workaround.

@ia3andy ia3andy merged commit 545c7d7 into quarkusio:main Jul 30, 2024
23 checks passed
@quarkus-bot quarkus-bot bot added this to the 3.14 - main milestone Jul 30, 2024
@ia3andy
Copy link
Contributor

ia3andy commented Jul 30, 2024

I've tested it and it works well! @mkouba do you think it's safe to backport it to 3.13.0?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/qute The template engine
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants