♻️Move VariableService to doc level #2#22300
♻️Move VariableService to doc level #2#22300calebcordry merged 2 commits intoampproject:masterfrom calebcordry:vars-doc-level
Conversation
| AMP.registerServiceForDoc('activity', Activity); | ||
| installVariableService(AMP.win); | ||
| installLinkerReaderService(AMP.win); | ||
| AMP.registerServiceForDoc('amp-analytics-variables', VariableService); |
There was a problem hiding this comment.
This is where the previous PR was broken. It was written as installVariableServiceForDoc(AMP.ampdoc); and AMP.ampdoc was not doing the right thing in the shadow case.
There was a problem hiding this comment.
Thanks for the heads up 😄
There was a problem hiding this comment.
so should we remove installVariableServiceForDoc if it's dangerous?
There was a problem hiding this comment.
I kind of did? It is now installVariableServiceForTesting and only used in tests.
| AMP.registerServiceForDoc('activity', Activity); | ||
| installVariableService(AMP.win); | ||
| installLinkerReaderService(AMP.win); | ||
| AMP.registerServiceForDoc('amp-analytics-variables', VariableService); |
There was a problem hiding this comment.
Thanks for the heads up 😄
|
@calebcordry Did you test this with the original example I shared with you in #22137 (direct link to comment)? When I navigate to the second page in the PWA, I see error: |
|
@mattwomple I was just going to ask you to test, I tested a few different shadow viewers but I did not see this issue. Admittedly I did not try your example. Looking now. |
Reimplementing this refactor after adding shadow integration test.
Closes #22217