@samitouri / QOS-React-2 / commits / 4e7d437880

[babel] Remove unused PipelineError

Most of the use cases are already handled with ErrorSeverity.InvalidConfig

Sathya Gunasekaran committed Nov 8, 2023 at 16:09 UTC 4e7d4378804d982105bd35cf43dc8c6dcb779521
2 files changed +4 -24
compiler/packages/babel-plugin-react-forget/src/Entrypoint/Options.ts
-5
@@ -138,11 +138,6 @@ export type LoggerEvent =
138 fnLoc: t.SourceLocation | null;
139 fnName: string | null;
140 memoSlots: number;
141 - }
142 - | {
143 - kind: "PipelineError";
144 - fnLoc: t.SourceLocation | null;
145 - data: any;
141 };
142
143 export type Logger = {
compiler/packages/babel-plugin-react-forget/src/Entrypoint/Program.ts
+4 -19
@@ -68,29 +68,14 @@ type CompileResult = {
68 function handleError(
69 pass: CompilerPass,
70 fnLoc: t.SourceLocation | null,
71 - err: unknown
71 + err: CompilerError
72 ): void {
73 if (pass.opts.logger) {
74 - if (err instanceof CompilerError) {
75 - for (const detail of err.details) {
76 - pass.opts.logger.logEvent(pass.filename, {
77 - kind: "CompileError",
78 - fnLoc,
79 - detail: detail.options,
80 - });
81 - }
82 - } else {
83 - let stringifiedError;
84 - if (err instanceof Error) {
85 - stringifiedError = err.stack ?? err.message;
86 - } else {
87 - stringifiedError = err?.toString() ?? "[ null ]";
88 - }
89 -
74 + for (const detail of err.details) {
75 pass.opts.logger.logEvent(pass.filename, {
91 - kind: "PipelineError",
76 + kind: "CompileError",
77 fnLoc,
93 - data: stringifiedError,
78 + detail: detail.options,
79 });
80 }
81 }