Skip to content

Analytics root to separate top-level vs embed analytics for FIE#7172

Merged
dvoytenko merged 3 commits intoampproject:masterfrom
dvoytenko:fie14-root
Jan 25, 2017
Merged

Analytics root to separate top-level vs embed analytics for FIE#7172
dvoytenko merged 3 commits intoampproject:masterfrom
dvoytenko:fie14-root

Conversation

@dvoytenko
Copy link
Copy Markdown
Contributor

Closes #6543.

/**
* @param {!JSONType} config
* @private
*/
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

can you add a bit of description what does noInline mean?

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.

Sure. Will add description. FYI, NoInline suffix ensures that closure doesn't inline the method. Since we have try/catch inlining it will cause the calling methods to loose some optimizations.

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

/**
* The implementation of the analytics root for FIE.
*/
export class EmbedAnalyticsRoot extends AnalyticsRoot {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We will have a separate impl for ShadowDOM? In that case, should we name it explicitly as IframedAnalyticsRoot?

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.

No. ShadowDOM is covered by the root. If we actually go back to shadow embeds - we can worry about this then.

/**
* Tracks custom events.
*/
export class CustomEventTracker extends EventTracker {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

did you upload all changes? i only see this used in test.

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.

It's created/used here: https://github.com/ampproject/amphtml/pull/7172/files#diff-f979d4b9254b24d9616a865981a47cd6R553

Notice, since some time ago, GitHub started to arbitrarily collapse some diffs and just puts "Load diff" instead. Drives me nuts...

this.ampdoc = ampdoc;

/** @const */
this.parent = parent;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

seems parent not used, is it needed?

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.

It's needed for VisibilityEventTracker. I stripped it out of this PR though - too big. I can remove until we get there if you'd like.

* @private
*/
addListener(config, listener, analyticsElement) {
addListenerDepr_(config, listener, analyticsElement) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

can you explain Depr_?

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.

Deprecated. Basically stuff I've removing right now.

Copy link
Copy Markdown
Contributor

@lannka lannka left a comment

Choose a reason for hiding this comment

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

Looks good. Some minor comments

@dvoytenko dvoytenko merged commit 1736865 into ampproject:master Jan 25, 2017
@dvoytenko dvoytenko deleted the fie14-root branch January 25, 2017 21:40
jridgewell pushed a commit to jridgewell/amphtml that referenced this pull request Jan 31, 2017
…roject#7172)

* Analytics root to separate top-level vs embed analytics for FIE

* test fixes

* more docs
mrjoro pushed a commit to mrjoro/amphtml that referenced this pull request Apr 28, 2017
…roject#7172)

* Analytics root to separate top-level vs embed analytics for FIE

* test fixes

* more docs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants