Skip to content
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

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

Merged
merged 3 commits into from
Jan 25, 2017

Conversation

dvoytenko
Copy link
Contributor

Closes #6543.

* @param {!JSONType} config
* @private
*/
addTriggerNoInline_(config) {
Copy link
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
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
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
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
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
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
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
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
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.

*/
addListener(config, listener, analyticsElement) {
addListenerDepr_(config, listener, analyticsElement) {
Copy link
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
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
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

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