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

Fix: ReorderHead priorities #580

Merged
merged 2 commits into from
Jan 24, 2020
Merged

Fix: ReorderHead priorities #580

merged 2 commits into from
Jan 24, 2020

Conversation

sebastianbenz
Copy link
Collaborator

ReorderHead has different priorities than in the Go version (Fixes #579)

@sebastianbenz
Copy link
Collaborator Author

@schlessera PTAL

@schlessera
Copy link
Collaborator

@sebastianbenz Looks good already, but the AMP viewer runtime .js <script> tag one seems to be missing still (N° 4 for Go). This check seems to be completely missing from the Node.JS version.

@sebastianbenz
Copy link
Collaborator Author

@schlessera that's intentional. The viewer JS is only required if the AMP page is served inside a viewer, which is not the case for AMPs transformed by Optimizer. Theoretically, we could leave it in - but I didn't consider it needed when I implemented the transformer.

@schlessera
Copy link
Collaborator

schlessera commented Jan 24, 2020

As I'm running both the tests from the Go version as well as the spec test suite in here, the above was an actual blocker. The viewer JS is not, as the spec test suite doesn't even include it in the first place. So I'll just implement that to get the Go tests to pass and then this is good from my side.

@@ -60,12 +60,12 @@ class HeadNodes {
appendChild(head, this._metaCharset);
appendChild(head, this._styleAmpRuntime);
appendChild(head, this._linkStyleAmpRuntime);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

the order is irrelevant for these two as they are mutually exclusive (amp-runtime is the inlined version of v0.css).

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Changed the order for consistency and to avoid future confusion.

ReorderHead has different priorities than in the Go version (Fixes #579)
@sebastianbenz sebastianbenz merged commit a8a7f5f into master Jan 24, 2020
@sebastianbenz sebastianbenz deleted the reorder-head branch January 24, 2020 09:35
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.

Optimizer: ReorderHead has different priorities than in the Go version
3 participants