Skip to content

Add comment to applylayout method for SSR#9551

Merged
honeybadgerdontcare merged 4 commits intomasterfrom
honeybadgerdontcare-patch-1
May 25, 2017
Merged

Add comment to applylayout method for SSR#9551
honeybadgerdontcare merged 4 commits intomasterfrom
honeybadgerdontcare-patch-1

Conversation

@honeybadgerdontcare
Copy link
Copy Markdown
Contributor

Issue #9531 showed that changes to applylayout can have adverse affects on caches that implement server-side rendering. Make this more obvious by adding a comment for applylayout in custom-element.js.

/**
* Applies layout to the element. Visible for testing only.
*
* WARNING: The equivalent of this method is used for server-side
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Excellent, done.

* WARNING: The equivalent of this method is used for server-side
* rendering (SSR) and any changes made to it must be made in coordination
* with caches that implement SSR. For more info on SSR see bit.ly/amp-ssr.
*
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Lets clarify comments on line 238 and add one on 253.

The first block also applies to SSRed documents, but still requires significant care since the document is visible when this code runs.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done.

Increase size of warning.
Indicate that the first block applies to server-side rendering documents and then the code after does not run if server-side rendering was done on the document.
@honeybadgerdontcare
Copy link
Copy Markdown
Contributor Author

PTAL

@honeybadgerdontcare honeybadgerdontcare merged commit 3c58498 into master May 25, 2017
@honeybadgerdontcare honeybadgerdontcare deleted the honeybadgerdontcare-patch-1 branch May 25, 2017 22:29
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.

4 participants