Commit 616f437
Add TerminalReporter events for outputting server logs and menus
Summary:
Introduces new event types in Metro's TerminalReporter, intended for a host dev server to append logs via Metro (in particular, leveraging the internal `Terminal` API to safely display logs without colliding with bundler progress output).
- `unstable_server_log`: Allows the server to emit a log message at various `level`s. Mirrors the design of `client_log`.
- `unstable_server_menu_updated`: Allows the server to present/update a menu (a persistent item / interactive status line) below all other streamed output. For now, the specialised term "menu" fits well and is descriptive (I'd imagine we introduce specialised events for future flavours of persistent status).
- `unstable_server_menu_cleared`
This supports interactive debugger target selection in React Native. These simplified and generic event types and also will allow us to improve/align log handling to use Metro's `Terminal` abstraction in the open source dev server setup (both `dev-middleware` and `community-cli-plugin`).
Changelog:
```
- **[Experimental]**: Add `unstable_server_log`, `unstable_server_menu_updated`, and `unstable_server_menu_cleared` reporter events
```
Reviewed By: hoxyq
Differential Revision: D63255296
fbshipit-source-id: 9278f19fb4e6eb2b8fd0bb267f2321d52b32bb7c1 parent 8f7e000 commit 616f437
2 files changed
+39
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
44 | | - | |
45 | | - | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
46 | 56 | | |
47 | 57 | | |
48 | 58 | | |
| |||
251 | 261 | | |
252 | 262 | | |
253 | 263 | | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
254 | 273 | | |
255 | 274 | | |
256 | 275 | | |
| |||
385 | 404 | | |
386 | 405 | | |
387 | 406 | | |
388 | | - | |
389 | | - | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
390 | 412 | | |
391 | 413 | | |
392 | 414 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
211 | 211 | | |
212 | 212 | | |
213 | 213 | | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
214 | 226 | | |
215 | 227 | | |
216 | 228 | | |
| |||
220 | 232 | | |
221 | 233 | | |
222 | 234 | | |
| 235 | + | |
223 | 236 | | |
224 | 237 | | |
0 commit comments