-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
Separate out implementaton of document-info and remove dependency of … #5864
Conversation
*/ | ||
export function documentInfoForDoc(nodeOrDoc) { | ||
return /** @type {!DocumentInfoDef} */ (getServiceForDoc(nodeOrDoc, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where's this code gone?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I hate git.
Pushed.
: sourceUrl; | ||
} | ||
const pageViewId = getPageViewId(this.ampdoc_.win); | ||
return this.info_ = {url, sourceUrl, canonicalUrl, pageViewId}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Per #5606 (comment), how about not caching the url
and sourceUrl
attributes? This is wayy better than having a getter property.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, but this is a refactoring. Don't want to make any changes not related to that.
Friendly ping. |
@erwinmombay or me? |
💃 |
Either or :) |
function getPageViewId(win) { | ||
return String(Math.floor(win.Math.random() * 10000)); | ||
return /** @type {!./service/document-info-impl.DocInfo} */ ( | ||
getExistingServiceForDoc(nodeOrDoc, 'documentInfo')).get(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this .get()
new? don't think ive seen this before
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nvm looks like its newly added for the cached value
…3p-frame on services. Together this improves code size for `3p-frame` based and some other extensions. Part of ampproject#5792
c749b60
to
b7f7f2c
Compare
…mp_reddit_extension * 'master' of https://github.com/ampproject/amphtml: (121 commits) `#setOwner` should rewrite `resource.owner_` value if it exist (ampproject#5898) Defer full upgrade until the element is connected (ampproject#5908) Skeleton for an amp-animation component (ampproject#5891) Use upgrade callback to pick the correct carousel class. (ampproject#5899) Add alert role to user-notification by default (ampproject#5896) Fix test-iframe-createIframeWithMessageStub failures on older browsers (ampproject#5895) Make screen readers announce changes in the slides carousel. (ampproject#5892) Separate out implementaton of document-info and remove dependency of … (ampproject#5864) Fixed assertion in key fetch function. (ampproject#5854) Track impression on amp landing page (ampproject#5606) Backward compatible way of stringifying Uint8Array (ampproject#5881) Ensure that a friendly-iframe embed cancels any boilerplate when ready (ampproject#5863) Fix amp-forms broken and flakey tests. (ampproject#5835) Make SW test properly skip when Request == undefined (ampproject#5876) Add Preamble section to AMP Cache Guidelines (ampproject#5873) Adding Adverline to amp-ad (ampproject#5829) Clarify cache guidelines (ampproject#5874) Consider it as non-viewer mode if there is no "origin" in hash param. (ampproject#5867) [amp-youtube] autoplay and test suite to run across all video players that implement the video API (ampproject#5765) Update Forms Docs to reflect availability. (ampproject#5815) ...
ampproject#5864) Together this improves code size for `3p-frame` based and some other extensions. Part of ampproject#5792
ampproject#5864) Together this improves code size for `3p-frame` based and some other extensions. Part of ampproject#5792
…3p-frame on services.
Together this improves code size for
3p-frame
based and some other extensions.Part of #5792