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

Add dropping of custom scripts in AMP mode #6830

Merged
merged 3 commits into from
Mar 29, 2019

Conversation

ijjk
Copy link
Member

@ijjk ijjk commented Mar 29, 2019

Drops user <script> tags and shows a warning in AMP mode. Right now they are only dropped in production mode and left in dev mode so the validator shows its warning since it looks like conflicting props log messages are being cleared causing them to not show.

Closes: #6688

@github-actions
Copy link
Contributor

Stats from current PR

Click to expand stats
zeit/next.js canary ijjk/next.js amp/drop-scripts Change
Build Duration 11.5s 11.3s -169ms
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 346 kB ⚠️ +766 B
Average Memory Usage 127 MB 129 MB ⚠️ +1.74 MB
Max Memory Usage 162 MB 167 MB ⚠️ +5.34 MB
Average CPU Usage 93.33% 93.05% -0.28%
Max CPU Usage 122.22% 110% -12.22%
node_modules Size 42.6 MB 42.6 MB
Click to expand serverless stats
zeit/next.js canary ijjk/next.js amp/drop-scripts Change
Build Duration 15s 14.2s -826ms
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 222 kB ⚠️ +269 B
Serverless pages/link gzip Size 58 kB 58 kB
Serverless pages/index Size 216 kB 217 kB ⚠️ +269 B
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.8 kB ⚠️ +78 B
Serverless pages/routerDirect Size 217 kB 217 kB
Serverless pages/routerDirect gzip Size 56.7 kB 56.8 kB ⚠️ +80 B
Serverless pages/withRouter Size 217 kB 217 kB
Serverless pages/withRouter gzip Size 56.8 kB 56.9 kB ⚠️ +77 B
Build Dir Size 1.31 MB 1.31 MB
Average Memory Usage 138 MB 141 MB ⚠️ +3.32 MB
Max Memory Usage 206 MB 185 MB -20.9 MB
Average CPU Usage 97.29% 98.19% ⚠️ +0.9%
Max CPU Usage 110% 122.22% ⚠️ +12.22%
node_modules Size 42.6 MB 42.6 MB

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.

Does this need a test?

@ijjk
Copy link
Member Author

ijjk commented Mar 29, 2019

Yup, added a test

@github-actions
Copy link
Contributor

Stats from current PR

Click to expand stats
zeit/next.js canary ijjk/next.js amp/drop-scripts Change
Build Duration 12.5s 12.7s ⚠️ +160ms
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 346 kB ⚠️ +565 B
Average Memory Usage 127 MB 128 MB ⚠️ +1.08 MB
Max Memory Usage 164 MB 166 MB ⚠️ +1.4 MB
Average CPU Usage 94.76% 92.74% -2.02%
Max CPU Usage 111.11% 111.11%
node_modules Size 42.6 MB 42.6 MB
Click to expand serverless stats
zeit/next.js canary ijjk/next.js amp/drop-scripts Change
Build Duration 16.6s 16.4s -117ms
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 222 kB ⚠️ +224 B
Serverless pages/link gzip Size 58 kB 58 kB
Serverless pages/index Size 216 kB 217 kB ⚠️ +224 B
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.8 kB ⚠️ +64 B
Serverless pages/routerDirect Size 217 kB 217 kB
Serverless pages/routerDirect gzip Size 56.7 kB 56.8 kB ⚠️ +65 B
Serverless pages/withRouter Size 217 kB 217 kB
Serverless pages/withRouter gzip Size 56.8 kB 56.9 kB ⚠️ +64 B
Build Dir Size 1.31 MB 1.31 MB
Average Memory Usage 140 MB 140 MB
Max Memory Usage 204 MB 205 MB ⚠️ +1.04 MB
Average CPU Usage 95.49% 95.73% ⚠️ +0.24%
Max CPU Usage 111.11% 111.11%
node_modules Size 42.6 MB 42.6 MB

@timneutkens timneutkens merged commit 26a4eb8 into vercel:canary Mar 29, 2019
@ijjk ijjk deleted the amp/drop-scripts branch March 29, 2019 16:20
@lock lock bot locked as resolved and limited conversation to collaborators Apr 2, 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.

Drop user <script> tags
2 participants