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

WIP: Optimize destructuring for hooks #6809

Closed
wants to merge 2 commits into from

Conversation

lfades
Copy link
Member

@lfades lfades commented Mar 27, 2019

This change is based on this PR, it currently does nothing because the selectiveLoose option is still inside a open PR

@lfades
Copy link
Member Author

lfades commented Mar 27, 2019

There's another option: babel-plugin-optimize-react but it's also being implemented in this PR and still not merged. cc @Timer

@github-actions
Copy link
Contributor

Stats from current PR

Click to expand stats
zeit/next.js canary lfades/next.js optimize-hooks Change
Build Duration 14.2s 13.9s -2.34%
Client _app Size 3.03 kB 3.03 kB
Client _app gzip Size 1.29 kB 1.29 kB
Client _error Size 8.43 kB 8.43 kB
Client _error gzip Size 3.23 kB 3.23 kB
Client pages/index Size 298 B 298 B
Client pages/index gzip Size 235 B 235 B
Client pages/link Size 3.31 kB 3.31 kB
Client pages/link gzip Size 1.5 kB 1.5 kB
Client pages/routerDirect Size 426 B 426 B
Client pages/routerDirect gzip Size 304 B 304 B
Client pages/withRouter Size 408 B 408 B
Client pages/withRouter gzip Size 293 B 293 B
Client main Size 21.7 kB 21.7 kB
Client main gzip Size 7.16 kB 7.16 kB
Client commons Size 183 kB 183 kB
Client commons gzip Size 59.5 kB 59.5 kB
Client webpack Size 1.49 kB 1.49 kB
Client webpack gzip Size 774 B 774 B
Base Rendered Size 1.3 kB 1.3 kB
Build Dir Size 345 kB 345 kB
Average Memory Usage 127 MB 128 MB ⚠️ +0.09%
Max Memory Usage 162 MB 166 MB ⚠️ +2.77%
Average CPU Usage 91.76% 93.8% ⚠️ +2.22%
Max CPU Usage 122.22% 110% -10%
node_modules Size 42.6 MB 42.6 MB ⚠️ +0%
Click to expand serverless stats
zeit/next.js canary lfades/next.js optimize-hooks Change
Build Duration 17.4s 17.6s ⚠️ +0.99%
Client _app Size 3.03 kB 3.03 kB
Client _app gzip Size 1.29 kB 1.29 kB
Client _error Size 8.43 kB 8.43 kB
Client _error gzip Size 3.23 kB 3.23 kB
Client pages/index Size 298 B 298 B
Client pages/index gzip Size 235 B 235 B
Client pages/link Size 3.31 kB 3.31 kB
Client pages/link gzip Size 1.5 kB 1.5 kB
Client pages/routerDirect Size 426 B 426 B
Client pages/routerDirect gzip Size 304 B 304 B
Client pages/withRouter Size 408 B 408 B
Client pages/withRouter gzip Size 293 B 293 B
Client main Size 21.7 kB 21.7 kB
Client main gzip Size 7.16 kB 7.16 kB
Client commons Size 183 kB 183 kB
Client commons gzip Size 59.5 kB 59.5 kB
Client webpack Size 1.49 kB 1.49 kB
Client webpack gzip Size 774 B 774 B
Serverless pages/link Size 221 kB 221 kB
Serverless pages/link gzip Size 58 kB 58 kB 0%
Serverless pages/index Size 216 kB 216 kB
Serverless pages/index gzip Size 56.8 kB 56.8 kB 0%
Serverless pages/_error Size 218 kB 218 kB
Serverless pages/_error gzip Size 56.7 kB 56.7 kB
Serverless pages/routerDirect Size 217 kB 217 kB
Serverless pages/routerDirect gzip Size 56.7 kB 56.7 kB 0%
Serverless pages/withRouter Size 217 kB 217 kB
Serverless pages/withRouter gzip Size 56.8 kB 56.8 kB 0%
Build Dir Size 1.31 MB 1.31 MB
Average Memory Usage 142 MB 141 MB -1.01%
Max Memory Usage 189 MB 205 MB ⚠️ +8.49%
Average CPU Usage 94.75% 96.05% ⚠️ +1.37%
Max CPU Usage 122.22% 111.11% -9.09%
node_modules Size 42.6 MB 42.6 MB ⚠️ +0%

@github-actions
Copy link
Contributor

Stats from current PR

Click to expand stats
zeit/next.js canary lfades/next.js optimize-hooks Change
Build Duration 14.3s 12.9s -1.4s
Client _app Size 3.03 kB 3.03 kB
Client _app gzip Size 1.29 kB 1.29 kB
Client _error Size 8.85 kB 8.85 kB
Client _error gzip Size 3.31 kB 3.31 kB
Client pages/index Size 298 B 298 B
Client pages/index gzip Size 235 B 235 B
Client pages/link Size 3.28 kB 3.28 kB
Client pages/link gzip Size 1.49 kB 1.49 kB
Client pages/routerDirect Size 426 B 426 B
Client pages/routerDirect gzip Size 304 B 304 B
Client pages/withRouter Size 408 B 408 B
Client pages/withRouter gzip Size 293 B 293 B
Client main Size 22.1 kB 22.1 kB
Client main gzip Size 7.24 kB 7.24 kB
Client commons Size 182 kB 182 kB
Client commons gzip Size 59.4 kB 59.4 kB
Client webpack Size 1.49 kB 1.49 kB
Client webpack gzip Size 774 B 774 B
Base Rendered Size 1.3 kB 1.3 kB
Total Bundle (main, webpack, commons) Size 208 kB 208 kB
Total Bundle (main, webpack, commons) gzip Size 68.2 kB 68.2 kB
Build Dir Size 346 kB 346 kB
node_modules Size 42.7 MB 42.7 MB ⚠️ +1.38 kB
Click to expand serverless stats
zeit/next.js canary lfades/next.js optimize-hooks Change
Build Duration 17s 16.9s -81ms
Client _app Size 3.03 kB 3.03 kB
Client _app gzip Size 1.29 kB 1.29 kB
Client _error Size 8.85 kB 8.85 kB
Client _error gzip Size 3.31 kB 3.31 kB
Client pages/index Size 298 B 298 B
Client pages/index gzip Size 235 B 235 B
Client pages/link Size 3.28 kB 3.28 kB
Client pages/link gzip Size 1.49 kB 1.49 kB
Client pages/routerDirect Size 426 B 426 B
Client pages/routerDirect gzip Size 304 B 304 B
Client pages/withRouter Size 408 B 408 B
Client pages/withRouter gzip Size 293 B 293 B
Client main Size 22.1 kB 22.1 kB
Client main gzip Size 7.24 kB 7.24 kB
Client commons Size 182 kB 182 kB
Client commons gzip Size 59.4 kB 59.4 kB
Client webpack Size 1.49 kB 1.49 kB
Client webpack gzip Size 774 B 774 B
Serverless pages/link Size 220 kB 220 kB
Serverless pages/link gzip Size 58 kB 58 kB -2 B
Serverless pages/index Size 215 kB 215 kB
Serverless pages/index gzip Size 56.8 kB 56.8 kB -1 B
Serverless pages/_error Size 217 kB 217 kB
Serverless pages/_error gzip Size 56.8 kB 56.8 kB
Serverless pages/routerDirect Size 216 kB 216 kB
Serverless pages/routerDirect gzip Size 56.8 kB 56.8 kB ⚠️ +2 B
Serverless pages/withRouter Size 216 kB 216 kB
Serverless pages/withRouter gzip Size 56.8 kB 56.8 kB ⚠️ +1 B
Total Bundle (main, webpack, commons) Size 208 kB 208 kB
Total Bundle (main, webpack, commons) gzip Size 68.2 kB 68.2 kB
Build Dir Size 1.31 MB 1.31 MB
node_modules Size 42.7 MB 42.7 MB ⚠️ +1.38 kB

@timneutkens
Copy link
Member

Just out of curiosity, is the plugin part of preset-env? Because how else do we handle destructuring currently?

I'm going to close this PR as it's not actionable right now, we should re-open when it actually does something.

@timneutkens timneutkens closed this Apr 3, 2019
@lfades lfades deleted the optimize-hooks branch April 30, 2019 00:02
@lock lock bot locked as resolved and limited conversation to collaborators May 5, 2020
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.

2 participants