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

update CSS byte validation to 75000 #31

Merged
merged 3 commits into from
Sep 26, 2022
Merged

update CSS byte validation to 75000 #31

merged 3 commits into from
Sep 26, 2022

Conversation

reubenson
Copy link
Contributor

@reubenson reubenson commented Sep 26, 2022

Updating our CSS validation to reflect the fact that the AMP byte limit was increased from 50000 to 75000 in 2020: ampproject/amphtml#26466

Jira: https://vmproduct.atlassian.net/browse/CB-57

lib/media.js Outdated
@@ -71,8 +71,8 @@ function combineFileContents(fileArray, directory, filePrefix) {
.then(function (fileContents) {
const joined = fileContents.join('');

if (util.getByteLength(joined) > 50000) {
log('warn', 'Combined CSS contents are beyond the 50000 byte limit specified by AMPHTML.');
if (util.getByteLength(joined) > 75000) {
Copy link
Member

Choose a reason for hiding this comment

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

Might be good to link to the relevant docs to show where this number comes from.

if (util.getByteLength(joined) > 50000) {
log('warn', 'Combined CSS contents are beyond the 50000 byte limit specified by AMPHTML.');
if (util.getByteLength(joined) > 75000) {
log('warn', 'Combined CSS contents are beyond the 75000 byte limit specified by AMPHTML.');
}

Choose a reason for hiding this comment

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

I wonder if you should put a second warning for articles > 70,000. So we can see how many articles are nearing the the limit too.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

great point, and I should take the opportunity to add a bit more context to the logged object too

@reubenson reubenson merged commit 34636fd into master Sep 26, 2022
@reubenson reubenson deleted the CB-57 branch September 26, 2022 15:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants