Skip to content

Paired browsing JS fails to load in WordPress 4.9 #3932

@westonruter

Description

@westonruter

Bug Description

Originally reported in #3928 (comment).

There is a conflict in WordPress 4.9 due to the amp-paired-browsing-client not being printed: https://travis-ci.org/ampproject/amp-wp/jobs/625330248#L1062-L1068

I believe this is due to the fact that amp-paired-browsing-client depends on both wp-dom-ready and wp-polyfill but only the former is being polyfilled for WordPress 4.9:

amp-wp/webpack.config.js

Lines 261 to 263 in 80e70e3

'wp-i18n': './assets/src/polyfills/wp-i18n.js',
'wp-dom-ready': './assets/src/polyfills/wp-dom-ready.js',
'wp-server-side-render': './assets/src/polyfills/wp-server-side-render.js',

In other words, there is no polyfill for the polyfills.

Three options I see here:

  1. Increase minimum WP version to 5.0 and eliminate these pre-Gutenberg polyfills altogether.
  2. Polyfill the polyfills.
  3. Prevent paired browsing from being available in WordPress 4.9.

I've gone ahead and removed the test case in 64a8051, but this will need to be fixed for v1.5 in a separate PR. That PR can revert this commit to re-add those tests.

Expected Behaviour

Paired browsing should either be not available or the minimum version of WordPress should be bumped.

Steps to reproduce

Try to access paired browsing in WordPress 4.9.


Do not alter or remove anything below. The following sections will be managed by moderators only.

Acceptance criteria

Implementation brief

QA testing instructions

Demo

Changelog entry

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions