Commit beef385
Fix worker race conditions, use addEventListener, and clean up turbo config
- Add message queue in useLanguageClient so messages sent before async
worker init are drained once the worker is ready
- Add terminated flag to both worker hooks to prevent leaking workers
if the component unmounts before the dynamic import resolves
- Reject pending init promise on teardown in useSimulationWorker
- Switch worker.onmessage/onerror to addEventListener for eslint compliance
- Extract createSimulationWorker into its own module for clean test mocking
- Update test suite to use async mocks via vi.mock instead of vi.stubGlobal
- Set sideEffects: ["*.css"] instead of false to prevent CSS tree-shaking
- Remove stale build:site task from turbo.json
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>1 parent 75c8c6c commit beef385
6 files changed
Lines changed: 222 additions & 186 deletions
File tree
- libs/@hashintel/petrinaut
- src
- lsp/worker
- simulation/worker
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
23 | 25 | | |
24 | 26 | | |
25 | 27 | | |
| |||
Lines changed: 50 additions & 29 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
| 63 | + | |
63 | 64 | | |
64 | 65 | | |
65 | 66 | | |
66 | 67 | | |
67 | 68 | | |
68 | | - | |
69 | | - | |
| 69 | + | |
70 | 70 | | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | | - | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
81 | 76 | | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | | - | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
86 | 98 | | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
| 99 | + | |
| 100 | + | |
92 | 101 | | |
93 | 102 | | |
94 | | - | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
95 | 110 | | |
96 | 111 | | |
97 | 112 | | |
98 | 113 | | |
| 114 | + | |
99 | 115 | | |
100 | 116 | | |
101 | 117 | | |
| |||
108 | 124 | | |
109 | 125 | | |
110 | 126 | | |
111 | | - | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
112 | 133 | | |
113 | 134 | | |
114 | 135 | | |
| |||
147 | 168 | | |
148 | 169 | | |
149 | 170 | | |
150 | | - | |
151 | | - | |
152 | | - | |
153 | | - | |
154 | | - | |
155 | 171 | | |
156 | 172 | | |
157 | 173 | | |
158 | 174 | | |
159 | 175 | | |
160 | | - | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
161 | 182 | | |
162 | 183 | | |
163 | 184 | | |
| |||
Lines changed: 6 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
0 commit comments