[be] Add comments for LoggerEvent type
Mofei Zhang committed
Nov 10, 2023 at 17:09 UTC
c08b7be34eb09868a49dfc52102375c5f6a1336b
1 file changed
+14
-1
compiler/packages/babel-plugin-react-forget/src/Entrypoint/Options.ts
+14
-1
@@ -127,6 +127,19 @@ export type CompilationMode =
127
// Compile all top-level functions
128
| "all";
129
130
+/**
131
+ * Represents 'events' that may occur during compilation. Events are only
132
+ * recorded when a logger is set (through the config).
133
+ * These are the different types of events:
134
+ * CompileError:
135
+ * Forget skipped compilation of a function / file due to a known todo,
136
+ * invalid input, or compiler invariant being broken.
137
+ * CompileSuccess:
138
+ * Forget successfully compiled a function.
139
+ * PipelineError:
140
+ * Unexpected errors that occurred during compilation (e.g. failures in
141
+ * babel or other unhandled exceptions).
142
+ */
143
export type LoggerEvent =
144
| {
145
kind: "CompileError";
@@ -142,7 +155,7 @@ export type LoggerEvent =
155
| {
156
kind: "PipelineError";
157
fnLoc: t.SourceLocation | null;
145
- data: any;
158
+ data: string;
159
};
160
161
export type Logger = {