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

Comment Likes: do not load on AMP views #14840

Merged
merged 2 commits into from
Mar 4, 2020

Commits on Feb 28, 2020

  1. Prevent noticons from being enqueued in AMP mode

    Summary:
    This patch disables enqueuing of assets for some non-functional features
    when in AMP mode.
    
    Noticons is a very large CSS asset, and so it prevents a lot of other CSS from
    being enqueued. A review of the places we use it showed that it was not actually
    being used by any functionality that works in AMP mode.
    
    Affected features:
    - Comment Likes (non-functional in AMP)
    - Geo Location (not used on most pages - might be useful to port `wpcom_vip_load_geolocation_styles_only_when_needed()` to all sites)
    - Notifications UI (non-functional in AMP)
    - admin-bar - (non-functional in AMP)
    
    Test Plan:
    Load a page in Transitional mode
    
    Ensure that noticons-css is not enqueued, and that little or no CSS is blocked by AMP due to being over the 50kb max
    
    [x] - ensure that features whose CSS is not being enqueued are not actually used
    
    Reviewers: josephscott, #devops_team, davidbinovec, goldsounds
    
    Subscribers: davidbinovec
    
    Tags: #touches_jetpack_files
    
    Differential Revision: D38340-code
    
    This commit syncs r203534-wpcom.
    gravityrail authored and jeherve committed Feb 28, 2020
    Configuration menu
    Copy the full SHA
    f0c187e View commit details
    Browse the repository at this point in the history
  2. AMP: fix linting issues introduced in D38340

    Summary:
    The file is synced with Jetpack, and D38340 cannot be merged into Jetpack as is as it introduces changes that will not pass our pre-commit hook.
    This diff fixes all PHPCS warnings.
    Test Plan: * Not much to test here, this only impacts documentation / comments.
    Reviewers: goldsounds
    Tags: #touches_jetpack_files
    
    Differential Revision: D39590
    
    This commit syncs r r203555-wpcom.
    jeherve committed Feb 28, 2020
    Configuration menu
    Copy the full SHA
    cc06218 View commit details
    Browse the repository at this point in the history