Open History to see the last commit
1<!doctype html>
2<html lang="en">
3 <head>
4 <meta charset="UTF-8" />
5 <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6 <title>Issue 4759</title>
7 <style>
8 html,
9 body,
10 #app,
11 [data-state] {
12 height: 100%;
13 margin: 0;
14 }
15β
16 [data-state='html'] {
17 background: blue;
18 }
19β
20 [data-state='shell'] {
21 background: red;
22 }
23β
24 [data-state='pending'] {
25 background: yellow;
26 }
27β
28 [data-state='loaded'] {
29 background: green;
30 }
31 </style>
32 </head>
33 <body>
34 <div id="app">
35 <div data-state="html">HTML fallback</div>
36 </div>
37 <script>
38 globalThis.__paintStates = []
39β
40 function recordPaintState() {
41 const app = document.getElementById('app')
42 const state = app.querySelector('[data-state="loaded"]')
43 ? 'loaded'
44 : app.querySelector('[data-state="pending"]')
45 ? 'pending'
46 : app.querySelector('[data-state="shell"]')
47 ? 'shell'
48 : app.querySelector('[data-state="html"]')
49 ? 'html'
50 : 'empty'
51β
52 globalThis.__paintStates.push(state)
53 if (state !== 'loaded') {
54 requestAnimationFrame(recordPaintState)
55 }
56 }
57β
58 requestAnimationFrame(recordPaintState)
59 </script>
60 <script type="module" src="/src/main.tsx"></script>
61 </body>
62</html>