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

Added babel-plugin-dynamic-import-node #6811

Merged
merged 5 commits into from
Mar 30, 2019

Conversation

lfades
Copy link
Member

@lfades lfades commented Mar 27, 2019

Replaces import() with require only for the testing environment.

@github-actions
Copy link
Contributor

Stats from current PR

Click to expand stats
zeit/next.js canary lfades/next.js dynamic-require Change
Build Duration 13.1s 12.6s -4.12%
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 128 MB 127 MB -0.71%
Max Memory Usage 165 MB 162 MB -1.64%
Average CPU Usage 91.87% 92.9% ⚠️ +1.12%
Max CPU Usage 111.11% 122.22% ⚠️ +10%
node_modules Size 42.6 MB 42.6 MB ⚠️ +0.03%
Click to expand serverless stats
zeit/next.js canary lfades/next.js dynamic-require Change
Build Duration 16.5s 16.5s -0.09%
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
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
Serverless pages/withRouter Size 217 kB 217 kB
Serverless pages/withRouter gzip Size 56.8 kB 56.8 kB
Build Dir Size 1.31 MB 1.31 MB
Average Memory Usage 138 MB 143 MB ⚠️ +3.2%
Max Memory Usage 204 MB 190 MB -7.2%
Average CPU Usage 95.68% 94.4% -1.34%
Max CPU Usage 111.11% 111.11%
node_modules Size 42.6 MB 42.6 MB ⚠️ +0.03%

@timneutkens
Copy link
Member

We need to figure out that build respecting NODE_ENV issue first.

@github-actions
Copy link
Contributor

Stats from current PR

Click to expand stats
zeit/next.js canary lfades/next.js dynamic-require Change
Build Duration 12.8s 13.6s ⚠️ +795ms
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 128 MB 129 MB ⚠️ +1.55 MB
Max Memory Usage 166 MB 166 MB
Average CPU Usage 93.64% 93.2% -0.44%
Max CPU Usage 111.11% 122.22% ⚠️ +11.11%
node_modules Size 42.6 MB 42.7 MB ⚠️ +11 kB
Click to expand serverless stats
zeit/next.js canary lfades/next.js dynamic-require Change
Build Duration 16.7s 16.7s
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
Serverless pages/index Size 216 kB 216 kB
Serverless pages/index gzip Size 56.8 kB 56.8 kB
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
Serverless pages/withRouter Size 217 kB 217 kB
Serverless pages/withRouter gzip Size 56.8 kB 56.8 kB
Build Dir Size 1.31 MB 1.31 MB
Average Memory Usage 141 MB 139 MB -1.56 MB
Max Memory Usage 205 MB 204 MB -815 kB
Average CPU Usage 95.5% 95.02% -0.48%
Max CPU Usage 111.11% 111.11%
node_modules Size 42.6 MB 42.7 MB ⚠️ +11 kB

@github-actions
Copy link
Contributor

Stats from current PR

Click to expand stats
zeit/next.js canary lfades/next.js dynamic-require Change
Build Duration 13.8s 13.7s -114ms
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 129 MB 132 MB ⚠️ +2.8 MB
Max Memory Usage 178 MB 174 MB -3.74 MB
Average CPU Usage 94.15% 93.8% -0.35%
Max CPU Usage 111.11% 110% -1.11%
node_modules Size 42.6 MB 42.7 MB ⚠️ +11 kB
Click to expand serverless stats
zeit/next.js canary lfades/next.js dynamic-require Change
Build Duration 17.7s 17s -694ms
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
Serverless pages/index Size 216 kB 216 kB
Serverless pages/index gzip Size 56.8 kB 56.8 kB
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
Serverless pages/withRouter Size 217 kB 217 kB
Serverless pages/withRouter gzip Size 56.8 kB 56.8 kB
Build Dir Size 1.31 MB 1.31 MB
Average Memory Usage 140 MB 139 MB -661 kB
Max Memory Usage 204 MB 176 MB -28.3 MB
Average CPU Usage 96% 94.99% -1.01%
Max CPU Usage 111.11% 111.11%
node_modules Size 42.6 MB 42.7 MB ⚠️ +11 kB

@lfades
Copy link
Member Author

lfades commented Mar 29, 2019

This PR broke dynamic imports, don't merge

@github-actions
Copy link
Contributor

Stats from current PR

Click to expand stats
zeit/next.js canary lfades/next.js dynamic-require Change
Build Duration 11.9s 11.9s -53ms
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 346 kB 345 kB -565 B
Average Memory Usage 128 MB 128 MB -424 kB
Max Memory Usage 162 MB 162 MB ⚠️ +573 kB
Average CPU Usage 93.48% 93.39% -0.09%
Max CPU Usage 111.11% 111.11%
node_modules Size 42.6 MB 42.7 MB ⚠️ +10.5 kB
Click to expand serverless stats
zeit/next.js canary lfades/next.js dynamic-require Change
Build Duration 15.6s 15.7s ⚠️ +132ms
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 222 kB 221 kB -224 B
Serverless pages/link gzip Size 58 kB 58 kB -70 B
Serverless pages/index Size 217 kB 216 kB -224 B
Serverless pages/index gzip Size 56.8 kB 56.8 kB -64 B
Serverless pages/_error Size 218 kB 218 kB -224 B
Serverless pages/_error gzip Size 56.8 kB 56.7 kB -66 B
Serverless pages/routerDirect Size 217 kB 217 kB -224 B
Serverless pages/routerDirect gzip Size 56.8 kB 56.7 kB -65 B
Serverless pages/withRouter Size 217 kB 217 kB -224 B
Serverless pages/withRouter gzip Size 56.9 kB 56.8 kB -64 B
Build Dir Size 1.31 MB 1.31 MB -1.12 kB
Average Memory Usage 143 MB 141 MB -1.96 MB
Max Memory Usage 189 MB 207 MB ⚠️ +17.5 MB
Average CPU Usage 94.65% 95.73% ⚠️ +1.08%
Max CPU Usage 111.11% 122.22% ⚠️ +11.11%
node_modules Size 42.6 MB 42.7 MB ⚠️ +10.5 kB

@lfades
Copy link
Member Author

lfades commented Mar 29, 2019

Now it's okay 👍

Copy link
Member

@timneutkens timneutkens left a comment

Choose a reason for hiding this comment

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

💯

@timneutkens timneutkens merged commit f81e5f4 into vercel:canary Mar 30, 2019
@lfades lfades deleted the dynamic-require branch April 22, 2019 21:20
@lock lock bot locked as resolved and limited conversation to collaborators Apr 25, 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