Add comment to applylayout method for SSR#9551
Merged
honeybadgerdontcare merged 4 commits intomasterfrom May 25, 2017
Merged
Conversation
cramforce
requested changes
May 25, 2017
src/custom-element.js
Outdated
| /** | ||
| * Applies layout to the element. Visible for testing only. | ||
| * | ||
| * WARNING: The equivalent of this method is used for server-side |
Member
There was a problem hiding this comment.
Lets scream a bit more
https://github.com/ampproject/amphtml/blob/master/src/base-element.js#L120
Contributor
Author
There was a problem hiding this comment.
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. | ||
| * |
Member
There was a problem hiding this comment.
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.
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.
Contributor
Author
|
PTAL |
cramforce
approved these changes
May 25, 2017
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.