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 service worker integration for AMP (temporarily) #83

Merged
merged 4 commits into from
Oct 4, 2018
Merged

Conversation

westonruter
Copy link
Collaborator

@westonruter westonruter commented Oct 4, 2018

This is porting ampproject/amp-wp#1261 over to the PWA plugin to make it easier to work with while the PWA plugin's API is in flux. And it will allow us to more easily test the API with the AMP plugin as it goes to 1.0 shortly.

Once the API is stabilized, then the AMP functionality would move over to the AMP plugin.

@westonruter westonruter changed the title Add service worker integration for AMP Add service worker integration for AMP (temporarily) Oct 4, 2018
Copy link
Collaborator

@amedina amedina left a comment

Choose a reason for hiding this comment

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

Great to keep this on this side of the equation for the time being; and also see some of the AMP optimzer toolbox in action.

Copy link
Collaborator

@felixarntz felixarntz left a comment

Choose a reason for hiding this comment

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

This looks good to me. I think it would be nice if we used a Service_Worker_Integration for parts of it, but it's not a necessity. Especially since this is going to move to the AMP plugin at some point, I'm +1 on the current state. We could always enhance later.

*/
public function add_amp_runtime_caching( $service_workers ) {
if ( ! ( $service_workers instanceof WP_Service_Worker_Scripts ) ) {
_doing_it_wrong( __METHOD__, esc_html__( 'Expected argument to be WP_Service_Workers.', 'amp' ), '1.0' );
Copy link
Collaborator

Choose a reason for hiding this comment

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

Copy-paste issue, this should be WP_Service_Worker_Scripts :)

@westonruter westonruter merged commit 600240f into master Oct 4, 2018
@westonruter westonruter deleted the add/amp branch October 4, 2018 15:25
@westonruter westonruter added this to the 0.2 milestone Apr 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants