feat: consume bootstrap via struts webjars (5.3.8 + icons 1.13.1) - #423
Open
lukaszlenart wants to merge 10 commits into
Open
feat: consume bootstrap via struts webjars (5.3.8 + icons 1.13.1)#423lukaszlenart wants to merge 10 commits into
lukaszlenart wants to merge 10 commits into
Conversation
…umer) Requirements/design spec for adding first-class WebJars support to Struts core, served through the static-content pipeline with version-less path resolution, and consuming it from the struts2-bootstrap plugin to replace the ~2000 manually-vendored Bootstrap/bootstrap-icons files. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Self-contained, repo-portable framework-only spec to start WebJars support work fresh in apache/struts. Plugin-side consumer work continues here once the framework support ships. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Framework support merged (apache/struts PR #1765, WW-5640, in 7.2.2-SNAPSHOT). Plan covers pom deps + struts 7.2.2 floor, head.ftl -> <@s.webjar>, removal of vendored bootstrap/bootstrap-icons, README, and showcase verification. Coding deferred until Struts 7.2.2 is released. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Build against 7.2.2-SNAPSHOT (Apache snapshots repo) until 7.2.2 is released. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The <#assign>..</#assign> capture of <@s.webjar> yields a FreeMarker
markup_output, which ?trim rejects. Use the tag's var attribute (stored in
the value-stack context) and reference it through OGNL %{#var} in
<@s.script>/<@s.link> src/href (both OGNL-evaluated via findString).
Verified end-to-end in the showcase: bootstrap css/js, icons css and woff2
all serve 200.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…-support-design # Conflicts: # pom.xml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Replaces the plugin's ~2000 manually-vendored Bootstrap and bootstrap-icons files with
org.webjarsdependencies, served via Struts core's new WebJars support (<@s.webjar>/ apache/struts WW-5640, PR apache/struts#1765).org.webjars:bootstrap+org.webjars.npm:bootstrap-icons.head.ftlresolves asset URLs through<@s.webjar path="…" var="…"/>and composes them into<@s.script>/<@s.link>via OGNL%{#var}.template/bootstrap/css/**,template/bootstrap/bootstrap-icons/**, andtemplate/bootstrap/js/bootstrap*. Keeps the plugin's ownvalidation.js/validation.min.js.Why
Every Bootstrap release previously required re-downloading and re-committing ~2000 files by hand. WebJars turn that into a dependency bump.
This builds against
7.2.2-SNAPSHOT(WebJars support is merged to Strutsmainbut not yet released). A temporary Apache snapshots repository is added to the rootpom.xml.Before merge, once Struts 7.2.2 is published: remove the
apache-snapshots<repositories>block and pinstruts2.versionto7.2.2.Verification
Verified end-to-end against
7.2.2-SNAPSHOTvia the showcase (mvn -pl struts2-bootstrap-showcase jetty:run):…/static/webjars/bootstrap/5.3.8/css/bootstrap.min.css→200 text/css…/static/webjars/bootstrap/5.3.8/js/bootstrap.bundle.min.js→200 text/javascript…/static/webjars/bootstrap-icons/1.13.1/font/bootstrap-icons.min.css→200 text/css…/static/webjars/bootstrap-icons/1.13.1/font/fonts/bootstrap-icons.woff2→200 font/woff2(confirms the icons CSS relative./fonts/path resolves)validation.min.jsstill served from the plugin static path →200mvn clean installgreen.Notes
6.1.1(matches currentpom.xml); adjust if a different version is intended.docs/superpowers/.🤖 Generated with Claude Code