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

refactor: pass array to nft.ignore #1480

Closed
wants to merge 1 commit into from
Closed

refactor: pass array to nft.ignore #1480

wants to merge 1 commit into from

Conversation

Skn0tt
Copy link
Member

@Skn0tt Skn0tt commented Jun 27, 2023

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

Summary

As discussed in #769 (comment).

We're testing this behaviour in this test:

testMany('Ignore some excluded node modules', [...allBundleConfigs], async (options) => {
const fixtureName = 'node-module-excluded'
const opts = merge(options, {
basePath: join(FIXTURES_DIR, fixtureName),
})
const { files } = await zipNode(fixtureName, { opts })
await expect(`${files[0].unzipPath}/node_modules/aws-sdk`).not.toPathExist()
try {
const func = await importFunctionFile(`${files[0].unzipPath}/function.js`)
func()
expect.fail('Running the function should fail due to the missing module')
} catch (error) {
expect(error.code).toBe('MODULE_NOT_FOUND')
}
})

So the refactoring shouldn't have any breaking change. I'm hoping this might improve performance - or at the very least, reduce cognitive complexity when reading 🀷


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 βœ…

A picture of a cute animal (not mandatory, but encouraged)

@Skn0tt Skn0tt requested a review from a team as a code owner June 27, 2023 15:45
@github-actions
Copy link
Contributor

⏱ Benchmark results

Comparing with 646c1cc

largeDepsEsbuild: 3.4s

⬆️ 24.92% increase vs. 646c1cc

^                                                   3.6s                                                  
β”‚                                                   β”Œβ”€β”€β”                            3.4s            3.4s  
β”‚                                           3.2s    |  |                    3.2s    β”Œβ”€β”€β”            β”Œβ”€β”€β”  
β”‚                                           β”Œβ”€β”€β”    |  |     3s             β”Œβ”€β”€β”    |  |            |β–’β–’|  
β”‚   2.8s                                    |  |    |  |    β”Œβ”€β”€β”            |  |    |  |            |β–’β–’|  
β”‚ β”€β”€β”Œβ”€β”€β”β”€β”€β”€β”€2.7s────────────────────2.6s────┼──┼────┼──┼────┼──┼────────────┼──┼────┼──┼────────────|β–’β–’|──
β”‚   |  |    β”Œβ”€β”€β”    2.4s    2.5s    β”Œβ”€β”€β”    |  |    |  |    |  |    2.4s    |  |    |  |    2.5s    |β–’β–’|  
β”‚   |  |    |  |    β”Œβ”€β”€β”    β”Œβ”€β”€β”    |  |    |  |    |  |    |  |    β”Œβ”€β”€β”    |  |    |  |    β”Œβ”€β”€β”    |β–’β–’|  
β”‚   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |β–’β–’|  
β”‚   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |β–’β–’|  
β”‚   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |β–’β–’|  
β”‚   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |β–’β–’|  
β”‚   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |β–’β–’|  
β”‚   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |β–’β–’|  
β”‚   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |β–’β–’|  
β”‚   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |β–’β–’|  
β”‚   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |β–’β–’|  
β”‚   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |β–’β–’|  
β”‚   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |β–’β–’|  
β”‚   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |β–’β–’|  
β”‚   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |β–’β–’|  
β”‚   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |β–’β–’|  
└───┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴──>
    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

largeDepsNft: 11.6s

⬆️ 32.08% increase vs. 646c1cc

^                                                  11.7s                                           11.6s  
β”‚                                                   β”Œβ”€β”€β”                           11.1s            β”Œβ”€β”€β”  
β”‚                                          10.6s    |  |                   10.8s    β”Œβ”€β”€β”            |β–’β–’|  
β”‚                                           β”Œβ”€β”€β”    |  |                    β”Œβ”€β”€β”    |  |            |β–’β–’|  
β”‚                                           |  |    |  |    9.5s            |  |    |  |            |β–’β–’|  
β”‚ ──8.8s────8.9sβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”Όβ”€β”€β”€β”€β”Όβ”€β”€β”Όβ”€β”€β”€β”€β”Œβ”€β”€β”β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”Όβ”€β”€β”€β”€β”Όβ”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€|β–’β–’|──
β”‚   β”Œβ”€β”€β”    β”Œβ”€β”€β”                    8.4s    |  |    |  |    |  |            |  |    |  |            |β–’β–’|  
β”‚   |  |    |  |    7.7s    7.6s    β”Œβ”€β”€β”    |  |    |  |    |  |    7.4s    |  |    |  |    7.8s    |β–’β–’|  
β”‚   |  |    |  |    β”Œβ”€β”€β”    β”Œβ”€β”€β”    |  |    |  |    |  |    |  |    β”Œβ”€β”€β”    |  |    |  |    β”Œβ”€β”€β”    |β–’β–’|  
β”‚   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |β–’β–’|  
β”‚   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |β–’β–’|  
β”‚   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |β–’β–’|  
β”‚   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |β–’β–’|  
β”‚   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |β–’β–’|  
β”‚   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |β–’β–’|  
β”‚   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |β–’β–’|  
β”‚   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |β–’β–’|  
β”‚   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |β–’β–’|  
β”‚   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |β–’β–’|  
β”‚   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |β–’β–’|  
β”‚   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |β–’β–’|  
β”‚   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |β–’β–’|  
└───┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴──>
    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: 22.2s

⬆️ 28.41% increase vs. 646c1cc

^                                                  22.5s                                           22.2s  
β”‚                                                   β”Œβ”€β”€β”                           21.5s            β”Œβ”€β”€β”  
β”‚                                                   |  |                   19.9s    β”Œβ”€β”€β”            |β–’β–’|  
β”‚                                          18.8s    |  |   19.1s            β”Œβ”€β”€β”    |  |            |β–’β–’|  
β”‚  17.8s                                    β”Œβ”€β”€β”    |  |    β”Œβ”€β”€β”            |  |    |  |            |β–’β–’|  
β”‚ β”€β”€β”Œβ”€β”€β”β”€β”€β”€16.5s────────────────────────────┼──┼────┼──┼────┼──┼────────────┼──┼────┼──┼────────────|β–’β–’|──
β”‚   |  |    β”Œβ”€β”€β”                   15.6s    |  |    |  |    |  |            |  |    |  |   15.9s    |β–’β–’|  
β”‚   |  |    |  |   14.8s   14.9s    β”Œβ”€β”€β”    |  |    |  |    |  |   14.9s    |  |    |  |    β”Œβ”€β”€β”    |β–’β–’|  
β”‚   |  |    |  |    β”Œβ”€β”€β”    β”Œβ”€β”€β”    |  |    |  |    |  |    |  |    β”Œβ”€β”€β”    |  |    |  |    |  |    |β–’β–’|  
β”‚   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |β–’β–’|  
β”‚   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |β–’β–’|  
β”‚   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |β–’β–’|  
β”‚   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |β–’β–’|  
β”‚   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |β–’β–’|  
β”‚   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |β–’β–’|  
β”‚   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |β–’β–’|  
β”‚   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |β–’β–’|  
β”‚   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |β–’β–’|  
β”‚   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |β–’β–’|  
β”‚   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |β–’β–’|  
β”‚   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |β–’β–’|  
β”‚   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |β–’β–’|  
└───┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴──>
    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

@Skn0tt
Copy link
Member Author

Skn0tt commented Jun 27, 2023

Screenshot 2023-06-27 at 17 52 43 ha, @eduardoboucas you were right! windows support is the reason you went with the `ignoreFunction`. meh.

@Skn0tt Skn0tt closed this Jun 27, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant