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

[amp-story-player] Introduce render() method ♻️ #32153

Merged
merged 9 commits into from
Feb 1, 2021

Conversation

Enriqe
Copy link
Contributor

@Enriqe Enriqe commented Jan 22, 2021

Introduces render() method which consolidates a lot of the logic from different methods, effectively reducing the amount codepaths.

Follow up for #32115
Closes #31212
Closes #31010
Closes #31445
Closes #31562
Closes #31925
Closes #31738

@Enriqe Enriqe force-pushed the player-refactor-1 branch from f66b085 to e93d399 Compare January 25, 2021 17:16
@Enriqe Enriqe changed the title wip [amp-story-player] Introduce render() method Jan 25, 2021
@Enriqe Enriqe changed the title [amp-story-player] Introduce render() method [amp-story-player] Introduce render() method ♻️ Jan 25, 2021
@rsimha rsimha removed the request for review from danielrozenberg January 25, 2021 20:20
@rsimha rsimha removed the request for review from danielrozenberg January 25, 2021 21:27
@Enriqe Enriqe requested a review from gmajoulet January 25, 2021 23:50
@Enriqe Enriqe marked this pull request as ready for review January 25, 2021 23:50
Copy link
Contributor

@gmajoulet gmajoulet left a comment

Choose a reason for hiding this comment

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

This is fantastic ❤️

We discussed the review offline but for transparency:

  1. remove addingStories and look at if the current StoryDef has a connected iframe instead. That makes it a bit more automatic and easy to use it's cool.
  2. Remove the limit, I think with the early return in the loop we don't really need this kind of optimization, especially if it makes the code a bit easier
  3. Move the early return a bit higher so we don't even create a render promise

@Enriqe Enriqe force-pushed the player-refactor-1 branch from cded821 to 6166bc1 Compare January 29, 2021 23:46
@Enriqe Enriqe requested a review from gmajoulet January 29, 2021 23:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment