Commit 5d5810c
committed
feat(Sky): Add synchronous preload and async IIFE error surfacing
Improve Electron workbench loading reliability with three changes:
1. WindPreload: Convert Install() from fire-and-forget (.then chain) to top-level await, ensuring the preload polyfills complete before Layout.astro proceeds to Polyfills.js
2. Workbench.ts: Add pre-flight checks logging window.vscode, __TAURI__, _VSCODE_FILE_ROOT, and _VSCODE_USE_RELATIVE_IMPORTS. Add diagnostic polling at 2s/5s/10s/20s intervals to detect if the workbench renders successfully or silently fails.
3. astro.config.ts: Refactor Step 7 to use ESM wrapper approach (copy file + 1-line re-export) instead of content replacement. Add Step 8 to prepend global error listeners to workbench.js, catching unhandledrejection and error events from the async IIFE that runs in the background.
The async IIFE in workbench.js does not await result.main(configuration), so boot errors were silently swallowed. Step 8 surfaces these errors through console.error for debugging.1 parent 1352ef6 commit 5d5810c
3 files changed
Lines changed: 207 additions & 73 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
11 | 12 | | |
| 13 | + | |
12 | 14 | | |
13 | 15 | | |
14 | 16 | | |
15 | 17 | | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
51 | 38 | | |
| 39 | + | |
52 | 40 | | |
53 | | - | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
54 | 45 | | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
19 | 24 | | |
20 | 25 | | |
21 | 26 | | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
22 | 60 | | |
23 | | - | |
| 61 | + | |
| 62 | + | |
24 | 63 | | |
25 | 64 | | |
26 | 65 | | |
27 | 66 | | |
28 | 67 | | |
29 | 68 | | |
30 | 69 | | |
| 70 | + | |
31 | 71 | | |
32 | 72 | | |
33 | | - | |
34 | | - | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
35 | 112 | | |
36 | 113 | | |
37 | 114 | | |
38 | 115 | | |
39 | 116 | | |
40 | 117 | | |
41 | 118 | | |
| 119 | + | |
42 | 120 | | |
43 | 121 | | |
44 | 122 | | |
45 | 123 | | |
46 | | - | |
47 | 124 | | |
48 | | - | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
49 | 129 | | |
50 | 130 | | |
0 commit comments