netlify / zip-it-and-ship-it

Intelligently prepare Node.js Lambda functions for deployment
https://www.npmjs.com/package/@netlify/zip-it-and-ship-it
MIT License
316 stars 35 forks source link

feat: add `preferStatic` to ISC #1648

Closed eduardoboucas closed 1 year ago

eduardoboucas commented 1 year ago

Summary

Adds a preferStatic property to the in-source configuration that lets developers configure the file shadowing behaviour on a per-function basis.

Part of https://linear.app/netlify/issue/COM-32/functions-v2-inline-config-does-not-respect-cdn-shadowing.

github-actions[bot] commented 1 year ago

⏱ Benchmark results

Comparing with 97992ee4384e445302377c0ee35281abc8079daf

largeDepsEsbuild: 1.4s

⬇️ 130.71% decrease vs. 97992ee4384e445302377c0ee35281abc8079daf

^                                           3.4s                                            3.4s          
│   3.3s            3.2s            3.1s    ┌──┐                                    3.1s    ┌──┐          
│   ┌──┐            ┌──┐            ┌──┐    |  |            3.1s                    ┌──┐    |  |          
│   |  |            |  |            |  |    |  |            ┌──┐                    |  |    |  |          
│ ──┼──┼────2.7s────┼──┼────────────┼──┼────┼──┼────────────┼──┼────2.7s────────────┼──┼────┼──┼──────────
│   |  |    ┌──┐    |  |    2.5s    |  |    |  |    2.6s    |  |    ┌──┐    2.5s    |  |    |  |          
│   |  |    |  |    |  |    ┌──┐    |  |    |  |    ┌──┐    |  |    |  |    ┌──┐    |  |    |  |          
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |          
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |          
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |          
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |          
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    1.4s  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    ┌──┐  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
└───┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴──>
    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 - T-30 (bf7a4acac64a9c50364703196061618e95244fd4): 2.7s - T-29 (cc8ad7cd1ccbeb3158c2dd6a2e688945141f71e6): 3.8s - T-28 (58c83442fd6e88b931c33c40309495b79560087f): 3.3s - T-27 (9efef2f12593f66a220bce9c2ce940d78b9e8229): 2.8s - T-26 (84ff0f8de591f283570b723928bb001764576c8d): 2.5s - T-25 (7eafe9537935bca0b8c3ed4f3a1f4d4e262e27e9): 2.5s - T-24 (57c38e3fee419f4b65c04e45094ed3212113ba63): 3.2s - T-23 (7898a4bbbf09989ceec19accdb835065ed0b5c25): 3.5s - T-22 (d15abd9ac2cc525bb32b97bf1d7b0c61dc6f3109): 3.5s - T-21 (efa8ddc3ce75b888d32e809617708bc9267f223b): 2.6s - T-20 (600dbf7c6f6c1d7673aeb03074f32dd21bd77a91): 3.1s - T-19 (6051e01ca1034de9382d759255df098645920fc5): 3s - T-18 (57d30ec0fe95cb5d5fcaf7a36c4cb08b192ca371): 3s - T-17 (28b658a20a8557549545e6b8ac2d1e38f52e80b7): 3.2s - T-16 (d7a0d5086725f7f390ae91ae8787869f28634744): 3.5s - T-15 (1618df80c56c91b8622992f0fd45edf4fea69962): 3.1s - T-14 (0297aa17ec1d9082450a13bac5c33840c9d1d22d): 2.7s - T-13 (3092e010ce7fc47cdd0bee843528d13291a40acf): 3.3s - T-12 (cb23207e0c520f207df84e6d6509f24eefc9680e): 3.3s - T-11 (070a7c95020e1730d327c8bb4ec69a51ef10cabc): 2.7s - T-10 (37bea386468e7aa67974eda9a1a8fbb87c8d48ec): 3.2s - T-9 (4b0f947b315ac43d126e652881467f619c323cd7): 2.5s - T-8 (a7b997238fc578a2c83b921cb2d4c1eab1f93325): 3.1s - T-7 (0381be519b6fff91a86bdcd19ac3a196a3480515): 3.4s - T-6 (af0e46cdbadd228d2cc4876e0cc861e8af14ebef): 2.6s - T-5 (b7fc0822d55c26daee4afbd7f4041ee0d034decb): 3.1s - T-4 (afaa4efdccf011d985f82719b4dc71ce7f051346): 2.7s - T-3 (390820e5a45277d4233cab6a3dae20079959421a): 2.5s - T-2 (a01ecdb7e4b348d7fa71d576ae02f918b897a2df): 3.1s - T-1 (97992ee4384e445302377c0ee35281abc8079daf): 3.4s - **T (current commit): 1.4s**

largeDepsNft: 5.6s

⬇️ 93.56% decrease vs. 97992ee4384e445302377c0ee35281abc8079daf

^                                          10.7s                                           10.8s          
│  10.1s                                    ┌──┐                                            ┌──┐          
│   ┌──┐            10s             9.8s    |  |            9.5s                    9.8s    |  |          
│   |  |            ┌──┐            ┌──┐    |  |            ┌──┐                    ┌──┐    |  |          
│ ──┼──┼────────────┼──┼────────────┼──┼────┼──┼────────────┼──┼────8.5s────────────┼──┼────┼──┼──────────
│   |  |    8.4s    |  |            |  |    |  |    8.1s    |  |    ┌──┐            |  |    |  |          
│   |  |    ┌──┐    |  |    7.6s    |  |    |  |    ┌──┐    |  |    |  |    7.4s    |  |    |  |          
│   |  |    |  |    |  |    ┌──┐    |  |    |  |    |  |    |  |    |  |    ┌──┐    |  |    |  |          
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |          
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |          
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    5.6s  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    ┌──┐  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
└───┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴──>
    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 - T-30 (bf7a4acac64a9c50364703196061618e95244fd4): 8.1s - T-29 (cc8ad7cd1ccbeb3158c2dd6a2e688945141f71e6): 11.9s - T-28 (58c83442fd6e88b931c33c40309495b79560087f): 11s - T-27 (9efef2f12593f66a220bce9c2ce940d78b9e8229): 8.8s - T-26 (84ff0f8de591f283570b723928bb001764576c8d): 7.7s - T-25 (7eafe9537935bca0b8c3ed4f3a1f4d4e262e27e9): 7.6s - T-24 (57c38e3fee419f4b65c04e45094ed3212113ba63): 9.8s - T-23 (7898a4bbbf09989ceec19accdb835065ed0b5c25): 10.7s - T-22 (d15abd9ac2cc525bb32b97bf1d7b0c61dc6f3109): 11.3s - T-21 (efa8ddc3ce75b888d32e809617708bc9267f223b): 7.8s - T-20 (600dbf7c6f6c1d7673aeb03074f32dd21bd77a91): 10.4s - T-19 (6051e01ca1034de9382d759255df098645920fc5): 9.4s - T-18 (57d30ec0fe95cb5d5fcaf7a36c4cb08b192ca371): 9.3s - T-17 (28b658a20a8557549545e6b8ac2d1e38f52e80b7): 10.1s - T-16 (d7a0d5086725f7f390ae91ae8787869f28634744): 11.3s - T-15 (1618df80c56c91b8622992f0fd45edf4fea69962): 10.5s - T-14 (0297aa17ec1d9082450a13bac5c33840c9d1d22d): 8.3s - T-13 (3092e010ce7fc47cdd0bee843528d13291a40acf): 11.2s - T-12 (cb23207e0c520f207df84e6d6509f24eefc9680e): 10.1s - T-11 (070a7c95020e1730d327c8bb4ec69a51ef10cabc): 8.4s - T-10 (37bea386468e7aa67974eda9a1a8fbb87c8d48ec): 10s - T-9 (4b0f947b315ac43d126e652881467f619c323cd7): 7.6s - T-8 (a7b997238fc578a2c83b921cb2d4c1eab1f93325): 9.8s - T-7 (0381be519b6fff91a86bdcd19ac3a196a3480515): 10.7s - T-6 (af0e46cdbadd228d2cc4876e0cc861e8af14ebef): 8.1s - T-5 (b7fc0822d55c26daee4afbd7f4041ee0d034decb): 9.5s - T-4 (afaa4efdccf011d985f82719b4dc71ce7f051346): 8.5s - T-3 (390820e5a45277d4233cab6a3dae20079959421a): 7.4s - T-2 (a01ecdb7e4b348d7fa71d576ae02f918b897a2df): 9.8s - T-1 (97992ee4384e445302377c0ee35281abc8079daf): 10.8s - **T (current commit): 5.6s**

largeDepsZisi: 10.6s

⬇️ 98.31% decrease vs. 97992ee4384e445302377c0ee35281abc8079daf

^                                          21.1s                                           21.1s          
│  19.9s           19.7s           20.1s    ┌──┐                                    20s     ┌──┐          
│   ┌──┐            ┌──┐            ┌──┐    |  |           19.4s                    ┌──┐    |  |          
│   |  |            |  |            |  |    |  |            ┌──┐                    |  |    |  |          
│ ──┼──┼───16.5s────┼──┼────────────┼──┼────┼──┼────────────┼──┼────────────────────┼──┼────┼──┼──────────
│   |  |    ┌──┐    |  |            |  |    |  |   16.1s    |  |   16.2s            |  |    |  |          
│   |  |    |  |    |  |   15.1s    |  |    |  |    ┌──┐    |  |    ┌──┐   15.1s    |  |    |  |          
│   |  |    |  |    |  |    ┌──┐    |  |    |  |    |  |    |  |    |  |    ┌──┐    |  |    |  |          
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |          
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |          
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |   10.6s  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    ┌──┐  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
│   |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |  |    |▒▒|  
└───┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴────┴──┴──>
    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 - T-30 (bf7a4acac64a9c50364703196061618e95244fd4): 16s - T-29 (cc8ad7cd1ccbeb3158c2dd6a2e688945141f71e6): 23.4s - T-28 (58c83442fd6e88b931c33c40309495b79560087f): 20.7s - T-27 (9efef2f12593f66a220bce9c2ce940d78b9e8229): 16.9s - T-26 (84ff0f8de591f283570b723928bb001764576c8d): 15.2s - T-25 (7eafe9537935bca0b8c3ed4f3a1f4d4e262e27e9): 15.2s - T-24 (57c38e3fee419f4b65c04e45094ed3212113ba63): 19.6s - T-23 (7898a4bbbf09989ceec19accdb835065ed0b5c25): 21.5s - T-22 (d15abd9ac2cc525bb32b97bf1d7b0c61dc6f3109): 22.1s - T-21 (efa8ddc3ce75b888d32e809617708bc9267f223b): 16s - T-20 (600dbf7c6f6c1d7673aeb03074f32dd21bd77a91): 20.6s - T-19 (6051e01ca1034de9382d759255df098645920fc5): 18.8s - T-18 (57d30ec0fe95cb5d5fcaf7a36c4cb08b192ca371): 19.2s - T-17 (28b658a20a8557549545e6b8ac2d1e38f52e80b7): 19.2s - T-16 (d7a0d5086725f7f390ae91ae8787869f28634744): 21.4s - T-15 (1618df80c56c91b8622992f0fd45edf4fea69962): 20.6s - T-14 (0297aa17ec1d9082450a13bac5c33840c9d1d22d): 16.3s - T-13 (3092e010ce7fc47cdd0bee843528d13291a40acf): 20.9s - T-12 (cb23207e0c520f207df84e6d6509f24eefc9680e): 19.9s - T-11 (070a7c95020e1730d327c8bb4ec69a51ef10cabc): 16.5s - T-10 (37bea386468e7aa67974eda9a1a8fbb87c8d48ec): 19.7s - T-9 (4b0f947b315ac43d126e652881467f619c323cd7): 15.1s - T-8 (a7b997238fc578a2c83b921cb2d4c1eab1f93325): 20.1s - T-7 (0381be519b6fff91a86bdcd19ac3a196a3480515): 21.1s - T-6 (af0e46cdbadd228d2cc4876e0cc861e8af14ebef): 16.1s - T-5 (b7fc0822d55c26daee4afbd7f4041ee0d034decb): 19.4s - T-4 (afaa4efdccf011d985f82719b4dc71ce7f051346): 16.2s - T-3 (390820e5a45277d4233cab6a3dae20079959421a): 15.1s - T-2 (a01ecdb7e4b348d7fa71d576ae02f918b897a2df): 20s - T-1 (97992ee4384e445302377c0ee35281abc8079daf): 21.1s - **T (current commit): 10.6s**