Add verbose error logging option to react-compiler-healthcheck
Summary
This pull request enhances the error reporting functionality in the react-compiler-healthcheck tool by adding a new verbose option. When the verbose flag is set to true, the tool provides more extensive error logging for components that failed to compile due to both non-actionable and actionable errors.
The motivation behind this change is to improve the debugging experience and provide developers with more detailed information about compilation failures. By including the specific error details for each failed component, developers can quickly identify and resolve issues, saving time and effort in the debugging process.
Changes
-
Added a new
verboseoption to the command-line interface using theyargslibrary. The option is aliased as-v, has a default value offalse, and includes a description explaining its purpose. -
Modified the
reportfunction to accept averboseErrorsparameter, which indicates whether verbose error logging is enabled. -
Inside the
reportfunction, added conditional logic to check the value ofverboseErrors. Iftrue, the function logs additional error details for failed compilations. -
For non-actionable errors (
OtherFailures), the tool now logs a bold red message indicating the number of components that failed to compile. It then iterates over each failure, logging the error details for each component, including the filename and the specific reason for the failure. -
Similarly, for actionable errors (
ActionableFailures), the tool logs a bold red message with the count of failed components and iterates over each failure to log the error details. -
The error details are displayed in red color using the
chalklibrary, with the filename highlighted. The error reason is appended in normal white text, followed by a line break for better readability.
How did you test this change?
To test this change, I ran the react-compiler-healthcheck tool with the --verbose flag on a codebase containing both successful and failed component compilations. I verified that the tool correctly logged the additional error details for the failed components, including the filename and the specific error reason.
I also tested the tool without the --verbose flag to ensure that the default behavior remained unchanged and that the tool only logged the summary of successful and failed compilations.
Furthermore, I reviewed the code changes thoroughly to ensure that the logic was implemented correctly and that the output format met the desired requirements.
Please let me know if you have any further questions or if there's anything else I can assist with regarding this pull request.
The latest updates on your projects. Learn more about Vercel for Git ↗︎
| Name | Status | Preview | Comments | Updated (UTC) |
|---|---|---|---|---|
| react-compiler-playground | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | Jun 12, 2024 6:27pm |
Hi @jtrowald!
Thank you for your pull request and welcome to our community.
Action Required
In order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you.
Process
In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.
Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.
If you have received this in error or have any questions, please contact us at [email protected]. Thanks!
Comparing: 50e89ec9f2d44ab140e771e585226f7771da9652...e441e5ffd27399dac6d8c59993db6ecca15419dc
Critical size changes
Includes critical production bundles, as well as any change greater than 2%:
| Name | +/- | Base | Current | +/- gzip | Base gzip | Current gzip |
|---|---|---|---|---|---|---|
| oss-stable/react-dom/cjs/react-dom.production.js | = | 6.66 kB | 6.66 kB | = | 1.82 kB | 1.82 kB |
| oss-stable/react-dom/cjs/react-dom-client.production.js | = | 497.80 kB | 497.80 kB | = | 89.24 kB | 89.23 kB |
| oss-experimental/react-dom/cjs/react-dom.production.js | = | 6.67 kB | 6.67 kB | = | 1.83 kB | 1.83 kB |
| oss-experimental/react-dom/cjs/react-dom-client.production.js | = | 502.62 kB | 502.62 kB | = | 89.94 kB | 89.94 kB |
| facebook-www/ReactDOM-prod.classic.js | = | 597.04 kB | 597.04 kB | = | 105.31 kB | 105.31 kB |
| facebook-www/ReactDOM-prod.modern.js | = | 571.38 kB | 571.38 kB | = | 101.25 kB | 101.25 kB |
| test_utils/ReactAllWarnings.js | Deleted | 62.88 kB | 0.00 kB | Deleted | 15.69 kB | 0.00 kB |
Significant size changes
Includes any change greater than 0.2%:
Expand to show
| Name | +/- | Base | Current | +/- gzip | Base gzip | Current gzip |
|---|---|---|---|---|---|---|
| test_utils/ReactAllWarnings.js | Deleted | 62.88 kB | 0.00 kB | Deleted | 15.69 kB | 0.00 kB |
Generated by :no_entry_sign: dangerJS against e441e5ffd27399dac6d8c59993db6ecca15419dc
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks!
This pull request has been automatically marked as stale. If this pull request is still relevant, please leave any comment (for example, "bump"), and we'll keep it open. We are sorry that we haven't been able to prioritize reviewing it yet. Your contribution is very much appreciated.
Closing this pull request after a prolonged period of inactivity. If this issue is still present in the latest release, please ask for this pull request to be reopened. Thank you!