Skip to content
This repository has been archived by the owner on May 22, 2024. It is now read-only.

fix: guard against self-referencing element in shouldTranspile #1007

Merged
merged 5 commits into from
Feb 8, 2022

Conversation

eduardoboucas
Copy link
Member

Summary

When using NFT, we determine whether an ESM file needs to be transpiled by checking whether all of its parents are also ESM files. We use the reasons object to figure out the parent/child relationships, but we need to account for the fact that the initial file is declared as a parent of itself.

This PR accounts for this case.

@eduardoboucas eduardoboucas added the type: bug code to address defects in shipped code label Feb 8, 2022
@github-actions
Copy link
Contributor

github-actions bot commented Feb 8, 2022

⏱ Benchmark results

largeDepsEsbuild: 8s

^    8s   
│   ┌──┐  
│   |▒▒|  
│   |▒▒|  
│   |▒▒|  
│   |▒▒|  
│   |▒▒|  
│   |▒▒|  
│   |▒▒|  
│   |▒▒|  
│   |▒▒|  
│   |▒▒|  
│   |▒▒|  
│   |▒▒|  
│   |▒▒|  
│   |▒▒|  
│   |▒▒|  
│   |▒▒|  
│   |▒▒|  
│   |▒▒|  
│   |▒▒|  
│   |▒▒|  
└───┴──┴──>
     T    
Legend
  • T (current commit): 8s

largeDepsZisi: 1m 7.9s

^ 1m 7.9s 
│   ┌──┐  
│   |▒▒|  
│   |▒▒|  
│   |▒▒|  
│   |▒▒|  
│   |▒▒|  
│   |▒▒|  
│   |▒▒|  
│   |▒▒|  
│   |▒▒|  
│   |▒▒|  
│   |▒▒|  
│   |▒▒|  
│   |▒▒|  
│   |▒▒|  
│   |▒▒|  
│   |▒▒|  
│   |▒▒|  
│   |▒▒|  
│   |▒▒|  
│   |▒▒|  
└───┴──┴──>
     T    
Legend
  • T (current commit): 1m 7.9s

@kodiakhq kodiakhq bot merged commit 59f3ebd into main Feb 8, 2022
@kodiakhq kodiakhq bot deleted the fix/nft-shouldtranspile-check branch February 8, 2022 12:33
Skn0tt pushed a commit to netlify/build that referenced this pull request May 21, 2024
…lify/zip-it-and-ship-it#1007)

* fix: guard against self-referencing parent in `shouldTranspile`

* refactor: move self-reference check up

* refactor: use `parentPaths` variable

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
automerge 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