Skip to content

Move mutator interfaces to a separate service#25296

Closed
powerivq wants to merge 1 commit intoampproject:masterfrom
powerivq:refactor-mutator
Closed

Move mutator interfaces to a separate service#25296
powerivq wants to merge 1 commit intoampproject:masterfrom
powerivq:refactor-mutator

Conversation

@powerivq
Copy link
Copy Markdown
Contributor

@powerivq powerivq commented Oct 28, 2019

This PR moves the implementation of mutator functions into a separate service. Behaviors that are different are:

  1. The listener is moved to mutator:
      this.checkPendingChangeSize_(element);
    });

I believe it is okay, because all mutation requests start from mutator-impl. If mutator is not loaded, this logic should be a no-op anyways, so it does not alter the behavior.

  1. Added new public interfaces to resources-interface that are intended to be used by mutator only for the sake of refactoring. Plz take a look at that. It also is the cause of the bundle size increase.

  2. How should we deal with InaboxMutator? Do we want to run an experiment? I splitted InaboxResources as well, should it be kept on a separate PR?

  3. Maybe it is also a good idea to move changes to use resources to mutator in a separate PR?

@powerivq powerivq changed the title WIP Move mutator interfaces to a separate service [WIP] Move mutator interfaces to a separate service Oct 28, 2019
@powerivq powerivq force-pushed the refactor-mutator branch 2 times, most recently from 31b7ec9 to 5f1351a Compare October 31, 2019 17:38
@powerivq powerivq changed the title [WIP] Move mutator interfaces to a separate service Move mutator interfaces to a separate service Oct 31, 2019
@powerivq powerivq requested a review from lannka October 31, 2019 18:00
@powerivq powerivq force-pushed the refactor-mutator branch 4 times, most recently from 01b7e7d to fba17df Compare October 31, 2019 19:18
@amp-owners-bot
Copy link
Copy Markdown

amp-owners-bot bot commented Oct 31, 2019

Hey @gmajoulet, these files were changed:

  • extensions/amp-story/0.1/amp-story-consent.js
  • extensions/amp-story/0.1/amp-story-info-dialog.js
  • extensions/amp-story/0.1/test/test-amp-story-info-dialog.js
  • extensions/amp-story/1.0/amp-story-affiliate-link.js
  • extensions/amp-story/1.0/amp-story-embedded-component.js
  • extensions/amp-story/1.0/amp-story-info-dialog.js
  • extensions/amp-story/1.0/amp-story-page.js
  • extensions/amp-story/1.0/progress-bar.js
  • extensions/amp-story/1.0/test/test-amp-story-access.js
  • extensions/amp-story/1.0/test/test-amp-story-consent.js
  • extensions/amp-story/1.0/test/test-amp-story-embedded-component.js
  • extensions/amp-story/1.0/test/test-amp-story-info-dialog.js

Hey @newmuis, these files were changed:

  • extensions/amp-story/0.1/amp-story-consent.js
  • extensions/amp-story/0.1/amp-story-info-dialog.js
  • extensions/amp-story/0.1/test/test-amp-story-info-dialog.js
  • extensions/amp-story/1.0/amp-story-affiliate-link.js
  • extensions/amp-story/1.0/amp-story-embedded-component.js
  • extensions/amp-story/1.0/amp-story-info-dialog.js
  • extensions/amp-story/1.0/amp-story-page.js
  • extensions/amp-story/1.0/progress-bar.js
  • extensions/amp-story/1.0/test/test-amp-story-access.js
  • extensions/amp-story/1.0/test/test-amp-story-consent.js
  • extensions/amp-story/1.0/test/test-amp-story-embedded-component.js
  • extensions/amp-story/1.0/test/test-amp-story-info-dialog.js

@powerivq powerivq force-pushed the refactor-mutator branch 5 times, most recently from c18bbef to c617e95 Compare November 1, 2019 01:09
/**
* Schedules the work pass at the latest with the specified delay.
*/
schedulePassVsync() {}
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.

@dvoytenko I'm wondering why we have schedulePass & schedlePassVsync. why do we need to batch in 2 different ways?

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.

At this point it might be unnecessary. Initially this code likely dealt with inconsistencies with multi-browser event/rAF scheduling.

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.

Got it, created a clean up task to track: #25793

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.

please do some manual testing with extensions that uses mutators in different environments.

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants