Skip to content

Commit f9f9b47

Browse files
committed
Replace static loader PNG with inline SVG matching in-app Spinner
Replaces the animated `spinner.png` on the pre-app loading screen with an inline SVG arc that visually matches Hoist React's in-app `Spinner` component (FA `spinner-third` with a 2s linear CSS rotation), eliminating the style discontinuity at the JS-bundle handoff. Adds a new `preloadSpinnerColor` env config controlling the SVG stroke color, defaulting to a neutral `#888`. Pairs with the existing `preloadBackgroundColor`. The legacy `hoist-react/public/spinner.png` is unchanged and remains available for apps still pinned to older `@xh/hoist-dev-utils` versions. Generated with Claude Opus 4.7 (1M context)
1 parent 8615aa2 commit f9f9b47

3 files changed

Lines changed: 26 additions & 2 deletions

File tree

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
# Changelog
22

3+
## v12.1.0 - 2026-04-29
4+
5+
### 🎁 New Features
6+
7+
* Replaced the animated PNG on the static loader page with an inline SVG that visually matches
8+
Hoist React's in-app `Spinner` component (FA `spinner-third` with a CSS rotation). Eliminates a
9+
style discontinuity at the JS-bundle handoff.
10+
* New `preloadSpinnerColor` config controls the stroke color of the loader spinner. Defaults to
11+
`#888`. Pairs with the existing `preloadBackgroundColor`.
12+
313
## v12.0.1 - 2026-04-18
414

515
### 📚 Libraries

configureWebpack.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ try {
7777
* adding a mobile app to a device home screen, as well as "installing" an app via Chrome's "create shortcut"
7878
* option. See https://developer.mozilla.org/en-US/docs/Web/Manifest for options.
7979
* @param {string} [env.preloadBackgroundColor] - background color to use for the preloader spinner. Defaults to white.
80+
* @param {string} [env.preloadSpinnerColor] - stroke color for the preloader spinner SVG. Defaults to a neutral gray (#888).
8081
* @param {string[]} [env.targetBrowsers] - array of browserslist queries specifying target browsers for Babel and CSS
8182
* transpiling and processing.
8283
* @param {Object} [env.babelPresetEnvOptions] - options to spread onto / override defaults passed here to the Babel
@@ -136,6 +137,7 @@ async function configureWebpack(env) {
136137
favicon = env.favicon || null,
137138
manifestConfig = env.manifestConfig || {},
138139
preloadBackgroundColor = env.preloadBackgroundColor || 'white',
140+
preloadSpinnerColor = env.preloadSpinnerColor || '#888',
139141
stats = env.stats || 'errors-only',
140142
infrastructureLoggingLevel = env.infrastructureLoggingLevel || 'error',
141143
targetBrowsers = env.targetBrowsers || [
@@ -657,7 +659,8 @@ async function configureWebpack(env) {
657659
styleTags,
658660
scriptTags,
659661
clientAppName,
660-
preloadBackgroundColor
662+
preloadBackgroundColor,
663+
preloadSpinnerColor
661664
};
662665
},
663666
// No need to minify the HTML itself

static/index.html

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,15 @@
99
<% } %>
1010
<title><%= htmlWebpackPlugin.options.title %></title>
1111
<%= styleTags %>
12+
<style>
13+
@keyframes xh-preload-spin { to { transform: rotate(360deg); } }
14+
#xh-preload-spinner svg {
15+
width: 50px;
16+
height: 50px;
17+
animation: xh-preload-spin 2s linear infinite;
18+
transform-origin: center;
19+
}
20+
</style>
1221
</head>
1322
<body class="xh-app" style="margin: 0">
1423

@@ -17,7 +26,9 @@
1726
</noscript>
1827

1928
<div id="xh-preload-spinner" style="height: 100vh; width: 100vw; display: flex; align-items: center; justify-content: center; background-color: <%= preloadBackgroundColor %>">
20-
<img src="<%= webpackConfig.output.publicPath %>public/spinner.png" style="width: 50px; height: 50px;">
29+
<svg viewBox="0 0 24 24" fill="none" stroke="<%= preloadSpinnerColor %>" stroke-width="1.5" stroke-linecap="round" aria-hidden="true">
30+
<circle cx="12" cy="12" r="9" stroke-dasharray="42 56"/>
31+
</svg>
2132
</div>
2233

2334
<div id="xh-root"></div>

0 commit comments

Comments
 (0)