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

add webjars thymeleaf template modules #8327

Merged
merged 5 commits into from
Dec 30, 2023

Conversation

atomfrede
Copy link
Member

This PR is the first draft how to handle webjars with the thymeleaf template module.

udpates #4339

…hymeleaf/template/infrastructure/primary/ThymeleafTemplateModuleConfiguration.java
Copy link

codecov bot commented Dec 9, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (eb32343) 100.00% compared to head (06cb484) 100.00%.
Report is 51 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff             @@
##                main     #8327   +/-   ##
===========================================
  Coverage     100.00%   100.00%           
- Complexity      2645      2652    +7     
===========================================
  Files            689       689           
  Lines          11703     11743   +40     
  Branches         253       253           
===========================================
+ Hits           11703     11743   +40     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@atomfrede atomfrede marked this pull request as ready for review December 9, 2023 20:26
Copy link
Contributor

@murdos murdos left a comment

Choose a reason for hiding this comment

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

Please let me know when you want this PR merged (if you don't have the rights to merge it yourself) :-)

@@ -108,6 +108,8 @@ public enum JHLiteModuleSlug implements JHipsterModuleSlugFactory {
SPRING_BOOT_MVC_EMPTY("spring-boot-mvc-empty"),
SPRING_BOOT_THYMELEAF("spring-boot-thymeleaf"),
THYMELEAF_TEMPLATE("thymeleaf-template"),
THYMELEAF_TEMPLATE_HTMX_WEBJAR("thymeleaf-template-htmx-webjars"),
Copy link
Contributor

Choose a reason for hiding this comment

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

Just a suggestion: do we need _WEBJAR suffix? Maybe THYMELEAF_TEMPLATE_HTMX is sufficient.

Copy link
Member Author

Choose a reason for hiding this comment

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

Good point. For now let's keep it maybe to express webjars are used

| thymeleaf-template-alpinejs-webjars |
Then I should have files in "src/main/resources/templates/layout"
| main.html |
And I should have "@{/webjars/htmx.org/dist/htmx.min.js}" in "src/main/resources/templates/layout/main.html"
Copy link
Contributor

Choose a reason for hiding this comment

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

Just FYI, I observed that in current code, cucumber tests usually tests things in surface (e.g. check that file is present), whereas unit tests on the module factory usually check more finely content of generated files.
Not to say you should change it, I think its fine here since things are quite simple.

Copy link
Member Author

Choose a reason for hiding this comment

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

I would also keep it to make sure the webjars module is really applied.

@atomfrede
Copy link
Member Author

Please let me know when you want this PR merged (if you don't have the rights to merge it yourself) :-)

Yes @murdos I don't have the required rights to merge. Okay to merge from my point of view.

@murdos murdos merged commit 0f4b9c0 into jhipster:main Dec 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants