Performance: - Lazy-load pages, docx, and mammoth (initial JS 1,298 KB -> ~290 KB) - Gzip responses and cache hashed assets for a year - Memoize DrawCanvas strokes so ink isn't redrawn on every render - Precompute whole-Bible search index and defer the query while typing - Reload once if a lazy chunk is missing after a deploy Deployment: - setup.sh builds and runs one production server on APP_PORT (default 5173); --dev keeps the old Vite dev setup - Session cookie uses secure: 'auto' so login works behind any proxy Chunk editor: - Remove the Draw layout, Ink Notes panel, and ink in HTML export (existing inkStrokes data is left in saved projects) Refactor: - Move module-level helpers out of App.jsx into src/utils/* - Extract Bible reader state and logic into hooks/useBibleReader Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
24 lines
759 B
React
24 lines
759 B
React
import { StrictMode } from 'react';
|
|
import ReactDOM from 'react-dom/client';
|
|
import App from './App.jsx';
|
|
import './index.css';
|
|
|
|
if ('serviceWorker' in navigator) {
|
|
navigator.serviceWorker.register('/sw.js').catch(() => {});
|
|
}
|
|
|
|
// Pages are lazy-loaded chunks. If a deploy happened while this tab was open,
|
|
// the old chunk files are gone — reload once to pick up the new build.
|
|
window.addEventListener('vite:preloadError', () => {
|
|
if (sessionStorage.getItem('chunk-reload')) return;
|
|
sessionStorage.setItem('chunk-reload', '1');
|
|
window.location.reload();
|
|
});
|
|
window.addEventListener('load', () => sessionStorage.removeItem('chunk-reload'));
|
|
|
|
ReactDOM.createRoot(document.getElementById('root')).render(
|
|
<StrictMode>
|
|
<App />
|
|
</StrictMode>
|
|
);
|