Skip to content

Move mutator implementations out to a standalone service#25999

Merged
powerivq merged 1 commit intoampproject:masterfrom
powerivq:move-mutator
Jan 9, 2020
Merged

Move mutator implementations out to a standalone service#25999
powerivq merged 1 commit intoampproject:masterfrom
powerivq:move-mutator

Conversation

@powerivq
Copy link
Copy Markdown
Contributor

Phase 2 of #25296

Copy link
Copy Markdown
Contributor

@rsimha rsimha left a comment

Choose a reason for hiding this comment

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

Couple of comments.

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 sanity checks on different envs (shadowdoc, fie, inabox etc).

@powerivq powerivq force-pushed the move-mutator branch 3 times, most recently from 2c4acf3 to c469e10 Compare December 13, 2019 23:28
@powerivq
Copy link
Copy Markdown
Contributor Author

Adding @jpettitt for approval on amp-access-poool, @calebcordry for amp-story-auto-ad

@powerivq powerivq force-pushed the move-mutator branch 2 times, most recently from f709771 to 4a39a45 Compare December 17, 2019 20:55
@calebcordry
Copy link
Copy Markdown
Member

Story ads lgtm.

@powerivq powerivq force-pushed the move-mutator branch 3 times, most recently from 073080c to 58fb26c Compare December 19, 2019 01:03
@powerivq
Copy link
Copy Markdown
Contributor Author

powerivq commented Jan 6, 2020

@choumx For approval of src/*.

/**
* Flag that the height could have been changed.
*/
maybeHeightChanged() {}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I think this is a great change overall, but a side effect is that many private methods are now public.

Can we avoid this API pollution? E.g. move Resources/Mutator/Owners into their own subfolder src/service/resources/ and mark previously-private methods with @package.

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.

That sounds great. That is an existing problem where we deal with today by using presubmit check to disallow any external dependency. The drawback is that js minimizer does not transform their method names, causing increased js bundle size.

Since this PR is already large. Can we merge this and then further refactor into a package?

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

SGTM

The drawback is that js minimizer does not transform their method names, causing increased js bundle size.

This is true for both @public and @package methods right?

/**
* Flag that the height could have been changed.
*/
maybeHeightChanged() {}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

SGTM

The drawback is that js minimizer does not transform their method names, causing increased js bundle size.

This is true for both @public and @package methods right?

@powerivq powerivq merged commit 59426d2 into ampproject:master Jan 9, 2020
@powerivq powerivq deleted the move-mutator branch January 9, 2020 21:25
@powerivq
Copy link
Copy Markdown
Contributor Author

powerivq commented Jan 9, 2020

@choumx Not sure how closure compiler handles it, but I can certainly test!

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants