Skip to content
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(nft): correctly annotate transpilation errors in nft bundler #1086

Merged
merged 2 commits into from May 18, 2022

Conversation

danez
Copy link
Contributor

@danez danez commented May 17, 2022

πŸŽ‰ Thanks for submitting a pull request! πŸŽ‰

Summary

Add customErrorInfo to errors happening during transpilation of esm with esbuild in the nft bundler.
I had to loop the function name through to the actual esbuild call, to generate the error location properly.


For us to review and ship your PR efficiently, please perform the following steps:

  • Open a bug/issue before writing your code πŸ§‘β€πŸ’».
    This ensures we can discuss the changes and get feedback from everyone that should be involved. If you`re fixing
    a typo or something that`s on fire πŸ”₯ (e.g. incident related), you can skip this step.
  • Read the contribution guidelines πŸ“–. This ensures your code follows our style guide and
    passes our tests.
  • Update or add tests (if any source code was changed or added) πŸ§ͺ
  • Update or add documentation (if features were changed or added) πŸ“
  • Make sure the status checks below are successful βœ…

Add customErrorInfo to errors happening during transpilation of esm with esbuild in the nft bundler
@danez danez requested a review from a team May 17, 2022 15:01
@github-actions github-actions bot added the type: bug code to address defects in shipped code label May 17, 2022
eduardoboucas
eduardoboucas previously approved these changes May 17, 2022
Copy link
Member

@eduardoboucas eduardoboucas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! I left a super minor comment that we usually wouldn't care much about, but since you're new to the codebase I figured it's useful to align on those things.

Also, we tend to use the feedback ladder in PR reviews, hence the [dust] prefix.

src/runtimes/node/bundlers/nft/transpile.ts Show resolved Hide resolved
Co-authored-by: Eduardo Bouças <mail@eduardoboucas.com>
@github-actions
Copy link
Contributor

⏱ Benchmark results

Comparing with 61e5b72

largeDepsEsbuild: 6.3s

⬇️ 5.42% decrease vs. 61e5b72

^                                                           9.3s                                          
β”‚                                                           β”Œβ”€β”€β”                                          
β”‚                                                           |  |            8.3s                          
β”‚                                                           |  |            β”Œβ”€β”€β”                          
β”‚                                                           |  |            |  |                          
β”‚                           6.8s                            |  |            |  |    6.8s                  
β”‚ ──6.5s────────────6.3sβ”€β”€β”€β”€β”Œβ”€β”€β”β”€β”€β”€β”€6.6s────6.5s────6.4s────┼──┼────6.5sβ”€β”€β”€β”€β”Όβ”€β”€β”Όβ”€β”€β”€β”€β”Œβ”€β”€β”β”€β”€β”€β”€6.7s────6.3s──
β”‚   β”Œβ”€β”€β”    6.2s    β”Œβ”€β”€β”    |  |    β”Œβ”€β”€β”    β”Œβ”€β”€β”    β”Œβ”€β”€β”    |  |    β”Œβ”€β”€β”    |  |    |  |    β”Œβ”€β”€β”    β”Œβ”€β”€β”  
β”‚   |  |    β”Œβ”€β”€β”    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |β–’β–’|  
β”‚   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |β–’β–’|  
β”‚   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |β–’β–’|  
β”‚   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |β–’β–’|  
β”‚   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |β–’β–’|  
β”‚   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |β–’β–’|  
β”‚   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |β–’β–’|  
β”‚   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |β–’β–’|  
β”‚   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |β–’β–’|  
β”‚   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |β–’β–’|  
β”‚   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |β–’β–’|  
β”‚   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |β–’β–’|  
β”‚   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |β–’β–’|  
β”‚   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |β–’β–’|  
└───┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴──>
    T-12    T-11    T-10    T-9     T-8     T-7     T-6     T-5     T-4     T-3     T-2     T-1      T    
Legend

largeDepsZisi: 44.2s

⬇️ 6.26% decrease vs. 61e5b72

^                                                         1m 14.2s        1m 13.3s                        
β”‚                                                           β”Œβ”€β”€β”            β”Œβ”€β”€β”                          
β”‚                                                           |  |            |  |                          
β”‚                                                           |  |            |  |                          
β”‚                                                           |  |            |  |                          
β”‚                                  56.4s   54.8s   54.7s    |  |   54.3s    |  |   57.2s                  
β”‚ ─52.8s───51.5s───52.7s───53.3sβ”€β”€β”€β”€β”Œβ”€β”€β”β”€β”€β”€β”€β”Œβ”€β”€β”β”€β”€β”€β”€β”Œβ”€β”€β”β”€β”€β”€β”€β”Όβ”€β”€β”Όβ”€β”€β”€β”€β”Œβ”€β”€β”β”€β”€β”€β”€β”Όβ”€β”€β”Όβ”€β”€β”€β”€β”Œβ”€β”€β”β”€β”€β”€52.4s──────────
β”‚   β”Œβ”€β”€β”    β”Œβ”€β”€β”    β”Œβ”€β”€β”    β”Œβ”€β”€β”    |  |    |  |    |  |    |  |    |  |    |  |    |  |    β”Œβ”€β”€β”          
β”‚   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |   44.2s  
β”‚   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    β”Œβ”€β”€β”  
β”‚   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |β–’β–’|  
β”‚   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |β–’β–’|  
β”‚   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |β–’β–’|  
β”‚   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |β–’β–’|  
β”‚   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |β–’β–’|  
β”‚   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |β–’β–’|  
β”‚   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |β–’β–’|  
β”‚   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |β–’β–’|  
β”‚   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |β–’β–’|  
β”‚   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |β–’β–’|  
β”‚   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |β–’β–’|  
β”‚   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |β–’β–’|  
└───┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴──>
    T-12    T-11    T-10    T-9     T-8     T-7     T-6     T-5     T-4     T-3     T-2     T-1      T    
Legend

Copy link
Member

@eduardoboucas eduardoboucas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

πŸš€

Ah, a final comment about conventions: you're rightly using the fix: prefix to signal a patch update, but there's no need to use the (nft) namespace. We typically only do that for dependency updates (example), which are handled automatically by robots. πŸ€–

@danez danez merged commit 28a85fb into main May 18, 2022
@danez danez deleted the add-customerrorinfo branch May 18, 2022 12:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug code to address defects in shipped code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants