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

Stop pinning amp-carousel at v0.1 so that v0.2 can be used #3115

Merged
merged 1 commit into from
Dec 5, 2019

Conversation

westonruter
Copy link
Member

@westonruter westonruter commented Aug 28, 2019

This is a follow-up to #3084.

It turns out that amp-carousel 0.2 wasn't broken due to a dependence on amp-base-carousel, but there was some other issue: ampproject/amphtml#23966. So we can allow amp-carousel to update from 0.1 to 0.2 once the AMP fix is live.

Fixes #3700.

@westonruter westonruter added this to the v1.3 milestone Aug 28, 2019
@googlebot googlebot added the cla: yes Signed the Google CLA label Aug 28, 2019
@nainar
Copy link

nainar commented Aug 28, 2019

Would wait on us moving all carousels in amp.dev and manually confirming that before merging this to be safe

@westonruter
Copy link
Member Author

@nainar Any update on this?

I'm looking at https://amp.dev/documentation/examples/components/amp-carousel/ and I'm still seeing v0.1:

<script custom-element="amp-carousel" src="https://cdn.ampproject.org/v0/amp-carousel-0.1.js" async=""></script>

@westonruter westonruter self-assigned this Oct 24, 2019
@westonruter westonruter modified the milestones: v2.0, v1.5 Nov 7, 2019
@westonruter westonruter marked this pull request as ready for review November 7, 2019 18:36
@westonruter westonruter force-pushed the remove/amp-carousel-v0.1-pinning branch from 1b867d0 to 4d2f864 Compare November 7, 2019 18:37
@westonruter
Copy link
Member Author

@kienstra I think this is ready for review now, and that we should merge it for the 1.5 release and so that we can test it in develop. Would you check to make sure it works properly with the improvements you've been making on the galleries?

@westonruter westonruter modified the milestones: v1.5, v1.4.1 Nov 7, 2019
@westonruter
Copy link
Member Author

And actually, Naina says it's ready to go, so once we've tested we'll make it part of v1.4.1.

@kienstra
Copy link
Contributor

kienstra commented Nov 8, 2019

Question About Right Arrow In v0.2

Hi @nainar,
Could you please help with a question about the right arrow appearing with the amp-carousel v0.2 script?

Maybe this isn't an issue with AMP HTML, and there's some styling we could apply to prevent this.

Here's a CodePen of it. On changing amp-carousel-0.2.js back to amp-carousel-0.1.js in that CodePen, the issue doesn't appear anymore.

Steps to reproduce in WordPress

  1. Checkout this PR's branch, and activate Twenty Nineteen
  2. Create a new post
  3. Add a Gallery block
  4. Add only one image to it, like this
  5. Select 'Display as carousel'
  6. Click 'Preview,' and go to the AMP URL
  7. Expected: Because there's only 1 image in the carousel, there shouldn't be a right arrow
  8. Actual: There's a right arrow, but clicking it doesn't do anything:

carousel-here

  1. Create another Gallery block, but with at least 2 images
  2. Select 'Display as carousel'
  3. Click 'Preview,' and go to the AMP URL
  4. Expected: When the last slide in the carousel displays, the right arrow shouldn't be visible
  5. Actual: It's still visible:

last-slide

This isn't a common issue, and I didn't see it with most Core themes. Maybe there's some styling that Twenty Nineteen has that's associated with this issue.

@kienstra
Copy link
Contributor

kienstra commented Nov 8, 2019

Actually, I should probably make the comment above into an issue for amphtml.

@westonruter
Copy link
Member Author

@kienstra I'm not seeing the same thing. For the first carousel, I see no arrow:

image

And in the second I see no next arrow:

image

@kienstra
Copy link
Contributor

kienstra commented Nov 8, 2019

Approved

Hi @westonruter,
Since you couldn't reproduce this issue on the CodePen, this should be ready to merge.

@schlessera
Copy link
Collaborator

I could replicate the issue: ampproject/amphtml#25510 (comment)

@kienstra
Copy link
Contributor

kienstra commented Nov 8, 2019

@schlessera, thanks for testing this. I reopened the amphtml issue.

@westonruter westonruter removed this from the v1.4.1 milestone Nov 9, 2019
@westonruter westonruter added this to the v1.5 milestone Nov 9, 2019
@westonruter
Copy link
Member Author

Upstream fix has been merged: ampproject/amphtml#25549

So we can merge this PR when that AMP update has been deployed, unless we're happy to live with some flaky buttons in develop.

@kienstra
Copy link
Contributor

Sounds good!

@westonruter westonruter force-pushed the remove/amp-carousel-v0.1-pinning branch from 4d2f864 to 873a4bf Compare November 18, 2019 06:08
@westonruter
Copy link
Member Author

The fix was released a couple days ago in https://github.com/ampproject/amphtml/releases/tag/1911191835190

@westonruter westonruter merged commit 35ca34f into develop Dec 5, 2019
@westonruter westonruter deleted the remove/amp-carousel-v0.1-pinning branch December 5, 2019 08:36
@westonruter westonruter removed their assignment Dec 5, 2019
@csossi
Copy link

csossi commented Jan 27, 2020

verified in qa

@csossi csossi added the QA passed Has passed QA and is done label Feb 6, 2020
@archon810
Copy link

@westonruter Sorry to revive a necro post, but we're still seeing 0.1 load instead of 0.2. What could be the cause?

For example: https://www.androidpolice.com/2020/07/27/quick-charge-5-promises-to-charge-phones-from-0-to-100-in-just-15-minutes/?amp

image

@westonruter
Copy link
Member Author

@archon810 The issue is that amp-carousel 0.1 is being loaded by https://cdn.ampproject.org/v0/amp-lightbox-gallery-0.1.js, since v0.1 is still the latest version. Are you perhaps trying to work around ampproject/amphtml#35402?

@maciejmackowiak
Copy link

@westonruter in the above post where the bug occurs we are just using lightbox gallery by adding lightbox="lightbox" to the amp-img
We don't have any work around there.

@westonruter
Copy link
Member Author

@maciejmackowiak ok, but are you trying to fix a problem? Or are you just wondering why a different version is showing up versus what is expected?

@archon810
Copy link

@westonruter From what I understand, we're trying to resolve the bugs that are associated with 0.1 and should be fixed in 0.2.

Specifically

Judging by the fact that all of these were verified and closed before, 0.2 was live, but was then reverted back to 0.1 somehow?

@westonruter
Copy link
Member Author

@archon810 No, the issue is that amp-lightbox-gallery will lazy-load the amp-carousel script at the moment that the lightbox functionality is invoked. When you aren't using an amp-carousel on the page, then the AMP plugin doesn't add the v0.2 script to the page up-front. Since v0.2 is not the “latest” version, the means that the amp-lightbox-gallery will lazy-load v0.1 instead.

If you try adding a Gallery to a post and enable the carousel toggle in AMP Settings, then you'll see that the amp-carousel v0.2 script is added to the page initially, and when opening a lightbox it doesn't then try to lazy-load v0.1.

So, as a workaround to this I've opened #6509 which will allow you to manually wp_enqueue_script('amp-carousel') which will cause the v0.2 version to be added to the page, and then when post-processing runs it won't get stripped out when there is no amp-carousel but there is an amp-lightbox-gallery.

@archon810
Copy link

@maciejmackowiak Please take note and implement the fix when the relevant AMP release is out.

@westonruter
Copy link
Member Author

westonruter commented Aug 3, 2021

@maciejmackowiak @archon810 The PR has been merged and cherry-picked into the 2.1 branch. So you can test with the latest 2.1.x build.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes Signed the Google CLA QA passed Has passed QA and is done
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Include AMP Carousel v2
9 participants