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

Prevent false positive experimental warning #8284

Merged

Conversation

adam187
Copy link
Contributor

@adam187 adam187 commented Aug 8, 2019

When you have a config function:

https://github.com/zeit/next.js/blob/canary/packages/next-server/server/config.ts#L76

defaultConfig.experimental ends up as user config here and it creates a false positive warning even if a user doesn't have any experimental config.

@ijjk
Copy link
Member

ijjk commented Aug 8, 2019

Stats from current PR

Click to expand stats
zeit/next.js canary adam187/next.js prevent-false-positive-experimental-warning Change
Build Duration 23s 22.3s -723ms
node_modules Size 43.6 MB 43.6 MB ⚠️ +160 B
Total Bundle (main, webpack, commons) Size 207 kB 207 kB
Total Bundle (main, webpack, commons) gzip Size 68.1 kB 68.1 kB
Total Bundle (main, webpack, commons) Modern Size 182 kB 182 kB
Total Bundle (main, webpack, commons) Modern gzip Size 59.9 kB 59.9 kB
Client _app Size 2.39 kB 2.39 kB
Client _app gzip Size 1.08 kB 1.08 kB
Client _app Modern Size 1.83 kB 1.83 kB
Client _app gzip Modern Size 890 B 890 B
Client _error Size 8.22 kB 8.22 kB
Client _error gzip Size 3.16 kB 3.16 kB
Client _error Modern Size 5.85 kB 5.85 kB
Client _error gzip Modern Size 2.33 kB 2.33 kB
Client pages/index Size 343 B 343 B
Client pages/index gzip Size 246 B 246 B
Client pages/index Modern Size 319 B 319 B
Client pages/index gzip Modern Size 254 B 254 B
Client pages/link Size 4.08 kB 4.08 kB
Client pages/link gzip Size 1.8 kB 1.8 kB
Client pages/link Modern Size 3.7 kB 3.7 kB
Client pages/link gzip Modern Size 1.7 kB 1.7 kB
Client pages/routerDirect Size 423 B 423 B
Client pages/routerDirect gzip Size 306 B 306 B
Client pages/routerDirect Modern Size 411 B 411 B
Client pages/routerDirect gzip Modern Size 314 B 314 B
Client pages/withRouter Size 435 B 435 B
Client pages/withRouter gzip Size 301 B 301 B
Client pages/withRouter Modern Size 423 B 423 B
Client pages/withRouter gzip Modern Size 309 B 309 B
Client main Size 15.8 kB 15.8 kB
Client main gzip Size 5.46 kB 5.46 kB
Client main Modern Size 12.8 kB 12.8 kB
Client main Modern gzip Size 4.83 kB 4.83 kB
Client commons Size 188 kB 188 kB
Client commons gzip Size 61.3 kB 61.3 kB
Client commons Modern Size 169 kB 169 kB
Client commons Modern gzip Size 55.1 kB 55.1 kB
Client webpack Size 1.53 kB 1.53 kB
Client webpack gzip Size 778 B 778 B
Client webpack Modern Size 1.53 kB 1.53 kB
Client webpack Modern gzip Size 785 B 785 B
Base Rendered Size 2.76 kB 2.76 kB
Build Dir Size 1.39 MB 1.39 MB
Click to expand serverless stats
zeit/next.js canary adam187/next.js prevent-false-positive-experimental-warning Change
Build Duration 24.3s 24s -270ms
node_modules Size 43.6 MB 43.6 MB ⚠️ +160 B
Total Bundle (main, webpack, commons) Size 207 kB 207 kB
Total Bundle (main, webpack, commons) gzip Size 68.1 kB 68.1 kB
Total Bundle (main, webpack, commons) Modern Size 182 kB 182 kB
Total Bundle (main, webpack, commons) Modern gzip Size 59.9 kB 59.9 kB
Client _app Size 2.39 kB 2.39 kB
Client _app gzip Size 1.08 kB 1.08 kB
Client _app Modern Size 1.83 kB 1.83 kB
Client _app gzip Modern Size 890 B 890 B
Client _error Size 8.22 kB 8.22 kB
Client _error gzip Size 3.16 kB 3.16 kB
Client _error Modern Size 5.85 kB 5.85 kB
Client _error gzip Modern Size 2.33 kB 2.33 kB
Client pages/index Size 343 B 343 B
Client pages/index gzip Size 246 B 246 B
Client pages/index Modern Size 319 B 319 B
Client pages/index gzip Modern Size 254 B 254 B
Client pages/link Size 4.08 kB 4.08 kB
Client pages/link gzip Size 1.8 kB 1.8 kB
Client pages/link Modern Size 3.7 kB 3.7 kB
Client pages/link gzip Modern Size 1.7 kB 1.7 kB
Client pages/routerDirect Size 423 B 423 B
Client pages/routerDirect gzip Size 306 B 306 B
Client pages/routerDirect Modern Size 411 B 411 B
Client pages/routerDirect gzip Modern Size 314 B 314 B
Client pages/withRouter Size 435 B 435 B
Client pages/withRouter gzip Size 300 B 300 B
Client pages/withRouter Modern Size 423 B 423 B
Client pages/withRouter gzip Modern Size 309 B 309 B
Client main Size 15.8 kB 15.8 kB
Client main gzip Size 5.46 kB 5.46 kB
Client main Modern Size 12.8 kB 12.8 kB
Client main Modern gzip Size 4.83 kB 4.83 kB
Client commons Size 188 kB 188 kB
Client commons gzip Size 61.3 kB 61.3 kB
Client commons Modern Size 169 kB 169 kB
Client commons Modern gzip Size 55.1 kB 55.1 kB
Client webpack Size 1.53 kB 1.53 kB
Client webpack gzip Size 778 B 778 B
Client webpack Modern Size 1.53 kB 1.53 kB
Client webpack Modern gzip Size 785 B 785 B
Serverless pages/link Size 255 kB 255 kB
Serverless pages/link gzip Size 68.6 kB 68.6 kB -1 B
Serverless pages/index Size 248 kB 248 kB
Serverless pages/index gzip Size 66.4 kB 66.4 kB
Serverless pages/_error Size 247 kB 247 kB
Serverless pages/_error gzip Size 66.1 kB 66.1 kB
Serverless pages/routerDirect Size 248 kB 248 kB
Serverless pages/routerDirect gzip Size 66.3 kB 66.3 kB
Serverless pages/withRouter Size 248 kB 248 kB
Serverless pages/withRouter gzip Size 66.4 kB 66.4 kB ⚠️ +1 B
Build Dir Size 2.59 MB 2.59 MB
Copy link
Member

@Timer Timer left a comment

Choose a reason for hiding this comment

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

Let's also add a test to prevent this from regressing!

packages/next-server/server/config.ts Outdated Show resolved Hide resolved
@Timer Timer added this to the 9.0.4 milestone Aug 8, 2019
@adam187
Copy link
Contributor Author

adam187 commented Aug 9, 2019

Let's also add a test to prevent this from regressing!

@Timer Where should I add them?
I couldn't find any original test for this warning so it was hard for me to find a good place for this test.

Copy link
Member

@ijjk ijjk left a comment

Choose a reason for hiding this comment

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

Looks good, thanks for the PR! I went ahead and added some tests so we can get this merged 👍

@ijjk
Copy link
Member

ijjk commented Aug 11, 2019

Stats from current PR

Click to expand stats
zeit/next.js canary adam187/next.js prevent-false-positive-experimental-warning Change
Build Duration 24.2s 23.7s -568ms
node_modules Size 41.6 MB 41.6 MB ⚠️ +144 B
Total Bundle (main, webpack, commons) Size 213 kB 213 kB
Total Bundle (main, webpack, commons) gzip Size 70 kB 70 kB
Total Bundle (main, webpack, commons) Modern Size 188 kB 188 kB
Total Bundle (main, webpack, commons) Modern gzip Size 61.8 kB 61.8 kB
Client _app Size 2.35 kB 2.35 kB
Client _app gzip Size 1.07 kB 1.07 kB
Client _app Modern Size 1.79 kB 1.79 kB
Client _app gzip Modern Size 880 B 880 B
Client _error Size 8.22 kB 8.22 kB
Client _error gzip Size 3.16 kB 3.16 kB
Client _error Modern Size 5.85 kB 5.85 kB
Client _error gzip Modern Size 2.33 kB 2.33 kB
Client pages/index Size 343 B 343 B
Client pages/index gzip Size 246 B 246 B
Client pages/index Modern Size 319 B 319 B
Client pages/index gzip Modern Size 254 B 254 B
Client pages/link Size 4.18 kB 4.18 kB
Client pages/link gzip Size 1.82 kB 1.82 kB
Client pages/link Modern Size 3.81 kB 3.81 kB
Client pages/link gzip Modern Size 1.72 kB 1.72 kB
Client pages/routerDirect Size 423 B 423 B
Client pages/routerDirect gzip Size 306 B 306 B
Client pages/routerDirect Modern Size 411 B 411 B
Client pages/routerDirect gzip Modern Size 314 B 314 B
Client pages/withRouter Size 435 B 435 B
Client pages/withRouter gzip Size 301 B 301 B
Client pages/withRouter Modern Size 423 B 423 B
Client pages/withRouter gzip Modern Size 309 B 309 B
Client main Size 14.7 kB 14.7 kB
Client main gzip Size 5.08 kB 5.08 kB
Client main Modern Size 11.6 kB 11.6 kB
Client main Modern gzip Size 4.37 kB 4.37 kB
Client commons Size 195 kB 195 kB
Client commons gzip Size 63.6 kB 63.6 kB
Client commons Modern Size 176 kB 176 kB
Client commons Modern gzip Size 57.4 kB 57.4 kB
Client webpack Size 1.53 kB 1.53 kB
Client webpack gzip Size 778 B 778 B
Client webpack Modern Size 1.53 kB 1.53 kB
Client webpack Modern gzip Size 785 B 785 B
Base Rendered Size 2.76 kB 2.76 kB
Build Dir Size 1.43 MB 1.43 MB
Click to expand serverless stats
zeit/next.js canary adam187/next.js prevent-false-positive-experimental-warning Change
Build Duration 25.4s 25.9s ⚠️ +488ms
node_modules Size 41.6 MB 41.6 MB ⚠️ +144 B
Total Bundle (main, webpack, commons) Size 213 kB 213 kB
Total Bundle (main, webpack, commons) gzip Size 70 kB 70 kB
Total Bundle (main, webpack, commons) Modern Size 188 kB 188 kB
Total Bundle (main, webpack, commons) Modern gzip Size 61.8 kB 61.8 kB
Client _app Size 2.35 kB 2.35 kB
Client _app gzip Size 1.07 kB 1.07 kB
Client _app Modern Size 1.79 kB 1.79 kB
Client _app gzip Modern Size 880 B 880 B
Client _error Size 8.22 kB 8.22 kB
Client _error gzip Size 3.16 kB 3.16 kB
Client _error Modern Size 5.85 kB 5.85 kB
Client _error gzip Modern Size 2.33 kB 2.33 kB
Client pages/index Size 343 B 343 B
Client pages/index gzip Size 246 B 246 B
Client pages/index Modern Size 319 B 319 B
Client pages/index gzip Modern Size 254 B 254 B
Client pages/link Size 4.18 kB 4.18 kB
Client pages/link gzip Size 1.82 kB 1.82 kB
Client pages/link Modern Size 3.81 kB 3.81 kB
Client pages/link gzip Modern Size 1.72 kB 1.72 kB
Client pages/routerDirect Size 423 B 423 B
Client pages/routerDirect gzip Size 306 B 306 B
Client pages/routerDirect Modern Size 411 B 411 B
Client pages/routerDirect gzip Modern Size 314 B 314 B
Client pages/withRouter Size 435 B 435 B
Client pages/withRouter gzip Size 301 B 301 B
Client pages/withRouter Modern Size 423 B 423 B
Client pages/withRouter gzip Modern Size 309 B 309 B
Client main Size 14.7 kB 14.7 kB
Client main gzip Size 5.08 kB 5.08 kB
Client main Modern Size 11.6 kB 11.6 kB
Client main Modern gzip Size 4.37 kB 4.37 kB
Client commons Size 195 kB 195 kB
Client commons gzip Size 63.6 kB 63.6 kB
Client commons Modern Size 176 kB 176 kB
Client commons Modern gzip Size 57.4 kB 57.4 kB
Client webpack Size 1.53 kB 1.53 kB
Client webpack gzip Size 778 B 778 B
Client webpack Modern Size 1.53 kB 1.53 kB
Client webpack Modern gzip Size 785 B 785 B
Serverless pages/link Size 256 kB 256 kB
Serverless pages/link gzip Size 68.9 kB 68.9 kB ⚠️ +1 B
Serverless pages/index Size 249 kB 249 kB
Serverless pages/index gzip Size 66.6 kB 66.6 kB ⚠️ +1 B
Serverless pages/_error Size 248 kB 248 kB
Serverless pages/_error gzip Size 66.3 kB 66.3 kB
Serverless pages/routerDirect Size 249 kB 249 kB
Serverless pages/routerDirect gzip Size 66.6 kB 66.5 kB -1 B
Serverless pages/withRouter Size 249 kB 249 kB
Serverless pages/withRouter gzip Size 66.6 kB 66.6 kB ⚠️ +1 B
Build Dir Size 2.64 MB 2.64 MB
@Timer Timer added the lgtm label Aug 12, 2019
@ijjk
Copy link
Member

ijjk commented Aug 12, 2019

Stats from current PR

Click to expand stats
zeit/next.js canary adam187/next.js prevent-false-positive-experimental-warning Change
Build Duration 22.9s 22.7s -214ms
node_modules Size 41.6 MB 41.6 MB ⚠️ +144 B
Total Bundle (main, webpack, commons) Size 212 kB 212 kB
Total Bundle (main, webpack, commons) gzip Size 69.7 kB 69.7 kB
Total Bundle (main, webpack, commons) Modern Size 187 kB 187 kB
Total Bundle (main, webpack, commons) Modern gzip Size 61.6 kB 61.6 kB
Client _app Size 2.35 kB 2.35 kB
Client _app gzip Size 1.07 kB 1.07 kB
Client _app Modern Size 1.79 kB 1.79 kB
Client _app gzip Modern Size 880 B 880 B
Client _error Size 8.22 kB 8.22 kB
Client _error gzip Size 3.16 kB 3.16 kB
Client _error Modern Size 5.85 kB 5.85 kB
Client _error gzip Modern Size 2.33 kB 2.33 kB
Client pages/index Size 343 B 343 B
Client pages/index gzip Size 246 B 246 B
Client pages/index Modern Size 319 B 319 B
Client pages/index gzip Modern Size 254 B 254 B
Client pages/link Size 4.18 kB 4.18 kB
Client pages/link gzip Size 1.82 kB 1.82 kB
Client pages/link Modern Size 3.81 kB 3.81 kB
Client pages/link gzip Modern Size 1.72 kB 1.72 kB
Client pages/routerDirect Size 423 B 423 B
Client pages/routerDirect gzip Size 306 B 306 B
Client pages/routerDirect Modern Size 411 B 411 B
Client pages/routerDirect gzip Modern Size 314 B 314 B
Client pages/withRouter Size 435 B 435 B
Client pages/withRouter gzip Size 301 B 301 B
Client pages/withRouter Modern Size 423 B 423 B
Client pages/withRouter gzip Modern Size 309 B 309 B
Client main Size 14.5 kB 14.5 kB
Client main gzip Size 5.03 kB 5.03 kB
Client main Modern Size 11.4 kB 11.4 kB
Client main Modern gzip Size 4.32 kB 4.32 kB
Client commons Size 195 kB 195 kB
Client commons gzip Size 63.4 kB 63.4 kB
Client commons Modern Size 176 kB 176 kB
Client commons Modern gzip Size 57.3 kB 57.3 kB
Client webpack Size 1.53 kB 1.53 kB
Client webpack gzip Size 778 B 778 B
Client webpack Modern Size 1.53 kB 1.53 kB
Client webpack Modern gzip Size 785 B 785 B
Base Rendered Size 2.76 kB 2.76 kB
Build Dir Size 1.43 MB 1.43 MB
Click to expand serverless stats
zeit/next.js canary adam187/next.js prevent-false-positive-experimental-warning Change
Build Duration 24.9s 24.9s ⚠️ +26ms
node_modules Size 41.6 MB 41.6 MB ⚠️ +144 B
Total Bundle (main, webpack, commons) Size 212 kB 212 kB
Total Bundle (main, webpack, commons) gzip Size 69.7 kB 69.7 kB
Total Bundle (main, webpack, commons) Modern Size 187 kB 187 kB
Total Bundle (main, webpack, commons) Modern gzip Size 61.6 kB 61.6 kB
Client _app Size 2.35 kB 2.35 kB
Client _app gzip Size 1.07 kB 1.07 kB
Client _app Modern Size 1.79 kB 1.79 kB
Client _app gzip Modern Size 880 B 880 B
Client _error Size 8.22 kB 8.22 kB
Client _error gzip Size 3.16 kB 3.16 kB
Client _error Modern Size 5.85 kB 5.85 kB
Client _error gzip Modern Size 2.33 kB 2.33 kB
Client pages/index Size 343 B 343 B
Client pages/index gzip Size 246 B 246 B
Client pages/index Modern Size 319 B 319 B
Client pages/index gzip Modern Size 254 B 254 B
Client pages/link Size 4.18 kB 4.18 kB
Client pages/link gzip Size 1.82 kB 1.82 kB
Client pages/link Modern Size 3.81 kB 3.81 kB
Client pages/link gzip Modern Size 1.72 kB 1.72 kB
Client pages/routerDirect Size 423 B 423 B
Client pages/routerDirect gzip Size 306 B 306 B
Client pages/routerDirect Modern Size 411 B 411 B
Client pages/routerDirect gzip Modern Size 314 B 314 B
Client pages/withRouter Size 435 B 435 B
Client pages/withRouter gzip Size 301 B 301 B
Client pages/withRouter Modern Size 423 B 423 B
Client pages/withRouter gzip Modern Size 309 B 309 B
Client main Size 14.5 kB 14.5 kB
Client main gzip Size 5.03 kB 5.03 kB
Client main Modern Size 11.4 kB 11.4 kB
Client main Modern gzip Size 4.32 kB 4.32 kB
Client commons Size 195 kB 195 kB
Client commons gzip Size 63.4 kB 63.4 kB
Client commons Modern Size 176 kB 176 kB
Client commons Modern gzip Size 57.3 kB 57.3 kB
Client webpack Size 1.53 kB 1.53 kB
Client webpack gzip Size 778 B 778 B
Client webpack Modern Size 1.53 kB 1.53 kB
Client webpack Modern gzip Size 785 B 785 B
Serverless pages/link Size 257 kB 257 kB
Serverless pages/link gzip Size 69 kB 69 kB ⚠️ +1 B
Serverless pages/index Size 249 kB 249 kB
Serverless pages/index gzip Size 66.7 kB 66.7 kB ⚠️ +1 B
Serverless pages/_error Size 248 kB 248 kB
Serverless pages/_error gzip Size 66.4 kB 66.4 kB ⚠️ +1 B
Serverless pages/routerDirect Size 250 kB 250 kB
Serverless pages/routerDirect gzip Size 66.6 kB 66.6 kB ⚠️ +2 B
Serverless pages/withRouter Size 250 kB 250 kB
Serverless pages/withRouter gzip Size 66.7 kB 66.7 kB ⚠️ +1 B
Build Dir Size 2.64 MB 2.64 MB
@Timer Timer merged commit 3eca886 into vercel:canary Aug 12, 2019
@adam187 adam187 deleted the prevent-false-positive-experimental-warning branch November 3, 2019 06:10
@vercel vercel locked as resolved and limited conversation to collaborators Jan 31, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
3 participants