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

CNA: replace make-dir with core recursive mkdir #15006

Merged
merged 3 commits into from
Jul 10, 2020
Merged

CNA: replace make-dir with core recursive mkdir #15006

merged 3 commits into from
Jul 10, 2020

Conversation

cristiand391
Copy link
Contributor

Fix #14902

I created a separated helper that wraps fs.promises.mkdir and sets recursive option to true by default.

I'm not sure if this is the right approach (maybe it should just call fs.promises.mkdir from create-app.ts?), any thoughts?

@ijjk ijjk added the create-next-app Related to our CLI tool for quickly starting a new Next.js application. label Jul 9, 2020
@ijjk
Copy link
Member

ijjk commented Jul 9, 2020

Stats from current PR

Default Server Mode (Decrease detected ✓)
General
vercel/next.js canary cristiand391/next.js replace-make-dir Change
buildDuration 12.1s 12.4s ⚠️ +356ms
nodeModulesSize 66.1 MB 66.1 MB
Page Load Tests Overall decrease ⚠️
vercel/next.js canary cristiand391/next.js replace-make-dir Change
/ failed reqs 0 0
/ total time (seconds) 1.997 1.971 -0.03
/ avg req/sec 1251.74 1268.33 +16.59
/error-in-render failed reqs 0 0
/error-in-render total time (seconds) 1.217 1.23 ⚠️ +0.01
/error-in-render avg req/sec 2054.55 2033.23 ⚠️ -21.32
Client Bundles (main, webpack, commons)
vercel/next.js canary cristiand391/next.js replace-make-dir Change
main-HASH.js gzip 6.63 kB 6.63 kB
webpack-HASH.js gzip 751 B 751 B
19b7e98f51cc..e4a8.js gzip 10.7 kB 10.7 kB
framework.HASH.js gzip 39.1 kB 39.1 kB
Overall change 57.2 kB 57.2 kB
Client Bundles (main, webpack, commons) Modern
vercel/next.js canary cristiand391/next.js replace-make-dir Change
main-HASH.module.js gzip 5.72 kB 5.72 kB
webpack-HASH..dule.js gzip 751 B 751 B
19b7e98f51cc..dule.js gzip 7.1 kB 7.1 kB
framework.HA..dule.js gzip 39.1 kB 39.1 kB
Overall change 52.7 kB 52.7 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary cristiand391/next.js replace-make-dir Change
polyfills-HASH.js gzip 26.4 kB 26.4 kB
Overall change 26.4 kB 26.4 kB
Client Build Manifests
vercel/next.js canary cristiand391/next.js replace-make-dir Change
_buildManifest.js gzip 268 B 268 B
_buildManife..dule.js gzip 272 B 272 B
Overall change 540 B 540 B
Rendered Page Sizes
vercel/next.js canary cristiand391/next.js replace-make-dir Change
index.html gzip 953 B 953 B
link.html gzip 961 B 961 B
withRouter.html gzip 946 B 946 B
Overall change 2.86 kB 2.86 kB

Serverless Mode
General
vercel/next.js canary cristiand391/next.js replace-make-dir Change
buildDuration 13.2s 13.4s ⚠️ +139ms
nodeModulesSize 66.1 MB 66.1 MB
Client Bundles (main, webpack, commons)
vercel/next.js canary cristiand391/next.js replace-make-dir Change
main-HASH.js gzip 6.63 kB 6.63 kB
webpack-HASH.js gzip 751 B 751 B
19b7e98f51cc..e4a8.js gzip 10.7 kB 10.7 kB
framework.HASH.js gzip 39.1 kB 39.1 kB
Overall change 57.2 kB 57.2 kB
Client Bundles (main, webpack, commons) Modern
vercel/next.js canary cristiand391/next.js replace-make-dir Change
main-HASH.module.js gzip 5.72 kB 5.72 kB
webpack-HASH..dule.js gzip 751 B 751 B
19b7e98f51cc..dule.js gzip 7.1 kB 7.1 kB
framework.HA..dule.js gzip 39.1 kB 39.1 kB
Overall change 52.7 kB 52.7 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary cristiand391/next.js replace-make-dir Change
polyfills-HASH.js gzip 26.4 kB 26.4 kB
Overall change 26.4 kB 26.4 kB
Client Build Manifests
vercel/next.js canary cristiand391/next.js replace-make-dir Change
_buildManifest.js gzip 268 B 268 B
_buildManife..dule.js gzip 272 B 272 B
Overall change 540 B 540 B
Serverless bundles
vercel/next.js canary cristiand391/next.js replace-make-dir Change
_error.js 876 kB 876 kB
404.html 4.17 kB 4.17 kB
hooks.html 3.79 kB 3.79 kB
index.js 877 kB 877 kB
link.js 916 kB 916 kB
routerDirect.js 909 kB 909 kB
withRouter.js 910 kB 910 kB
Overall change 4.5 MB 4.5 MB
Commit: a76075d

@ijjk
Copy link
Member

ijjk commented Jul 9, 2020

Stats from current PR

Default Server Mode (Decrease detected ✓)
General
vercel/next.js canary cristiand391/next.js replace-make-dir Change
buildDuration 11.8s 11.9s ⚠️ +160ms
nodeModulesSize 66.1 MB 66.1 MB
Page Load Tests Overall decrease ⚠️
vercel/next.js canary cristiand391/next.js replace-make-dir Change
/ failed reqs 0 0
/ total time (seconds) 1.806 1.878 ⚠️ +0.07
/ avg req/sec 1383.98 1331.28 ⚠️ -52.7
/error-in-render failed reqs 0 0
/error-in-render total time (seconds) 1.158 1.14 -0.02
/error-in-render avg req/sec 2159.31 2192.87 +33.56
Client Bundles (main, webpack, commons)
vercel/next.js canary cristiand391/next.js replace-make-dir Change
main-HASH.js gzip 6.63 kB 6.63 kB
webpack-HASH.js gzip 751 B 751 B
19b7e98f51cc..e4a8.js gzip 10.7 kB 10.7 kB
framework.HASH.js gzip 39.1 kB 39.1 kB
Overall change 57.2 kB 57.2 kB
Client Bundles (main, webpack, commons) Modern
vercel/next.js canary cristiand391/next.js replace-make-dir Change
main-HASH.module.js gzip 5.72 kB 5.72 kB
webpack-HASH..dule.js gzip 751 B 751 B
19b7e98f51cc..dule.js gzip 7.1 kB 7.1 kB
framework.HA..dule.js gzip 39.1 kB 39.1 kB
Overall change 52.7 kB 52.7 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary cristiand391/next.js replace-make-dir Change
polyfills-HASH.js gzip 26.4 kB 26.4 kB
Overall change 26.4 kB 26.4 kB
Client Build Manifests
vercel/next.js canary cristiand391/next.js replace-make-dir Change
_buildManifest.js gzip 268 B 268 B
_buildManife..dule.js gzip 272 B 272 B
Overall change 540 B 540 B
Rendered Page Sizes
vercel/next.js canary cristiand391/next.js replace-make-dir Change
index.html gzip 953 B 953 B
link.html gzip 961 B 961 B
withRouter.html gzip 946 B 946 B
Overall change 2.86 kB 2.86 kB

Serverless Mode
General
vercel/next.js canary cristiand391/next.js replace-make-dir Change
buildDuration 12.5s 12.7s ⚠️ +172ms
nodeModulesSize 66.1 MB 66.1 MB
Client Bundles (main, webpack, commons)
vercel/next.js canary cristiand391/next.js replace-make-dir Change
main-HASH.js gzip 6.63 kB 6.63 kB
webpack-HASH.js gzip 751 B 751 B
19b7e98f51cc..e4a8.js gzip 10.7 kB 10.7 kB
framework.HASH.js gzip 39.1 kB 39.1 kB
Overall change 57.2 kB 57.2 kB
Client Bundles (main, webpack, commons) Modern
vercel/next.js canary cristiand391/next.js replace-make-dir Change
main-HASH.module.js gzip 5.72 kB 5.72 kB
webpack-HASH..dule.js gzip 751 B 751 B
19b7e98f51cc..dule.js gzip 7.1 kB 7.1 kB
framework.HA..dule.js gzip 39.1 kB 39.1 kB
Overall change 52.7 kB 52.7 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary cristiand391/next.js replace-make-dir Change
polyfills-HASH.js gzip 26.4 kB 26.4 kB
Overall change 26.4 kB 26.4 kB
Client Build Manifests
vercel/next.js canary cristiand391/next.js replace-make-dir Change
_buildManifest.js gzip 268 B 268 B
_buildManife..dule.js gzip 272 B 272 B
Overall change 540 B 540 B
Serverless bundles
vercel/next.js canary cristiand391/next.js replace-make-dir Change
_error.js 876 kB 876 kB
404.html 4.17 kB 4.17 kB
hooks.html 3.79 kB 3.79 kB
index.js 877 kB 877 kB
link.js 916 kB 916 kB
routerDirect.js 909 kB 909 kB
withRouter.js 910 kB 910 kB
Overall change 4.5 MB 4.5 MB
Commit: e5a2c36

@ijjk
Copy link
Member

ijjk commented Jul 10, 2020

Stats from current PR

Default Server Mode (Increase detected ⚠️)
General
vercel/next.js canary cristiand391/next.js replace-make-dir Change
buildDuration 11.9s 11.4s -480ms
nodeModulesSize 66.4 MB 66.4 MB
Page Load Tests Overall increase ✓
vercel/next.js canary cristiand391/next.js replace-make-dir Change
/ failed reqs 0 0
/ total time (seconds) 1.907 1.798 -0.11
/ avg req/sec 1311.19 1390.49 +79.3
/error-in-render failed reqs 0 0
/error-in-render total time (seconds) 1.236 1.14 -0.1
/error-in-render avg req/sec 2022.22 2192.55 +170.33
Client Bundles (main, webpack, commons)
vercel/next.js canary cristiand391/next.js replace-make-dir Change
main-HASH.js gzip 6.63 kB 6.63 kB
webpack-HASH.js gzip 751 B 751 B
19b7e98f51cc..e4a8.js gzip 10.7 kB 10.7 kB
framework.HASH.js gzip 39.1 kB 39.1 kB
Overall change 57.2 kB 57.2 kB
Client Bundles (main, webpack, commons) Modern
vercel/next.js canary cristiand391/next.js replace-make-dir Change
main-HASH.module.js gzip 5.72 kB 5.72 kB
webpack-HASH..dule.js gzip 751 B 751 B
19b7e98f51cc..dule.js gzip 7.1 kB 7.1 kB
framework.HA..dule.js gzip 39.1 kB 39.1 kB
Overall change 52.7 kB 52.7 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary cristiand391/next.js replace-make-dir Change
polyfills-HASH.js gzip 26.4 kB 26.4 kB
Overall change 26.4 kB 26.4 kB
Client Build Manifests
vercel/next.js canary cristiand391/next.js replace-make-dir Change
_buildManifest.js gzip 268 B 268 B
_buildManife..dule.js gzip 272 B 272 B
Overall change 540 B 540 B
Rendered Page Sizes
vercel/next.js canary cristiand391/next.js replace-make-dir Change
index.html gzip 953 B 953 B
link.html gzip 961 B 961 B
withRouter.html gzip 945 B 945 B
Overall change 2.86 kB 2.86 kB

Serverless Mode
General
vercel/next.js canary cristiand391/next.js replace-make-dir Change
buildDuration 12.8s 13.2s ⚠️ +377ms
nodeModulesSize 66.4 MB 66.4 MB
Client Bundles (main, webpack, commons)
vercel/next.js canary cristiand391/next.js replace-make-dir Change
main-HASH.js gzip 6.63 kB 6.63 kB
webpack-HASH.js gzip 751 B 751 B
19b7e98f51cc..e4a8.js gzip 10.7 kB 10.7 kB
framework.HASH.js gzip 39.1 kB 39.1 kB
Overall change 57.2 kB 57.2 kB
Client Bundles (main, webpack, commons) Modern
vercel/next.js canary cristiand391/next.js replace-make-dir Change
main-HASH.module.js gzip 5.72 kB 5.72 kB
webpack-HASH..dule.js gzip 751 B 751 B
19b7e98f51cc..dule.js gzip 7.1 kB 7.1 kB
framework.HA..dule.js gzip 39.1 kB 39.1 kB
Overall change 52.7 kB 52.7 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary cristiand391/next.js replace-make-dir Change
polyfills-HASH.js gzip 26.4 kB 26.4 kB
Overall change 26.4 kB 26.4 kB
Client Build Manifests
vercel/next.js canary cristiand391/next.js replace-make-dir Change
_buildManifest.js gzip 268 B 268 B
_buildManife..dule.js gzip 272 B 272 B
Overall change 540 B 540 B
Serverless bundles
vercel/next.js canary cristiand391/next.js replace-make-dir Change
_error.js 876 kB 876 kB
404.html 4.17 kB 4.17 kB
hooks.html 3.79 kB 3.79 kB
index.js 877 kB 877 kB
link.js 916 kB 916 kB
routerDirect.js 909 kB 909 kB
withRouter.js 910 kB 910 kB
Overall change 4.5 MB 4.5 MB
Commit: 4277db6

@kodiakhq kodiakhq bot merged commit f4f6fea into vercel:canary Jul 10, 2020
@cristiand391 cristiand391 deleted the replace-make-dir branch July 10, 2020 11:15
rokinsky pushed a commit to rokinsky/next.js that referenced this pull request Jul 11, 2020
Fix vercel#14902 

I created a separated helper that wraps `fs.promises.mkdir` and sets `recursive` option to `true` by default.

I'm not sure if this is the right approach (maybe it should just call `fs.promises.mkdir` from `create-app.ts`?), any thoughts?
@vercel vercel locked as resolved and limited conversation to collaborators Jan 30, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
create-next-app Related to our CLI tool for quickly starting a new Next.js application.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

recommendation: replace make-dir with core recursive mkdir
4 participants