♻️Move VariableService to doc level#22137
Merged
calebcordry merged 1 commit intoampproject:masterfrom May 6, 2019
calebcordry:vars-doc-level
Merged
♻️Move VariableService to doc level#22137calebcordry merged 1 commit intoampproject:masterfrom calebcordry:vars-doc-level
calebcordry merged 1 commit intoampproject:masterfrom
calebcordry:vars-doc-level
Conversation
lannka
approved these changes
May 3, 2019
Member
Author
|
This implements part of #19737. It moves the variable service to the doc level, but does not try to move any variables. |
mattwomple
reviewed
May 8, 2019
Member
mattwomple
left a comment
There was a problem hiding this comment.
Was this commit tested in a PWA with an AMP page that uses amp-analytics? Here's a simple test PWA where installVariableServiceForDoc fails because AMP.ampdoc does not identify the AMP document (it is undefined): https://android.cmphys.com/temp/analytics-referrer-pwa.html . The following stack trace is printed to the console (3 times):
service.js:354 Uncaught (in promise) TypeError: Cannot read property 'nodeType' of undefined
at getAmpdoc (service.js:354)
at registerServiceBuilderForDoc (service.js:162)
at installVariableServiceForDoc (variables.js:297)
at amp-analytics.js:716
at Object.global.AMP.extension (runtime.js:189)
at Object.push.f.2.../../../src/dom (amp-analytics.js:711)
at o (_prelude.js:1)
at r (_prelude.js:1)
at f (_prelude.js:1)
at Extensions.registerExtension (extensions-impl.js:179)
| 'amp-analytics-instrumentation', InstrumentationService); | ||
| AMP.registerServiceForDoc('activity', Activity); | ||
| installVariableService(AMP.win); | ||
| installVariableServiceForDoc(AMP.ampdoc); |
Member
There was a problem hiding this comment.
AMP.ampdoc does not identify the AMP document in a PWA
Member
Author
There was a problem hiding this comment.
Thanks for reporting. Will work on the fix tomorrow.
7 tasks
calebcordry
added a commit
that referenced
this pull request
May 9, 2019
This reverts commit 54afc8c.
This was referenced May 9, 2019
calebcordry
added a commit
that referenced
this pull request
May 9, 2019
danielrozenberg
pushed a commit
that referenced
this pull request
May 9, 2019
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.
h/t to @torch2424 from whom I copypasta'd a lot of this code :)