Skip to content

Conversation

ia3andy
Copy link
Contributor

@ia3andy ia3andy commented Aug 4, 2025

This fixes an issue after a change in dev-mode:
QuteSetup is clearing the templates

The template locator is then used to locate the templates with the variant, but before this fix, the variant info was lost.

This will fix: quarkiverse/quarkus-roq#587

@quarkus-bot quarkus-bot bot added the area/qute The template engine label Aug 4, 2025

This comment has been minimized.

@gastaldi gastaldi requested a review from mkouba August 4, 2025 15:27
@ia3andy
Copy link
Contributor Author

ia3andy commented Aug 4, 2025

I believe we should go one step further and keep a way to retrieve a fresh template of a template that was registered in the templates in TemplateEngine so that when cleared, we don't have to relocate..

Or instead of clearing in QuteSetup, we mark the templates as stale so that getTemplate, refreshes the content on demand?

This comment has been minimized.

@ia3andy
Copy link
Contributor Author

ia3andy commented Sep 4, 2025

@mkouba ping

@mkouba
Copy link
Contributor

mkouba commented Sep 5, 2025

Ok, so to sum it up: when quarkus.qute.dev-mode.no-restart-templates is used in the dev mode to specify some templates for which we don't want to restart the whole app then we make sure all cached templates are removed from the engine after modification (Engine#clearTemplates()). This ensures that the latest version is loaded and used.

Now I cannot say I understand what the modification from this PR does because it looks functionally equivalent to me 🤷.

Maybe if you could add a test that would fail with the previous version then it might be easier to understand what the problem actually is.

@ia3andy
Copy link
Contributor Author

ia3andy commented Sep 5, 2025

This is not only used for no-restart-template it is also used for non path build items

@mkouba
Copy link
Contributor

mkouba commented Sep 5, 2025

This is not only used for no-restart-template it is also used for non path build items

Then we actually need 2 tests ;-).

@mkouba
Copy link
Contributor

mkouba commented Sep 5, 2025

I will try to add the tests early next week.

- to simulate quarkus.qute.dev-mode.no-restart-templates in the dev mode
@mkouba
Copy link
Contributor

mkouba commented Sep 8, 2025

I've added a test but in order to reproduce the issue I still have to clear all the loaded templates. In other words, a user should not be affected unless the quarkus.qute.dev-mode.no-restart-templates is used or Engine#clearTemplates() is called explicitly.

@mkouba mkouba added the triage/waiting-for-ci Ready to merge when CI successfully finishes label Sep 8, 2025
Copy link

quarkus-bot bot commented Sep 8, 2025

Status for workflow Quarkus CI

This is the status report for running Quarkus CI on commit 08a25c4.

✅ 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.

@ia3andy ia3andy merged commit d53986f into quarkusio:main Sep 8, 2025
28 checks passed
@quarkus-bot quarkus-bot bot added this to the 3.28 - main milestone Sep 8, 2025
@ia3andy ia3andy deleted the fix-qute-locator branch September 8, 2025 16:18
@quarkus-bot quarkus-bot bot removed the triage/waiting-for-ci Ready to merge when CI successfully finishes label Sep 8, 2025
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.

Warnings after changing a file in dev mode

2 participants