dillon1000/react
Commit
Browse files [pipeline] panicOnBailout -> panicThreshold; remove isDev logging
--- Changed `panicOnBailout: boolean` to `panicThreshold`, which has the following options. Note that `ALL_ERRORS` corresponds to `panicOnBailout = true` and `CRITICAL_ERRORS` corresponds to `panicOnBailout = false`. `NONE` is a new option. ```js export type PanicThresholdOptions = // Bail out of compilation on all errors by throwing an exception. | "ALL_ERRORS" // Bail out of compilation only on critical or unrecognized errors. // Instead, silently skip the erroring function. | "CRITICAL_ERRORS" // Never bail out of compilation. Instead, silently skip the erroring // function or file. | "NONE"; ``` Jest seems to run babel through a different pipeline than Metro and - (perhaps through its complex `require` interjection logic). When running jest tests, exceptions thrown by babel transforms will bubble up to the nearest exception boundary which is often the jest test itself. This may not be a useful signal to anyone running a jest test with Forget enabled, as the erroring code may be within Forget itself or a transitively required module. Another reason to immediately bailing out on critical errors is that we may want to record errors found in the rest of the file. --- I'm not convinced that this change makes sense. A counterargument is that any CriticalErrors *should* be reported as parse errors, regardless of the runtime mode. Anyhow, this would be useful long term for our static analysis scripts (e.g. collecting info on bailouts and compilation info e.g. # slots used for JSX) as we want to compile-as-much-as-possible in those.
Changed paths4 files
First-parent comparisoncompiler/packages/babel-plugin-react-forget/src/Entrypoint/Options.ts ModifiedM compiler/packages/babel-plugin-react-forget/src/Entrypoint/Program.ts ModifiedM compiler/packages/eslint-plugin-react-forget/src/rules/ReactForgetDiagnostics.ts ModifiedM compiler/packages/fixture-test-utils/src/compiler-utils.ts ModifiedPatch
Files changed
Rendering syntax-highlighted changes…