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

Use external amp-toolbox library instead of lib/ subfolder #5582

Merged
merged 15 commits into from
Nov 10, 2020

Conversation

schlessera
Copy link
Collaborator

Summary

This PR removes the lib/ subfolder and adapts the Composer file and the build instructions to use the external ampproject/amp-toolbox-php library instead.

This PR does not add namespace scoping to the library, assuming that any other WordPress plugin/theme should rely on the plugin's presence if they need access to the library => TBD!

Fixes #4567

Checklist

  • My pull request is addressing an open issue (please create one otherwise).
  • My code is tested and passes existing tests.
  • My code follows the Engineering Guidelines (updates are often made to the guidelines, check it out periodically).

@schlessera schlessera added Infrastructure Changes impacting testing infrastructure or build tooling Optimizer labels Nov 6, 2020
@github-actions
Copy link
Contributor

github-actions bot commented Nov 6, 2020

Plugin builds for c0d83e6 are ready 🛎️!

@pierlon
Copy link
Contributor

pierlon commented Nov 6, 2020

@schlessera one more change to be made:

diff --git a/docs/src/Cli/GenerateCommand.php b/docs/src/Cli/GenerateCommand.php
--- a/docs/src/Cli/GenerateCommand.php	(revision c0c7c7245f3f547d42a9675cb3cebfe22cf1aa29)
+++ b/docs/src/Cli/GenerateCommand.php	(date 1604685464461)
@@ -246,7 +246,6 @@
 	private function get_excluded_dirs() {
 		return [
 			'#^.*/amp/(assets|bin|build|docs|node_modules|tests|vendor)/*#',
-			'#^.*/amp/lib/(common|optimizer)/*#',
 		];
 	}
 

Copy link
Contributor

@pierlon pierlon left a comment

Choose a reason for hiding this comment

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

A few places where ampproject/optimizer is still in use:

* @deprecated Boilerplate is now automatically added via the ampproject/optimizer library.

* @package ampproject/optimizer

* @package ampproject/optimizer

Gruntfile.js Show resolved Hide resolved
Gruntfile.js Show resolved Hide resolved
@pierlon pierlon added the WS:Perf Work stream for Metrics, Performance and Optimizer label Nov 6, 2020
@pierlon pierlon added this to the v2.1 milestone Nov 6, 2020
@schlessera schlessera force-pushed the add/4567-use-external-amp-toolbox-library branch from 02183ca to 1e487ef Compare November 9, 2020 13:48
@pierlon
Copy link
Contributor

pierlon commented Nov 9, 2020

Changes look OK. I'm rebasing the PR since there's a merge conflict with the composer.lock file.

@pierlon
Copy link
Contributor

pierlon commented Nov 9, 2020

Also updating the patch to allow for the PHP 8 job to run since it's outdated.

@pierlon pierlon force-pushed the add/4567-use-external-amp-toolbox-library branch from 78d5d9f to c0d83e6 Compare November 9, 2020 23:59
Copy link
Member

@westonruter westonruter left a comment

Choose a reason for hiding this comment

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

LGTM 😄

Comment on lines 51 to +52
diff --git a/composer.json b/composer.json
index 4d24ebd44..2a98f63ce 100644
index 5a150f830..f670267f8 100644
Copy link
Member

Choose a reason for hiding this comment

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

Aside: do we even need this context? It will get out of date often.

@westonruter westonruter merged commit a82c6e4 into develop Nov 10, 2020
@westonruter westonruter deleted the add/4567-use-external-amp-toolbox-library branch November 10, 2020 07:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Infrastructure Changes impacting testing infrastructure or build tooling Optimizer WS:Perf Work stream for Metrics, Performance and Optimizer
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Turn Optimizer into a canonical PHP implementation
3 participants