-
Notifications
You must be signed in to change notification settings - Fork 3k
Introduce Qute templating extensions #5793
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
This PR is 134 files. Marking it as Please let more people review this stuff as it's a significant addition. |
I'll have a look myself before the end of the week but I still have a couple of other PRs to review first. |
@gsmet Yes, and unfortunately it can't be reduced.
That's how @gastaldi works. You have to forgive him ;-). I think that nobody expected that this PR is merged immediately after the CI is green. However, 1) Most of the stuff was already discussed separately, 2) this is the first PR related to Qute but definitely not the last one - the extension is marked as preview and I'd like to merge the current state ASAP and improve what we have later because I see no benefits in discussing PRs for weeks. |
It's not about discussing for weeks, it's about reviewing the code and the documentation. I'm not saying we should hold this PR to have more design discussions if it wasn't clear. But we need a proper code review. I'm just asking for others - including me - to have a chance at reviewing. |
No problem. And I think that nobody is against. |
Btw, my remark on the size of the PR wasn't negative. I know it's a massive addition so no wonder it's a massive piece of code. Just to clarify, adding |
@mkouba is there a reason why |
Is there any way to fetch the raw template contents from |
I'm not sure we have to review the |
The |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM: all the remarks and questions I have can be solved later in new issues.
public class ItemResource { | ||
|
||
@Inject | ||
VariantTemplate item; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure why we need to make variants explicit here. It requires to modify the controller when we could just add a new template file and it could be picked up as a variant. The fact that more than one version exists should be enough to guide the implementation to know there are variants.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I disagree. You could have 2 files with different extensions that you want to use in different context.
I'm not totally sure, I would use the class to mark that but I think we need to have a way to enable it explicitly.
extensions/qute/runtime/src/main/java/io/quarkus/qute/runtime/DefaultTemplateExtensions.java
Show resolved
Hide resolved
I've renamed |
It seems we have a problem with Windows and separators :-(. I'll try to address it tomorrow. |
Why cannot the template engine and syntax be based on |
The failure of the windows build is caused by #5821. |
@jaikiran now I can see a weird error:
AFAIK the directory should be empty (see https://github.com/quarkusio/quarkus/blob/master/test-framework/junit5-internal/src/main/java/io/quarkus/test/QuarkusUnitTest.java#L345-L368). I'll try to run a windows box to see what's really happening. |
@mkouba, just a quick input - keeping aside those failed to delete issues (in the So the You know this code better than me, so ignore this input if it isn't right :) I had a few spare minutes and happened to find a Windows OS so just quickly ran the failing |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added some comments and questions.
There are a lot of very minor things but also a couple of more important interrogations.
public static final String REACTIVE_MYSQL_CLIENT = "reactive-mysql-client"; | ||
public static final String NEO4J = "neo4j"; | ||
public static final String OIDC = "oidc"; | ||
public static final String QUTE = "qute"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't advertise the RESTEasy one? There might be good reason not to, just asking.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A user will see [qute, resteasy]
... I don't think there's a reason to add qute-resteasy
or resteasy-qute
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Out of curiosity: Is it possible to automatically include qute-resteasy
only if qute
and resteasy
are added to the project?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this could be done automatically ATM. But yes, it would make sense.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So... it's not that obvious to me.
If you have [qute, resteasy], that doesn't mean that you have the RESTEasy Qute support. The dependency could be missing and nothing will work.
So you could have two applications returning the exact same set of extensions and behaving differently. This is a problem IMHO.
And even for us or for support, when they will ask for the extension list, they will have a partial information.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, ignoring my comment doesn't magically resolve the issue ;)
I really think we should make it easy for support to know the list of installed extensions. As explained above, right now, they might have the same list of extensions and totally different behaviors.
RESTEasy Qute is a user exposed extension so it should be displayed here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, ignoring my comment doesn't magically resolve the issue ;)
That's a pity ;-). Well, I didn't know we have resteasy-jsonb
and others. I will add it but it looks weird. Just my 2c.
independent-projects/qute/core/src/main/java/io/quarkus/qute/MemberKey.java
Outdated
Show resolved
Hide resolved
independent-projects/qute/core/src/main/java/io/quarkus/qute/ReflectionValueResolver.java
Show resolved
Hide resolved
independent-projects/qute/core/src/main/java/io/quarkus/qute/ValueResolvers.java
Show resolved
Hide resolved
...easy/deployment/src/main/java/io/quarkus/qute/resteasy/deployment/QuteResteasyProcessor.java
Show resolved
Hide resolved
@jaikiran Yep, you're right. I also added some logging and found out that
I'll fix the |
dd486c0
to
271724c
Compare
- qute core as an independent project - qute core extension - qute resteasy extension - first version of guide
…urce in RuntimeClassLoader
- also fix RuntimeClassLoader.createDefaultProtectionDomain(Path)
b06ac76
to
b679186
Compare
Good to know :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mkouba we are nearly there I think.
Could you have a look at my latest comments? It would be great if we could merge it tomorrow.
BTW, I'm wondering if it would be better to squash the resteasy-qute renaming commit? But maybe it was conflicting? If so don't bother.
public static final String REACTIVE_MYSQL_CLIENT = "reactive-mysql-client"; | ||
public static final String NEO4J = "neo4j"; | ||
public static final String OIDC = "oidc"; | ||
public static final String QUTE = "qute"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, ignoring my comment doesn't magically resolve the issue ;)
I really think we should make it easy for support to know the list of installed extensions. As explained above, right now, they might have the same list of extensions and totally different behaviors.
RESTEasy Qute is a user exposed extension so it should be displayed here.
extensions/qute/runtime/src/main/java/io/quarkus/qute/runtime/EngineProducer.java
Outdated
Show resolved
Hide resolved
...qute/deployment/src/main/java/io/quarkus/resteasy/qute/deployment/QuteResteasyProcessor.java
Outdated
Show resolved
Hide resolved
- plus other fixes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, let's get this monster in :).
@mkouba thanks for your work and your patience :).
The
It's very likely unrelated. I'll try to re-run the test once again. |
Yes, it's unrelated. Looks like CI cache issue all over again. |
NOTE: Extensions are considered
preview
.