Repository navigation
Conversation
core/utils.js resolved the icon fallback with a templated
import(`bootstrap-icons/icons/${name}`), which webpack turned into a lazy
context over all 2078 icons: ~65KB of filename→chunkid map inside the eager
patterns chunk, ~60KB of the chunk→hash runtime map in bundle.min.js, and
~2000 tiny chunk files in dist — parsed on every page for a fallback that is
almost never hit.
Resolve the fallback by fetching the icon resource URL from iconmap.json
instead (Plone already serves every bootstrap icon as a static resource),
keeping the same return shape (SVG markup string) for callers. Removes the
icon context entirely: the dist chunk count drops from ~3578 to ~1469 files
and bundle.min.js shrinks by ~80KB.
… of Plone Without a portal URL the fallback requested /++plone++bootstrap-icons/..., which only Plone serves, so standalone and CDN integrations got empty icons. Copy the bootstrap-icons SVGs next to the bundle and fetch them from webpack's public path in that case. The markspeciallinks tests failed because jsdom has no fetch; they now stub it to serve the icon files.
MrTango
marked this pull request as ready for review
October 8, 2026 14:17
This branch has not been deployed
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.
Summary
resolveIcon's fallback used a templatedimport("bootstrap-icons/icons/…"), which webpack turns into a lazy context over all 2078 icons, with its filename→chunk maps in the eager JS. The fallback now fetches a static SVG:webpack.config.jscopies the bootstrap-icons SVGs todist/bootstrap-icons/(copy-webpack-plugin), so standalone/CDN integrations and the demo keep working.Evidence
Production build, master (
65a1f85) vs this PR:bundle.min.jsresolveIconNew tests in
src/core/utils.test.js(iconresolver fails):markspeciallinks.test.jsnow stubsfetchwith the real icon files (jsdom has nofetch). All 58 suites pass.Merge Danger
Door: two-way
Blast Radius: small
Only the fallback path changes; Plone resolves icons via
@@iconresolverfirst.