-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Expand file tree
/
Copy pathbootstrap.js
More file actions
29 lines (26 loc) · 893 Bytes
/
bootstrap.js
File metadata and controls
29 lines (26 loc) · 893 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import App from './components/App';
import React from 'react';
import { createRoot } from 'react-dom/client';
// React 18 createRoot API
const container = document.getElementById('root');
const root = createRoot(container);
root.render(
<React.StrictMode>
<App />
</React.StrictMode>,
);
// Performance monitoring for remote
if (typeof window !== 'undefined' && window.performance) {
window.addEventListener('load', () => {
setTimeout(() => {
const perfData = performance.getEntriesByType('navigation')[0];
console.log('Remote App Performance:', {
loadTime: Math.round(perfData.loadEventEnd - perfData.loadEventStart),
domContentLoaded: Math.round(
perfData.domContentLoadedEventEnd - perfData.domContentLoadedEventStart,
),
totalTime: Math.round(perfData.loadEventEnd - perfData.fetchStart),
});
}, 0);
});
}