Skip to content

Commit

Permalink
Merge pull request #6303 from ampproject/update/amphtml-2105072136000
Browse files Browse the repository at this point in the history
Update AMP spec to 1d3757a07f
  • Loading branch information
westonruter authored Jun 10, 2021
2 parents 8fa2fab + cac1371 commit 8a42c7b
Show file tree
Hide file tree
Showing 8 changed files with 1,739 additions and 792 deletions.
171 changes: 88 additions & 83 deletions bin/amphtml-update.py

Large diffs are not rendered by default.

22 changes: 12 additions & 10 deletions includes/amp-helper-functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -914,11 +914,21 @@ function amp_register_default_scripts( $wp_scripts ) {
);

// Register all AMP components as defined in the spec.
foreach ( AMP_Allowed_Tags_Generated::get_extension_specs() as $extension_name => $extension_spec ) {
$extension_specs = AMP_Allowed_Tags_Generated::get_extension_specs();
if ( isset( $extension_specs['amp-carousel'] ) && '0.1' === $extension_specs['amp-carousel']['latest'] ) {
/*
* The latestVersion of amp-carousel is 0.1 in https://github.com/ampproject/amphtml/blob/main/build-system/compile/bundles.config.extensions.json
* But we have been using 0.2 since https://github.com/ampproject/amp-wp/pull/3115
* Therefore, we override the latest version to also be 0.2 since it has been shown to be stable.
*/
$extension_specs['amp-carousel']['latest'] = '0.2';
}

foreach ( $extension_specs as $extension_name => $extension_spec ) {
$src = sprintf(
'https://cdn.ampproject.org/v0/%s-%s.js',
$extension_name,
end( $extension_spec['version'] )
$extension_spec['latest']
);

$wp_scripts->add(
Expand All @@ -928,14 +938,6 @@ function amp_register_default_scripts( $wp_scripts ) {
null
);
}

if ( $wp_scripts->query( 'amp-experiment', 'registered' ) ) {
/*
* Version 1.0 of amp-experiment is still experimental and requires the user to enable it.
* @todo Revisit once amp-experiment is no longer experimental.
*/
$wp_scripts->registered['amp-experiment']->src = 'https://cdn.ampproject.org/v0/amp-experiment-0.1.js';
}
}

/**
Expand Down
Loading

0 comments on commit 8a42c7b

Please sign in to comment.