New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: set customErrorInfo
on zisi/esbuild errors
#700
Conversation
⏱ Benchmark resultsComparing with 55b5529 largeDepsEsbuild: 10.8s⬇️ 7.78% decrease vs. 55b5529
largeDepsZisi: 57.5s⬇️ 3.51% decrease vs. 55b5529
|
error.customErrorInfo = { type: 'functionsBundling', location: { functionName: name, runtime: RUNTIME_JS } } | ||
error.customErrorInfo = { | ||
type: 'functionsBundling', | ||
location: { bundler: JS_BUNDLER_ESBUILD, functionName: name, runtime: RUNTIME_JS }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want to show the bundler and/or the runtime in the error message title?
Please note we do show the location
fields in the error details, which is printed in the build logs. Also, the location
fields are always sent to Bugsnag. Just wondering what you think about the error message title itself (which is shown in the error header and in the deploy summary).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I personally don't think we need to show the runtime in the message because it probably offers less clarity than the noise it introduces. I think that field is useful mostly for Bugsnag.
However, on that link I do see that we show functionName
, which means that the field is mandatory. We don't have the function name when using esbuild from the ZISI flow. Adding it will mean passing that parameter around in a lot of functions, which I'm not super excited about, but it'll have to be done.
I'll add to this PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense! 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done in 94c3248. Some of these functions are called recursively, and without types it's a bit difficult to ensure all cases are covered, but I think I've done it!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your help! 🙌🏻
- Summary
Adds a
customErrorInfo
property to errors arising from esbuild in ZISI.- Test plan
Added new test.