Skip to content

Thet/icons fallback fetch - #1661

Draft
thet wants to merge 3 commits into
masterfrom
thet/icons-fallback-fetch
Draft

thet wants to merge 3 commits into
masterfrom
thet/icons-fallback-fetch

Conversation

@thet

@thet thet commented Oct 11, 2026 •

Copy link
Copy Markdown
Member

Follow-up and alternative approach of #1642 to fetch the icons from a CDN instead of bundling them.

NOTE

this is a DRAFT! It's uncommented and untested, a WIP. the tests need adaptions and I didn't even try this code out yet.

MrTango and others added 3 commits October 9, 2026 17:20
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.
…d of importing them or bundling the icons with webpack.
@thet
thet marked this pull request as draft October 11, 2026 21:11
@thet
thet requested a review from MrTango October 11, 2026 21:12

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants