Skip to content

Improve lighthouse score - #447

Merged
kamilmielnik merged 41 commits into
masterfrom
app-performance
Aug 16, 2026
Merged

Improve lighthouse score#447
kamilmielnik merged 41 commits into
masterfrom
app-performance

Conversation

@kamilmielnik

@kamilmielnik kamilmielnik commented Aug 11, 2026

Copy link
Copy Markdown
Owner

Closes #412

Loading & first paint

  • The app is now fully server-rendered, so the board is visible immediately instead of after all JavaScript loads.
  • All CSS is inlined into the HTML, removing render-blocking stylesheet requests.
  • Layout sizing moved from JavaScript to CSS variables, so the first paint needs no layout code at all.
  • The board background SVG is built with plain strings instead of react-dom/server, shrinking the framework chunk from 116KB to 60KB.
  • The 192KB transliteration package was replaced with built-in Unicode normalization.
  • Translations ship as one chunk per language, with only English in the main bundle.
  • Flag icons moved out of the main bundle.
  • Modals are code-split and their chunks download in the background once the page is idle.
  • A modern-browser target list plus removal of Next.js's built-in polyfills dropped all legacy JavaScript from the bundles.
  • Components barrel file was removed so the bundler can tree-shake properly.

Runtime performance

  • Board cells no longer subscribe to the Redux store (about 2,000 subscriptions removed), which cut the main hydration task roughly in half.
  • Booting with nothing saved no longer re-renders the board after hydration.
  • Modals only mount the first time they are opened.
  • Tooltips skip their positioning machinery until after page load, and skip it entirely on touch devices.
  • The service worker registers after load and idle, so its precache downloads never compete with the page.
  • The dictionary download waits for idle or the first user interaction, and starts immediately when a new language is picked.
  • Assorted mount-time waste was removed: no forced reflows, cached media query objects, and no redundant localStorage write-back after boot.

Features & UX

  • Returning users with a saved non-default game or language no longer see a flash: a tiny pre-paint script sizes the board and sets text direction before first paint, and the content stays hidden until the saved setup is applied.
  • The active language's translations are cached in localStorage, so returning users see their language in the very first paint.
  • All languages preload in the background, so switching language applies instantly.
  • The "Hidden" coordinates option was removed because it caused a layout jump on load; saved settings migrate to "Original".
  • Dictionary lookups skip the debounce delay when the definition is already cached.
  • Added robots.txt and llms.txt.

Robustness

  • Corrupt saved data (board, rack, or settings) is detected and discarded instead of breaking the app.
  • A failure while restoring saved state can no longer kill solving or disable saving for the session.
  • A failed translation download quietly falls back to English instead of erroring.

Lighthouse

@kamilmielnik kamilmielnik self-assigned this Aug 11, 2026
@kamilmielnik
kamilmielnik merged commit 04c3d14 into master Aug 16, 2026
5 checks passed
@kamilmielnik
kamilmielnik deleted the app-performance branch August 16, 2026 08:50
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.

Improve lighthouse score

1 participant